Fast Transient Imaging
A Python framework revolving around reconstruction of impulse responses from AMCW lidar measurements.
|
Functions | |
def | ArrayToFloatBuffer (Array) |
This function converts a NumPy array to a binary buffer of single precision values, which can be processed by OpenEXR. More... | |
def | FloatBufferToArray (Data, Shape) |
This function converts a binary buffer of single precision values as expected by OpenEXR to a NumPy array of given Shape. More... | |
def | StoreImage (Image, FilePath) |
Stores an image to a file. More... | |
def | LoadImage (FilePath) |
This function is the counterpart of StoreImage(). More... | |
def | StoreScalarImage (ComplexOrRealImage, FilePath) |
This function creates a new image file containing the scalar values in the given array. More... | |
def | LoadScalarImage (FilePath) |
This function loads an image file containing the scalar values of a two- dimensional array as produced by StoreScalarImage(). More... | |
def | Unpack (Stream, StructFormat) |
Reads data from a stream using struct.unpack() and returns the resulting tuple. More... | |
def InputOutput.ArrayToFloatBuffer | ( | Array | ) |
This function converts a NumPy array to a binary buffer of single precision values, which can be processed by OpenEXR.
def InputOutput.FloatBufferToArray | ( | Data, | |
Shape | |||
) |
This function converts a binary buffer of single precision values as expected by OpenEXR to a NumPy array of given Shape.
def InputOutput.StoreImage | ( | Image, | |
FilePath | |||
) |
Stores an image to a file.
It is a wrapper atop wrappers to support PIL image file formats OpenEXR (*.exr) and Matlab data files (*.mat).
Image | A real array of shape (Height,Width,3) or (Height,Width). In the first case Image[Y,X,:] defines an RGB triple, in the latter case Image[Y,X] is repeated as brightness for all channels. When writing to PIL images the held values should lie between zero and one. |
FilePath | The path to an OpenEXR file (*.exr), a Matlab data file (*.mat) or a file with a file format extension supported by PIL. This is where the output image is written to. If it exists already, it is overwritten without prompt. Written OpenEXR files are always single precision RGB images. Written Matlab data files contain a single variable named Image containing the given array. |
ImportError | If PIL or OpenEXR are needed, but not available. |
def InputOutput.LoadImage | ( | FilePath | ) |
This function is the counterpart of StoreImage().
It loads an image from a file and returns it.
FilePath | The path to the image file. The choices are the same as for StoreImage(). |
def InputOutput.StoreScalarImage | ( | ComplexOrRealImage, | |
FilePath | |||
) |
This function creates a new image file containing the scalar values in the given array.
ComplexOrRealImage | A two-dimensional array containing scalar values. The values may be complex or real. |
FilePath | The path to the image file that is to be created. See StoreImage() for details. The file uses single precision and RGB channels. The red channel contains the real part of the provided values. The green channel contains the imaginary part (if present). Other channels have value zero. To avoid loss of data it is recommended to use OpenEXR files (*.exr) or Matlab data files (*.mat). |
def InputOutput.LoadScalarImage | ( | FilePath | ) |
This function loads an image file containing the scalar values of a two- dimensional array as produced by StoreScalarImage().
FilePath | The path to an image file as produced by StoreScalarImage(). |
def InputOutput.Unpack | ( | Stream, | |
StructFormat | |||
) |
Reads data from a stream using struct.unpack() and returns the resulting tuple.
StructFormat is the format string passed to struct.unpack. As many bytes as needed for this format will be read from Stream.