Customising the OpenHSI Processing Pipeline

making the real-time, and post-processing pipeline work for you
Warning

This tutorial is a work in progress.

You can customise the level of processing you want in real-time. The API for doing this in post-processing is exactly the same and is based on CameraProperties.load_next_tfms which every class dealing with datacubes will inherit.

Tip

If your processing pipeline works on raw datacubes in post-processing, you can directly use in real-time too. Keep in mind that, depending on the CPU load, the frame rate may decrease.

There are prebuilt recipies for setting the real-time processing pipeline (and for post-processing raw datacubes). You may want to customise this, for example, to implement direct georeferencing.

The Pipeline

Each callable within the pipeline is expected to ingest an array and output an array. The final array from the pipeline is then stored in a DataCube buffer as the along-axis index is incremented.

from openhsi.capture import ProcessDatacube

dc2process = ProcessDatacube(fname = "path_to_datacube_file.nc", processing_lvl=4,
                             json_path=json_path, pkl_path=pkl_path)
dc2process.load_next_tfms([proced_dc.dn2rad])
dc2process.collect()