Reconstruction

class reconstruction.Reconstruction(imager1, imager2, time, sizeUndistorted=[1000, 1000, 3], altitudes=[500], pixelWidths=[1], tilts=[[0, 0], [35, 0], [35, 90], [35, 180], [35, 270]])[source]

Contains all the methods for creating a 3D reconstruction from the base height from two sky pictures taken at the same time. Most functions need to be applied in the correct order to complete the workflow. See main.py for an example.

imager1

Imager – Imager used to take the first image

imager2

Imager – Imager used to take the second image

time

datetime.datetime – Time at which the images were captured

sizeUndistorted

list[int] – Size of the undistorted planes

altitudes

list[int] – Altitudes of the undistorted planes

pixelWidths

list[int] – Widths in meters of one pixel of the undistorted plane

tilts

list[list[int] – List of angles [elevation, azimuth] of the undistorted planes

images

dict[list[numpy.array]] – Dictionary (over each imager) of arrays of LDR images captured by that imager

undistorted

dict[list[numpy.array]] – Dictionary of list of LDR undistorted planes for each combination of undistortion parameters for the first imager

tonemapped

dict[dict[numpy.array]] – Dictionary (over each imager) of dictionaries of tonemapped images for each combination of undistortion parameters for that imager

pts

dict[dict[numpy.array]] – Dictionary (over each imager) of dictionaries of n*2 feature points locations in the undistorted planes of the that imager

rays

dict[dict[numpy.array]] – Dictionary (over each imager) of dictionary of 3*n vectors from the origin at the center of the imager towards each feature point in the planes for the that imager

ptsWorld

dict[numpy.array] – Dictionary of 3*n’ coordinates of the reconstructed points, at the midpoint of the shortest segment between both rays from both imagers

ptsWorldMerged

numpy.array – ptsWorld concatenated in a single array independently of undistortion planes

ptsWorldRays

dict[dict[numpy.array]] – Dictionary (over each imager) of dictionary of 3*n’ coordinates of the reconstructed points, on the rays originating from the first imager

ptsWorldRaysMerged

dict[dict[numpy.array]] – Dictionary (over each imager) of the reconstructed points in ptsWorldRays (all undistortion planes merged in common arrays)

ptsPictureImager

dict[dict[numpy.array]] – Dictionary (over each imager) of dictionaries of 2*n’ vectors of the image plane locations corresponding to each reconstructed points for that imager

ptsPictureImagerMerged

dict[numpy.array] – Dictionary (over each imager) of the image locations in ptsPictureImager (all undistortion planes merged in common arrays)

distances

dict[numpy.array] – Dictionary of n’ vectors of the lenghts of the shortest segments between the rays of the first and the second imager

distancesMerged

numpy.array – distances concatenated in a single array independently of undistortion planes

triangulationError

float – Mean lenghth of the shortest segments between rays for each pair of matching features

meanHeight

float – Mean z coordinate of the reconstructed points

stdHeight

float – Standard deviation of the z coordinates of the reconstructed points

nbPts

int – Number of reconstructed points

cloudBaseHeight

float – 10th percentile of the z coordinates of the reconstructed points, assumed to be the cloud base height

segmentationMask

np.array – Sky/cloud segmentation mask for the first imager

triangulation

matplotlib.tri.Triangulation – Delaunay triangulation between the reconstructed points

computeMetrics()[source]

Computes the light rays from the pairs of matching points concatenateValues() must be called before.

computeRays()[source]

Computes the light rays from the pairs of matching points match() must be called before.

computeTriangulation()[source]

Creates the triangulation between reconstructed points for visualization. concatenateValues() must be called before.

concatenateValues()[source]

Concatenates all the computed values from all the different planes into a single vectors. intersectRays() must be called before.

intersectRays(threshold=100)[source]

Computes the intersection the light rays from the matching pairs computeRays() must be called before.

Parameters:threshold (int) – the minimum distance between two rays to discard a match.
iter_planes()[source]

Helper function to iterate over all undistortion plane parameters (altitudes, pixel width and tilts).

Returns:over all (altitude, pixel width, tilts) tuples
Return type:iterator
load_images(images1, images2)[source]

Loads the input LDR images captured at the same instant by both imagers.

Parameters:
  • images1 (list[numpy.array]) – LDR images captured by imager1
  • images2 (list[numpy.array]) – LDR images captured by imager2
match()[source]

Creates sift matching reconstruction between a pair of undistorted images. tonemap() must be called before.

process()[source]

Executes the entire reconstruction process. Alternatively, every function can be called individually. load_images() must be called before.

removeOutliers()[source]

Removes outliers in the set of reconstructed points intersectRays() must be called before.

tonemap()[source]

Tonemapps the undistorted planes. undistort() must be called before.

undistort()[source]

Generates the undistortion planes. load_images() must be called before.

writeFigure(filename)[source]

Creates a visualization of the reconstructed elements. createTriangulation() must be called before.