class P1::ImageSdk::Stitching

Overview

#include <P1ImageStitching.hpp>

class Stitching
{
public:
    // methods

    P1::ImageSdk::BitmapImage DoStitching(
        P1::ImageSdk::RawImage& leftImage,
        P1::ImageSdk::BitmapImage& leftBitmap,
        P1::ImageSdk::RawImage& rightImage,
        P1::ImageSdk::BitmapImage& rightBitmap,
        std::allocator<uint8_t> alloc = std::allocator<uint8_t>()
        );

    P1::ImageSdk::BitmapImage DoStitching(
        P1::ImageSdk::RawImage& leftImage,
        P1::ImageSdk::BitmapImage& leftBitmap,
        P1::ImageSdk::GeometricCorrection& leftCalibration,
        P1::ImageSdk::RawImage& rightImage,
        P1::ImageSdk::BitmapImage& rightBitmap,
        P1::ImageSdk::GeometricCorrection& rightCalibration,
        double nominalFocalLength,
        std::allocator<uint8_t> alloc = std::allocator<uint8_t>()
        );

    int CalculateAverageLumaForOverlap(P1::ImageSdk::RawImage& image);

    void SetFineCalibration(
        uint8_t* fineCalibrationData,
        uint32_t fineCalibrationLength
        );

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

Detailed Documentation

Methods

P1::ImageSdk::BitmapImage DoStitching(
    P1::ImageSdk::RawImage& leftImage,
    P1::ImageSdk::BitmapImage& leftBitmap,
    P1::ImageSdk::RawImage& rightImage,
    P1::ImageSdk::BitmapImage& rightBitmap,
    std::allocator<uint8_t> alloc = std::allocator<uint8_t>()
    )

A class to stitch L and R images from a PAS280 camera. The left image is regarded as the master image. The stitcher will seamlessly merge togther the two images into one large image.

Parameters:

leftImage

is a reference to the left image (containing metadata etc.)

leftBitmap

is a reference to a bitmap of the left image

rightImage

is a reference to the right image (containing metadata etc.)

rightBitmap

is a reference to a bitmap of the right image

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

an SdkException on errors

Returns:

A bitmap containing the stitched image. The memory for the bitmap is allocated by the allocator and must be freed by the host software when not needed.

P1::ImageSdk::BitmapImage DoStitching(
    P1::ImageSdk::RawImage& leftImage,
    P1::ImageSdk::BitmapImage& leftBitmap,
    P1::ImageSdk::GeometricCorrection& leftCalibration,
    P1::ImageSdk::RawImage& rightImage,
    P1::ImageSdk::BitmapImage& rightBitmap,
    P1::ImageSdk::GeometricCorrection& rightCalibration,
    double nominalFocalLength,
    std::allocator<uint8_t> alloc = std::allocator<uint8_t>()
    )

A class to stitch L and R images from a PAS280 camera. The left image is regarded as the master image. The stitcher will seamlessly merge togther the two images into one large image.

Parameters:

leftImage

is a reference to the left image (containing metadata etc.)

leftBitmap

is a reference to a bitmap of the left image

leftCalibration

is a reference to geometric calibration for left image

rightImage

is a reference to the right image (containing metadata etc.)

rightBitmap

is a reference to a bitmap of the right image

rightCalibration

is a reference to geometric calibration for right image

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

an SdkException on errors

Returns:

A bitmap containing the stitched image. The memory for the bitmap is allocated by the allocator and must be freed by the host software when not needed.

void SetFineCalibration(
    uint8_t* fineCalibrationData,
    uint32_t fineCalibrationLength
    )

Setup a fine calibration. A finecalibration is a binary blob setup by the stitcher itself that can speed up the stitching 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 stitcher.

uint32_t GetFineCalibrationLength()

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

StitcherResult GetLastResult()

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