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, StitchingMetrics& metrics, double& outputFocalLength, std::allocator<uint8_t> alloc = std::allocator<uint8_t>() ); P1::ImageSdk::BitmapImage DoStitching( P1::ImageSdk::RawImage& leftImage, P1::ImageSdk::BitmapImage& leftBitmap, const P1::ImageSdk::ConvertConfig& leftConfig, P1::ImageSdk::RawImage& rightImage, P1::ImageSdk::BitmapImage& rightBitmap, const P1::ImageSdk::ConvertConfig& rightConfig, StitchingMetrics& metrics, double& outputFocalLength, std::allocator<uint8_t> alloc = std::allocator<uint8_t>() ); P1::ImageSdk::BitmapImage DoPasPanaStitching( P1::ImageSdk::RawImage& leftImage, P1::ImageSdk::BitmapImage& leftBitmap, const P1::ImageSdk::ConvertConfig& leftConfig, P1::ImageSdk::RawImage& rightImage, P1::ImageSdk::BitmapImage& rightBitmap, const P1::ImageSdk::ConvertConfig& rightConfig, bool useMeanFocalPlane, StitchingMetrics& metrics, double& outputFocalLength, std::allocator<uint8_t> alloc = std::allocator<uint8_t>() ); int CalculateAverageLumaForOverlap(P1::ImageSdk::RawImage& image); bool CalculateGainForPas280Overlap( P1::ImageSdk::RawImage& leftImage, P1::ImageSdk::RawImage& rightImage, double& leftGain, double& rightGain ); 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, StitchingMetrics& metrics, double& outputFocalLength, 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 |
metrics |
is a struct where metrics from the sticthing is returned. The metrics can be used to evaluate the precision. Only use them if stitching went through |
outputFocalLength |
is the focal length used when creating the output 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, const P1::ImageSdk::ConvertConfig& leftConfig, P1::ImageSdk::RawImage& rightImage, P1::ImageSdk::BitmapImage& rightBitmap, const P1::ImageSdk::ConvertConfig& rightConfig, StitchingMetrics& metrics, double& outputFocalLength, 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 |
leftConfig |
is the ConvertConfig of left image |
rightImage |
is a reference to the right image (containing metadata etc.) |
rightBitmap |
is a reference to a bitmap of the right image |
rightConfig |
is the ConvertConfig of right image |
metrics |
is a struct where metrics from the sticthing is returned. The metrics can be used to evaluate the precision. Only use them if stitching went through |
outputFocalLength |
is the focal length used when creating the output 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 DoPasPanaStitching( P1::ImageSdk::RawImage& leftImage, P1::ImageSdk::BitmapImage& leftBitmap, const P1::ImageSdk::ConvertConfig& leftConfig, P1::ImageSdk::RawImage& rightImage, P1::ImageSdk::BitmapImage& rightBitmap, const P1::ImageSdk::ConvertConfig& rightConfig, bool useMeanFocalPlane, StitchingMetrics& metrics, double& outputFocalLength, std::allocator<uint8_t> alloc = std::allocator<uint8_t>() )
A class to stitch L and R nir images from a PAS PANA camera. The left nir image is regarded as the master image. The stitcher will seamlessly merge togther the two images into one large nir image.
Parameters:
leftImage |
is a reference to the left nir image (containing metadata etc.) |
leftBitmap |
is a reference to a bitmap of the left nir image |
leftConfig |
is a reference to ConvertConfig of the left image |
rightImage |
is a reference to the right nir image (containing metadata etc.) |
rightBitmap |
is a reference to a bitmap of the right nir image |
rightConfig |
is a reference to ConvertConfig of the right image |
useMeanFocalPlane |
|
metrics |
is a struct where metrics from the sticthing is returned. The metrics can be used to evaluate the precision. Only use them if stitching went through |
outputFocalLength |
is the focal length used when creating the output 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.
int CalculateAverageLumaForOverlap(P1::ImageSdk::RawImage& image)
Calculate the average luma value for the overlap of a PAS280 image. The function will find out if the image is left or right automaticly. The purpose of the function as to align the gain levels of the left and right image in a PAS280. The value can be used in a convert config to gain up the “weakest image” so it is at the same exposure level as the other image.
Parameters:
image |
is a reference to a left or right PAS280 image |
Returns:
the average luma value
bool CalculateGainForPas280Overlap( P1::ImageSdk::RawImage& leftImage, P1::ImageSdk::RawImage& rightImage, double& leftGain, double& rightGain )
Calculate the left and right gain to be used for the processing of n PAS280 image. This function uses the CalculateAverageLumaForOverlap() function for both nd right side and calculates the gain for both left and right image to align the exposure level between the two images. The gains can be directly in the convert config for each image.
Parameters:
leftImage |
is a reference to the left PAS280 image |
rightImage |
is a reference to the right PAS280 image |
leftGain |
is a reference to where the resulting left gain should be stored |
rightGain |
is a reference to where the resulting right gain should be stored |
Returns:
a boolean value indicating if calculation was a success (true) or failed (false)
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.