Fast Transient Imaging
A Python framework revolving around reconstruction of impulse responses from AMCW lidar measurements.
|
This class encapsulates a series of measurements consisting of multiple moment images. More...
Public Member Functions | |
def | __init__ (self) |
Initializes this series of measurements as empty. More... | |
def | AddCaptureData |
Loads capture data stored in the given directory using a binary format. More... | |
def | GetPhaseSet |
This function returns a set containing all phases (in radians) for which measurements are available at the given frequency (in Hz). More... | |
def | RemovePhases |
This function removes all moment images whose phase shift (in radians) is not found in the given iterable (with some tolerance). More... | |
def | GetSortedTakes (self) |
This function constructs and returns a dictionary containing all moment images in this measurement. More... | |
def | FixVideoOutliers |
This function assumes that this measurement provides data for a video where each frame (i.e. More... | |
def | FixStaticOutliers |
This function assumes that this measurement provides data of a static scene captured with many takes. More... | |
def | GetTrigonometricMomentImage |
This function uses the available measurements to construct an image of trigonometric moments for the given frequency. More... | |
def | GetTrigonometricMomentImageStack |
Invokes GetTrigonometricMomentImage() repeatedly for the given frequencies to construct a CTrigonometricMomentImageStack matching this measurement. More... | |
def | Smooth (self, StandardDeviationInPixels) |
Applies smoothing to all held moment images using a Gaussian filter with the specified standard deviation in pixels. More... | |
def | PlotValueRanges (self, FrequencyList) |
This function considers the moment images for the frequencies in the given list and visualizes their minimal and maximal values through scatter plots using the phase as x-axis. More... | |
def | PlotPixelData |
This function visualizes information available for the pixel with the given coordinates. More... | |
def | ShowMomentImages (self, FrequencyList) |
This function displays available moment images for the given frequencies in unmodified form. More... | |
Public Attributes | |
MomentImageList | |
Static Public Attributes | |
tuple | MomentImageList = list() |
A list of CMomentImage objects providing all data for this measurement. More... | |
This class encapsulates a series of measurements consisting of multiple moment images.
This is typically more or less unprocessed raw-data from a photonic mixer device.
def __init__ | ( | self | ) |
Initializes this series of measurements as empty.
def AddCaptureData | ( | self, | |
Path, | |||
FilterFunction = lambda ExposureTime , |
|||
Frequency, | |||
PhaseShift, | |||
Take | |||
) |
Loads capture data stored in the given directory using a binary format.
Path | The path of the directory containing the data. The filenames have to match the default scheme, otherwise they are ignored. |
FilterFunction | A function determining whether a file is loaded or not based on the meta-information in the file name. The parameters are ExposureTime (in seconds), Frequency (in Hertz), PhaseShift (in radians) and Take (zero-based index). The function should return True if the file is to be loaded and False otherwise. |
SubtractImages | If this is True, pairs of images with with a relative phase shift of pi are subtracted from one-another before storing them. Otherwise two separate moment images are stored. |
IgnoreTaps | If this boolean is True, the function only loads the first moment image from each file. This can be useful because the power of the laser diodes drops off during the capture of four images. This setting overrides SubtractImages. |
def GetPhaseSet | ( | self, | |
Frequency = None |
|||
) |
This function returns a set containing all phases (in radians) for which measurements are available at the given frequency (in Hz).
If Frequency is None, phases of all frequencies are used.
def RemovePhases | ( | self, | |
PhaseSet, | |||
Frequency = None , |
|||
Tolerance = 1.0e-5 |
|||
) |
This function removes all moment images whose phase shift (in radians) is not found in the given iterable (with some tolerance).
If a frequency is given, the operation only removes moment images recorded with this modulation frequency (in Hz).
def GetSortedTakes | ( | self | ) |
This function constructs and returns a dictionary containing all moment images in this measurement.
The keys have the form (ExposureTime, Frequency,PhaseShift,Tap) the values are lists of indices into self.MomentImageList. The lists are sorted by the index of the take.
def FixVideoOutliers | ( | self, | |
CurvatureThreshold = 20.0 , |
|||
DerivativeThreshold = 15.0 , |
|||
EnablePlotting = False |
|||
) |
This function assumes that this measurement provides data for a video where each frame (i.e.
take) holds the same set of images captured at different times. It then searches for images, which are statistical outliers as a whole (our prototype hardware produces such outliers). All found outliers are replaced by corresponding data from the previous frame.
CurvatureThreshold,DerivativeThreshold | Thresholds on the discrete curvature and divided difference of the median of the images over time. Greater thresholds discard less data. |
EnablePlotting | If this boolean is True, a matplotlib figure is created to visualize which images have been marked as outlier. |
def FixStaticOutliers | ( | self, | |
MinFractionToKeep = 0.9 , |
|||
EnablePlotting = False |
|||
) |
This function assumes that this measurement provides data of a static scene captured with many takes.
It then searches for images, which are statistical outliers as a whole (when arccos phase sampling is enabled our prototype hardware produces such outliers). All found outliers are replaced by the mean of non-outliers.
MinFractionToKeep | This fraction defines the minimal amount of frames to keep (per frequency, take, tap and exposure). |
EnablePlotting | If this boolean is True, a matplotlib figure is created to visualize which images have been marked as outlier. |
def GetTrigonometricMomentImage | ( | self, | |
Frequency, | |||
Take = None |
|||
) |
This function uses the available measurements to construct an image of trigonometric moments for the given frequency.
The image is returned. If no measurements or too few measurements are available for the given frequency, it returns None. The complex scaling of the returned image is somewhat arbitrary due to lack of knowledge of the modulation function. If Take is not None only moment images for this take are considered.
def GetTrigonometricMomentImageStack | ( | self, | |
FrequencyList, | |||
Take = None |
|||
) |
Invokes GetTrigonometricMomentImage() repeatedly for the given frequencies to construct a CTrigonometricMomentImageStack matching this measurement.
The result is returned. If required information is missing a ValueError is thrown. If data is lacking for frequency zero, the function generates an all zero moment image to ensure that biasing generates a meaningful zeroth moment everywhere. If Take is not None only moment images for this take are considered.
def Smooth | ( | self, | |
StandardDeviationInPixels | |||
) |
Applies smoothing to all held moment images using a Gaussian filter with the specified standard deviation in pixels.
def PlotValueRanges | ( | self, | |
FrequencyList | |||
) |
This function considers the moment images for the frequencies in the given list and visualizes their minimal and maximal values through scatter plots using the phase as x-axis.
def PlotPixelData | ( | self, | |
X, | |||
Y, | |||
FrequencyList, | |||
ShowScatterPlots = True , |
|||
ShowGraphPlots = False , |
|||
ShowFourierPlots = False , |
|||
ShowExposurePlots = False , |
|||
FigureTitleSuffix = "" |
|||
) |
This function visualizes information available for the pixel with the given coordinates.
In particular, it visualizes how trigonometric moments are constructed from the available information and how these moments are located in relation to each other. It constructs moments based upon the frequencies in the given list. If you pass None for the pixel coordinates the respective coordinates are picked uniformly at random. The boolean parameters define what kind of plots is shown. The given suffix is used in figure titles.
def ShowMomentImages | ( | self, | |
FrequencyList | |||
) |
This function displays available moment images for the given frequencies in unmodified form.
It is particularly useful for identifying over- or under exposed regions.
|
static |
A list of CMomentImage objects providing all data for this measurement.
MomentImageList |