which is the mathematics to go from a 360 photo (basically a JPG with spherical o rectangular projection) into a 3d model with dimensions?

How can a 360 picture (such as Matterport) be converted to a 3D model with dimensions? Which is the math behind it? Is the 3D model usually a point cloud (from which a 3D mesh can be created)?