class P1::ImageSdk::Stacking

Overview

#include <P1ImageStacking.hpp>

class Stacking
{
public:
    // methods

    void DoStacking(
        P1::ImageSdk::BitmapImage& rgbBitmap,
        P1::ImageSdk::GeometricCorrection& rgbCalibration,
        P1::ImageSdk::BitmapImage& nirBitmap,
        P1::ImageSdk::GeometricCorrection& nirCalibration,
        StackingOutput& output,
        std::allocator<uint8_t> alloc = std::allocator<uint8_t>()
        );

    void SetFineCalibration(
        uint8_t* fineCalibrationData,
        uint32_t fineCalibrationLength
        );

    uint8_t* GetFineCalibrationData();
    uint32_t GetFineCalibrationLength();
    StackerResult GetLastResult();
};

Detailed Documentation

Methods

void DoStacking(
    P1::ImageSdk::BitmapImage& rgbBitmap,
    P1::ImageSdk::GeometricCorrection& rgbCalibration,
    P1::ImageSdk::BitmapImage& nirBitmap,
    P1::ImageSdk::GeometricCorrection& nirCalibration,
    StackingOutput& output,
    std::allocator<uint8_t> alloc = std::allocator<uint8_t>()
    )

A class to stack an rgb image and a nir images from PAS280i or the 4-band solution. The rgb image is regarded as the master image. The stacker will scale and merge the two images into up to 2 the 3 different formats that are supported by the stacker. What output bitmaps that are generated is controlled by the StackingOutput struct. The same struct will after stacking is performed, contain the generated output bitmaps.

Parameters:

rgbBitmap

is a reference to the rgb image (this image will normally for a PAS system be a stitched image). This bitmap is expected to be an undistorted image.

rgbCalibration

is a reference to a struct containing a simplifed Geometric calibration (since image is undistored already - you only need to setup focallength and pixelsize).

nirBitmap

is a reference to the nir image. This bitmap is expected to be still an distorted image. The stacker will undistort the image using the geometric calibration for the nir camera.

nirCalibration

is a reference to a struct containing a full Geometric calibration for the nir bitmap (the Stacker will undistort the nir image using this struct).

output

is a struct that is used to setup the types of out puts the stacker should produce. It can produce either an Rgbi or a Irg bitmap. Aisde this it can in the same process also produce an ndvi bitmap if it is selected. The selected bitmaps are returned in this stract after a successful stacking

alloc

is an allocator that is used to allocate memory for the output bitmap. Its an optional parameter and should not be used unless its important for the host program.

throws

a SdkException on error

void SetFineCalibration(
    uint8_t* fineCalibrationData,
    uint32_t fineCalibrationLength
    )

Setup a fine calibration. A finecalibration is a binary blob setup by the stacker itself that can speed up the stacking process.

Parameters:

fineCalibrationData

is a pointer to the data where the fine calibration to setup is stored.

fineCalibrationLength

is an integer that tells how much memory the finecalibration is using

uint8_t* GetFineCalibrationData()

Get a pointer to the fine calibration data from the stacker.

uint32_t GetFineCalibrationLength()

Get an integer with the length of the fine calibration data in the stacker.

StackerResult GetLastResult()

Get the last result of the stacker. This can be used to get info about errors and warnings that had an impact on the stacker. Errors will cause the stacker to throw an excetion