.. index:: pair: class; P1::ImageSdk::Stitching .. _doxid-class_p1_1_1_image_sdk_1_1_stitching: class P1::ImageSdk::Stitching ============================= .. toctree:: :hidden: Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class Stitching { public: // methods :ref:`P1::ImageSdk::BitmapImage` :ref:`DoStitching`( :ref:`P1::ImageSdk::RawImage`& leftImage, :ref:`P1::ImageSdk::BitmapImage`& leftBitmap, :ref:`P1::ImageSdk::RawImage`& rightImage, :ref:`P1::ImageSdk::BitmapImage`& rightBitmap, :ref:`StitchingMetrics`& metrics, double& outputFocalLength, std::allocator alloc = std::allocator() ); :ref:`P1::ImageSdk::BitmapImage` :ref:`DoStitching`( :ref:`P1::ImageSdk::RawImage`& leftImage, :ref:`P1::ImageSdk::BitmapImage`& leftBitmap, const :ref:`P1::ImageSdk::ConvertConfig`& leftConfig, :ref:`P1::ImageSdk::RawImage`& rightImage, :ref:`P1::ImageSdk::BitmapImage`& rightBitmap, const :ref:`P1::ImageSdk::ConvertConfig`& rightConfig, :ref:`StitchingMetrics`& metrics, double& outputFocalLength, std::allocator alloc = std::allocator() ); :ref:`P1::ImageSdk::BitmapImage` :ref:`DoPasPanaStitching`( :ref:`P1::ImageSdk::RawImage`& leftImage, :ref:`P1::ImageSdk::BitmapImage`& leftBitmap, const :ref:`P1::ImageSdk::ConvertConfig`& leftConfig, :ref:`P1::ImageSdk::RawImage`& rightImage, :ref:`P1::ImageSdk::BitmapImage`& rightBitmap, const :ref:`P1::ImageSdk::ConvertConfig`& rightConfig, bool useMeanFocalPlane, :ref:`StitchingMetrics`& metrics, double& outputFocalLength, std::allocator alloc = std::allocator() ); int :ref:`CalculateAverageLumaForOverlap`(:ref:`P1::ImageSdk::RawImage`& image); bool :ref:`CalculateGainForPas280Overlap`( :ref:`P1::ImageSdk::RawImage`& leftImage, :ref:`P1::ImageSdk::RawImage`& rightImage, double& leftGain, double& rightGain ); void :ref:`SetFineCalibration`( uint8_t* fineCalibrationData, uint32_t fineCalibrationLength ); uint8_t* :ref:`GetFineCalibrationData`(); uint32_t :ref:`GetFineCalibrationLength`(); :ref:`StitcherResult` :ref:`GetLastResult`(); }; .. _details-class_p1_1_1_image_sdk_1_1_stitching: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Methods ------- .. index:: pair: function; DoStitching .. _doxid-class_p1_1_1_image_sdk_1_1_stitching_1a07b4b505d9b39c1e8f173f5556ab36e0: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`P1::ImageSdk::BitmapImage` DoStitching( :ref:`P1::ImageSdk::RawImage`& leftImage, :ref:`P1::ImageSdk::BitmapImage`& leftBitmap, :ref:`P1::ImageSdk::RawImage`& rightImage, :ref:`P1::ImageSdk::BitmapImage`& rightBitmap, :ref:`StitchingMetrics`& metrics, double& outputFocalLength, std::allocator alloc = std::allocator() ) 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. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - 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 :ref:`SdkException ` on errors .. rubric:: 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. .. index:: pair: function; DoStitching .. _doxid-class_p1_1_1_image_sdk_1_1_stitching_1aa0411d902842f211df70da355f3cdf5e: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`P1::ImageSdk::BitmapImage` DoStitching( :ref:`P1::ImageSdk::RawImage`& leftImage, :ref:`P1::ImageSdk::BitmapImage`& leftBitmap, const :ref:`P1::ImageSdk::ConvertConfig`& leftConfig, :ref:`P1::ImageSdk::RawImage`& rightImage, :ref:`P1::ImageSdk::BitmapImage`& rightBitmap, const :ref:`P1::ImageSdk::ConvertConfig`& rightConfig, :ref:`StitchingMetrics`& metrics, double& outputFocalLength, std::allocator alloc = std::allocator() ) 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. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - 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 :ref:`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 :ref:`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 :ref:`SdkException ` on errors .. rubric:: 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. .. index:: pair: function; DoPasPanaStitching .. _doxid-class_p1_1_1_image_sdk_1_1_stitching_1ae3ccad0615cf9ad3c9621aadf9bf5761: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`P1::ImageSdk::BitmapImage` DoPasPanaStitching( :ref:`P1::ImageSdk::RawImage`& leftImage, :ref:`P1::ImageSdk::BitmapImage`& leftBitmap, const :ref:`P1::ImageSdk::ConvertConfig`& leftConfig, :ref:`P1::ImageSdk::RawImage`& rightImage, :ref:`P1::ImageSdk::BitmapImage`& rightBitmap, const :ref:`P1::ImageSdk::ConvertConfig`& rightConfig, bool useMeanFocalPlane, :ref:`StitchingMetrics`& metrics, double& outputFocalLength, std::allocator alloc = std::allocator() ) 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. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - 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 :ref:`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 :ref:`ConvertConfig ` of the right image * - useMeanFocalPlane - - enable mean focal plane correction, this is an experimental feature that is normally not used. * - 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 :ref:`SdkException ` on errors .. rubric:: 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. .. index:: pair: function; CalculateAverageLumaForOverlap .. _doxid-class_p1_1_1_image_sdk_1_1_stitching_1affffba4cff1dfa12206a2d290a23f3e2: .. ref-code-block:: cpp :class: doxyrest-title-code-block int CalculateAverageLumaForOverlap(:ref:`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. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - image - is a reference to a left or right PAS280 image .. rubric:: Returns: the average luma value .. index:: pair: function; CalculateGainForPas280Overlap .. _doxid-class_p1_1_1_image_sdk_1_1_stitching_1a92b3ea5578aa7f1944edaa0499e89ce2: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool CalculateGainForPas280Overlap( :ref:`P1::ImageSdk::RawImage`& leftImage, :ref:`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 :ref:`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. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - 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 .. rubric:: Returns: a boolean value indicating if calculation was a success (true) or failed (false) .. index:: pair: function; SetFineCalibration .. _doxid-class_p1_1_1_image_sdk_1_1_stitching_1aebbdac360afca4bfbdde7ce51e334bcd: .. ref-code-block:: cpp :class: doxyrest-title-code-block 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. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - 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 .. index:: pair: function; GetFineCalibrationData .. _doxid-class_p1_1_1_image_sdk_1_1_stitching_1abb8552d0baa5ebab967be37a0917ce25: .. ref-code-block:: cpp :class: doxyrest-title-code-block uint8_t* GetFineCalibrationData() Get a pointer to the fine calibration data from the stitcher. .. index:: pair: function; GetFineCalibrationLength .. _doxid-class_p1_1_1_image_sdk_1_1_stitching_1ada89fb993d965ddcf63edbc81c1ac76f: .. ref-code-block:: cpp :class: doxyrest-title-code-block uint32_t GetFineCalibrationLength() Get an integer with the length of the fine calibration data in the stitcher. .. index:: pair: function; GetLastResult .. _doxid-class_p1_1_1_image_sdk_1_1_stitching_1a54b4d0a64d605b9fcfb69619d3e3054c: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`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.