Process:
- Have the camera's relative position and orientation for each snapshot (might not be needed later) for stationary object(s).
- For each snapshot:
- Separate surfaces so you can have a mask for each surface (that's a long post for another day).
- Get the border/edges (white, but touching black in a cardinal direction -- north, south, east, west):
- Obtain the order of the surfaces' vertices (you might have multiple vertex chains if you have a complex shape -- like a torus).
- You can create chains of vertices that only link pixels when they are within a short distance (1 pixel if x's or y's are equal, sqrt(2) pixels if they aren't).
- Define triangular planes between each pair of sequential vertices that connect to the camera's position.
- Extend the planes farther out from the camera, but it should still be orthogonal to the same normal (move it at least twice as far).
- If vertex chains are a loops, each chain defines an in and out region based on which side is in/out of the mask.
- Counting outside in, you can treat the odd numbered chains as filling on the inside and even numbered chains as filling their outsides.
- Adjusting for movement of the camera between snapshots, rotate the vertices around Z (or whatever your "Up" axis is).
- Get the intersection of the in and out regions to obtain a 3D object.
- If you use Blender's Boolean Intersection, I recommend:
- using "Carve",
- using Dissolve Degenerate between intersection steps,
- Adding faces (F)
- Automating it with Python! (there are a lot of intersection steps!)
- Note: the Boolean modifier can be very finicky if you use it many times on one object -- I ended up using only half of the camera steps just to avoid the shape disappearing completely.
- Alternatively, you can intersect the shapes in pairs to minimize the number of Boolean operators for any one shape (by spreading them out), which let me use all of my camera angles.
- For round objects, more perspectives will lead to more precision (ideally, you could loop around the whole axis of the round object with the camera).
- If you're up for some post processing on the input images, you could smooth the vertex chains to remove the vertices that create that staircase effect in some regions, but you'd have to pick an arbitrary threshold for what constitutes a staircase.
- (what if the object really does look like a staircase? You'd smooth it away)
- Because of the perspective warping, you'll always need to take pictures in either pairs or 4's.
- 2 pictures 180 degrees apart or 4 pictures every 90 degrees (depending on how much symmetry or roundness there is).
- Concave bowls (like a 360 degree lathed U) are practically impossible to recreate with these simple masking images from the outside (you'd have to put the camera inside with many positions instead of orbiting it).
- If you really wanted to get recesses, you can take advantage of:
- Motion video: obtain topology info by observing how distinctively colored marble(s) move along surfaces.
- Spotlights: obtain topology info by seeing how circular lights warp as they move along a surface.
- Projectors: project a grid onto the surface to observe the warping.




