The RECON3 function can reconstruct a three-dimensional data array from two or more images (or projections) of an object. For example, if you placed a dark object in front of a white background and then photographed it three times (each time rotating the object a known amount) then these three images could be used with RECON3 to approximate a 3D volumetric representation of the object. RECON3 also works with translucent projections of an object. RECON3 returns a 3D byte array.
This routine is written in the IDL language. Its source code can be found in the file
subdirectory of the IDL distribution.
Images used in reconstruction should show strong light/dark contrast between the object and the background. If the images contain low (dark) values where the object is and high (bright) values where the object isn't, the MODE keyword should be set to +1 and the returned volume will have low values where the object is, and high values where the object isn't. If the images contain high (bright) values where the object is and low (dark) values where the object isn't, the MODE keyword should be set to -1 and the returned volume will have high values where the object is, and low values where the object isn't.
In general, the object must be CONVEX for a good reconstruction to be possible. Concave regions are not easily reconstructed. An empty coffee cup, for example, would be reconstructed as if it were full.
The more images the better. Images from many different angles will improve the quality of the reconstruction. It is also important to supply images that are parallel and perpendicular to any axes of symmetry. Using the coffee cup as an example, at least one image should be looking through the opening in the handle. Telephoto images are also better for reconstruction purposes than wide angle images.
A 3D array containing the images to use to reconstruct the volume. Execution time increases linearly with more images. Images must be an 8-bit (byte) array with dimensions ( x , y , n ) where x is the horizontal image dimension, y is the vertical image dimension, and n is the number of images. Note that n must be at least 2.
A 3 x n floating-point array specifying the amount the object is rotated to make it appear as it does in each image. The object is first rotated about the X axis, then about the Y axis, and finally about the Z axis (with the object's reference point at the origin). Obj_Rot [0, *] is the X rotation for each image, Obj_Rot [1, *] is the Y rotation, and Obj_Rot [2, *] is the Z rotation.
A 3 x n floating-point array specifying the position of the object's reference point relative to the camera lens. The camera lens is located at the coordinate origin and points in the negative Z direction (the view up vector points in the positive Y direction). Obj_Pos should be expressed in this coordinate system. Obj_Pos [0, *] is the X position for each image, Obj_Pos [1, *] is the Y position, and Obj_Pos [2, *] is the Z position. All the values in Obj_Pos [2, *] should be less than zero. Note that the values for Obj_Pos , Focal , Dist , and Vol_Pos should all be expressed in the same units (mm, cm, m, in, ft, etc.).
A 3 x 2 floating-point array specifying the two opposite corners of a cube that surrounds the object. Vol_Pos should be expressed in the object's coordinate system relative to the object's reference point. Vol_Pos [*, 0] specifies one corner and Vol_Pos [*, 1] specifies the opposite corner.
A 2 x n integer or floating-point array that specifies the pixel location at which the object's reference point appears in each of the images. Img_Ref [0, *] is the X coordinate for each image and Img_Ref [1, *] is the Y coordinate.
A 2 x n integer or floating-point array that specifies the magnification factor for each image. This number is actually the length (in pixels) that a test object would appear in an image if it were n units long and n units distant from the camera lens. Img_Mag [0, *] is the X dimension (in pixels) of a test object for each image, and Img_Mag [1, *] is the Y dimension. All elements in Img_Mag should be greater than or equal to 1.
A 3-element integer or floating-point array that specifies the size of the 3D byte array to return. Execution time (and resolution) increases exponentially with larger values for Vol_Size . Vol_Size  specifies the X dimension of the volume, Vol_Size  specifies the Y dimension, and Vol_Size  specifies the Z dimension.
Set this keyword to a value less than zero to define each cell in the 3D volume as the minimum of the corresponding pixels in the images. Set MODE to a value greater than zero to define each cell in the 3D volume as the maximum of the corresponding pixels in the images. If MODE is set equal to zero then each cell in the 3D volume is defined as the average of the corresponding pixels in the images.
MODE should usually be set to -1 when the images contain a bright object in front of a dark background or to +1 when the images contain a dark object in front of a light background. Setting MODE=0 (the default) requires more memory since the volume array must temporarily be kept as an integer array instead of a byte array.