OpenCV  5.0.0alpha
Open Source Computer Vision
Loading...
Searching...
No Matches
cv::Stitcher Class Reference

High level image stitcher. More...

#include <opencv2/stitching.hpp>

Collaboration diagram for cv::Stitcher:

Public Types

enum  Mode {
  PANORAMA = 0 ,
  SCANS = 1
}
 
enum  Status {
  OK = 0 ,
  ERR_NEED_MORE_IMGS = 1 ,
  ERR_HOMOGRAPHY_EST_FAIL = 2 ,
  ERR_CAMERA_PARAMS_ADJUST_FAIL = 3
}
 

Public Member Functions

Ptr< detail::Blenderblender ()
 
const Ptr< detail::Blenderblender () const
 
Ptr< detail::BundleAdjusterBasebundleAdjuster ()
 
const Ptr< detail::BundleAdjusterBasebundleAdjuster () const
 
std::vector< cv::detail::CameraParamscameras () const
 
std::vector< int > component () const
 Returns indeces of input images used in panorama stitching.
 
Status composePanorama (InputArrayOfArrays images, OutputArray pano)
 These functions try to compose the given images (or images stored internally from the other function calls) into the final pano under the assumption that the image transformations were estimated before.
 
Status composePanorama (OutputArray pano)
 
double compositingResol () const
 
Status estimateTransform (InputArrayOfArrays images, InputArrayOfArrays masks=noArray())
 These functions try to match the given images and to estimate rotations of each camera.
 
Ptr< detail::Estimatorestimator ()
 
const Ptr< detail::Estimatorestimator () const
 
Ptr< detail::ExposureCompensatorexposureCompensator ()
 
const Ptr< detail::ExposureCompensatorexposureCompensator () const
 
Ptr< Feature2DfeaturesFinder ()
 
Ptr< Feature2DfeaturesFinder () const
 
Ptr< detail::FeaturesMatcherfeaturesMatcher ()
 
Ptr< detail::FeaturesMatcherfeaturesMatcher () const
 
InterpolationFlags interpolationFlags () const
 
const cv::UMatmatchingMask () const
 
double panoConfidenceThresh () const
 
double registrationResol () const
 
UMat resultMask () const
 Return the mask of the panorama.
 
double seamEstimationResol () const
 
Ptr< detail::SeamFinderseamFinder ()
 
const Ptr< detail::SeamFinderseamFinder () const
 
void setBlender (Ptr< detail::Blender > b)
 
void setBundleAdjuster (Ptr< detail::BundleAdjusterBase > bundle_adjuster)
 
void setCompositingResol (double resol_mpx)
 
void setEstimator (Ptr< detail::Estimator > estimator)
 
void setExposureCompensator (Ptr< detail::ExposureCompensator > exposure_comp)
 
void setFeaturesFinder (Ptr< Feature2D > features_finder)
 
void setFeaturesMatcher (Ptr< detail::FeaturesMatcher > features_matcher)
 
void setInterpolationFlags (InterpolationFlags interp_flags)
 
void setMatchingMask (const cv::UMat &mask)
 
void setPanoConfidenceThresh (double conf_thresh)
 
void setRegistrationResol (double resol_mpx)
 
void setSeamEstimationResol (double resol_mpx)
 
void setSeamFinder (Ptr< detail::SeamFinder > seam_finder)
 
Status setTransform (InputArrayOfArrays images, const std::vector< detail::CameraParams > &cameras)
 
Status setTransform (InputArrayOfArrays images, const std::vector< detail::CameraParams > &cameras, const std::vector< int > &component)
 These function restors camera rotation and camera intrinsics of each camera that can be got with Stitcher::cameras call.
 
void setWarper (Ptr< WarperCreator > creator)
 
void setWaveCorrection (bool flag)
 
void setWaveCorrectKind (detail::WaveCorrectKind kind)
 
Status stitch (InputArrayOfArrays images, InputArrayOfArrays masks, OutputArray pano)
 These functions try to stitch the given images.
 
Status stitch (InputArrayOfArrays images, OutputArray pano)
 
Ptr< WarperCreatorwarper ()
 
const Ptr< WarperCreatorwarper () const
 
bool waveCorrection () const
 
detail::WaveCorrectKind waveCorrectKind () const
 
double workScale () const
 

Static Public Member Functions

static Ptr< Stitchercreate (Mode mode=Stitcher::PANORAMA)
 Creates a Stitcher configured in one of the stitching modes.
 

Static Public Attributes

static const double ORIG_RESOL
 

Detailed Description

High level image stitcher.

It's possible to use this class without being aware of the entire stitching pipeline. However, to be able to achieve higher stitching stability and quality of the final images at least being familiar with the theory is recommended.

Note
  • A basic example on image stitching can be found at opencv_source_code/samples/cpp/stitching.cpp
  • A basic example on image stitching in Python can be found at opencv_source_code/samples/python/stitching.py
  • A detailed example on image stitching can be found at opencv_source_code/samples/cpp/stitching_detailed.cpp

Member Enumeration Documentation

◆ Mode

Enumerator
PANORAMA 

Mode for creating photo panoramas. Expects images under perspective transformation and projects resulting pano to sphere.

See also
detail::BestOf2NearestMatcher SphericalWarper
SCANS 

Mode for composing scans. Expects images under affine transformation does not compensate exposure by default.

See also
detail::AffineBestOf2NearestMatcher AffineWarper

◆ Status

Enumerator
OK 
ERR_NEED_MORE_IMGS 
ERR_HOMOGRAPHY_EST_FAIL 
ERR_CAMERA_PARAMS_ADJUST_FAIL 

Member Function Documentation

◆ blender() [1/2]

Ptr< detail::Blender > cv::Stitcher::blender ( )
inline

◆ blender() [2/2]

const Ptr< detail::Blender > cv::Stitcher::blender ( ) const
inline

◆ bundleAdjuster() [1/2]

Ptr< detail::BundleAdjusterBase > cv::Stitcher::bundleAdjuster ( )
inline

◆ bundleAdjuster() [2/2]

const Ptr< detail::BundleAdjusterBase > cv::Stitcher::bundleAdjuster ( ) const
inline

◆ cameras()

std::vector< cv::detail::CameraParams > cv::Stitcher::cameras ( ) const
inline
Python:
cv.Stitcher.cameras() -> retval

Returns estimated camera parameters for all stitched images

◆ component()

std::vector< int > cv::Stitcher::component ( ) const
inline
Python:
cv.Stitcher.component() -> retval

Returns indeces of input images used in panorama stitching.

◆ composePanorama() [1/2]

Status cv::Stitcher::composePanorama ( InputArrayOfArrays images,
OutputArray pano )
Python:
cv.Stitcher.composePanorama([, pano]) -> retval, pano
cv.Stitcher.composePanorama(images[, pano]) -> retval, pano

These functions try to compose the given images (or images stored internally from the other function calls) into the final pano under the assumption that the image transformations were estimated before.

Note
Use the functions only if you're aware of the stitching pipeline, otherwise use Stitcher::stitch.
Parameters
imagesInput images.
panoFinal pano.
Returns
Status code.

◆ composePanorama() [2/2]

Status cv::Stitcher::composePanorama ( OutputArray pano)
Python:
cv.Stitcher.composePanorama([, pano]) -> retval, pano
cv.Stitcher.composePanorama(images[, pano]) -> retval, pano

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ compositingResol()

double cv::Stitcher::compositingResol ( ) const
inline
Python:
cv.Stitcher.compositingResol() -> retval

◆ create()

static Ptr< Stitcher > cv::Stitcher::create ( Mode mode = Stitcher::PANORAMA)
static
Python:
cv.Stitcher.create([, mode]) -> retval
cv.Stitcher_create([, mode]) -> retval

Creates a Stitcher configured in one of the stitching modes.

Parameters
modeScenario for stitcher operation. This is usually determined by source of images to stitch and their transformation. Default parameters will be chosen for operation in given scenario.
Returns
Stitcher class instance.

◆ estimateTransform()

Status cv::Stitcher::estimateTransform ( InputArrayOfArrays images,
InputArrayOfArrays masks = noArray() )
Python:
cv.Stitcher.estimateTransform(images[, masks]) -> retval

These functions try to match the given images and to estimate rotations of each camera.

Note
Use the functions only if you're aware of the stitching pipeline, otherwise use Stitcher::stitch.
Parameters
imagesInput images.
masksMasks for each input image specifying where to look for keypoints (optional).
Returns
Status code.
Here is the call graph for this function:

◆ estimator() [1/2]

Ptr< detail::Estimator > cv::Stitcher::estimator ( )
inline

◆ estimator() [2/2]

const Ptr< detail::Estimator > cv::Stitcher::estimator ( ) const
inline

◆ exposureCompensator() [1/2]

Ptr< detail::ExposureCompensator > cv::Stitcher::exposureCompensator ( )
inline

◆ exposureCompensator() [2/2]

const Ptr< detail::ExposureCompensator > cv::Stitcher::exposureCompensator ( ) const
inline

◆ featuresFinder() [1/2]

Ptr< Feature2D > cv::Stitcher::featuresFinder ( )
inline

◆ featuresFinder() [2/2]

Ptr< Feature2D > cv::Stitcher::featuresFinder ( ) const
inline

◆ featuresMatcher() [1/2]

Ptr< detail::FeaturesMatcher > cv::Stitcher::featuresMatcher ( )
inline

◆ featuresMatcher() [2/2]

Ptr< detail::FeaturesMatcher > cv::Stitcher::featuresMatcher ( ) const
inline

◆ interpolationFlags()

InterpolationFlags cv::Stitcher::interpolationFlags ( ) const
inline
Python:
cv.Stitcher.interpolationFlags() -> retval

◆ matchingMask()

const cv::UMat & cv::Stitcher::matchingMask ( ) const
inline

◆ panoConfidenceThresh()

double cv::Stitcher::panoConfidenceThresh ( ) const
inline
Python:
cv.Stitcher.panoConfidenceThresh() -> retval

◆ registrationResol()

double cv::Stitcher::registrationResol ( ) const
inline
Python:
cv.Stitcher.registrationResol() -> retval

◆ resultMask()

UMat cv::Stitcher::resultMask ( ) const
inline

Return the mask of the panorama.

The mask is a 8U UMat with the values: 0xFF (white) for pixels filled by the input images, 0 (black) for unused pixels. It can be used as the mask for inpaint.

Returns
The mask.

◆ seamEstimationResol()

double cv::Stitcher::seamEstimationResol ( ) const
inline
Python:
cv.Stitcher.seamEstimationResol() -> retval

◆ seamFinder() [1/2]

Ptr< detail::SeamFinder > cv::Stitcher::seamFinder ( )
inline

◆ seamFinder() [2/2]

const Ptr< detail::SeamFinder > cv::Stitcher::seamFinder ( ) const
inline

◆ setBlender()

void cv::Stitcher::setBlender ( Ptr< detail::Blender > b)
inline

◆ setBundleAdjuster()

void cv::Stitcher::setBundleAdjuster ( Ptr< detail::BundleAdjusterBase > bundle_adjuster)
inline

◆ setCompositingResol()

void cv::Stitcher::setCompositingResol ( double resol_mpx)
inline
Python:
cv.Stitcher.setCompositingResol(resol_mpx) -> None

◆ setEstimator()

void cv::Stitcher::setEstimator ( Ptr< detail::Estimator > estimator)
inline

◆ setExposureCompensator()

void cv::Stitcher::setExposureCompensator ( Ptr< detail::ExposureCompensator > exposure_comp)
inline

◆ setFeaturesFinder()

void cv::Stitcher::setFeaturesFinder ( Ptr< Feature2D > features_finder)
inline

◆ setFeaturesMatcher()

void cv::Stitcher::setFeaturesMatcher ( Ptr< detail::FeaturesMatcher > features_matcher)
inline

◆ setInterpolationFlags()

void cv::Stitcher::setInterpolationFlags ( InterpolationFlags interp_flags)
inline
Python:
cv.Stitcher.setInterpolationFlags(interp_flags) -> None

◆ setMatchingMask()

void cv::Stitcher::setMatchingMask ( const cv::UMat & mask)
inline

◆ setPanoConfidenceThresh()

void cv::Stitcher::setPanoConfidenceThresh ( double conf_thresh)
inline
Python:
cv.Stitcher.setPanoConfidenceThresh(conf_thresh) -> None

◆ setRegistrationResol()

void cv::Stitcher::setRegistrationResol ( double resol_mpx)
inline
Python:
cv.Stitcher.setRegistrationResol(resol_mpx) -> None

◆ setSeamEstimationResol()

void cv::Stitcher::setSeamEstimationResol ( double resol_mpx)
inline
Python:
cv.Stitcher.setSeamEstimationResol(resol_mpx) -> None

◆ setSeamFinder()

void cv::Stitcher::setSeamFinder ( Ptr< detail::SeamFinder > seam_finder)
inline

◆ setTransform() [1/2]

Status cv::Stitcher::setTransform ( InputArrayOfArrays images,
const std::vector< detail::CameraParams > & cameras )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ setTransform() [2/2]

Status cv::Stitcher::setTransform ( InputArrayOfArrays images,
const std::vector< detail::CameraParams > & cameras,
const std::vector< int > & component )

These function restors camera rotation and camera intrinsics of each camera that can be got with Stitcher::cameras call.

Parameters
imagesInput images.
camerasEstimated rotation of cameras for each of the input images.
componentIndices (0-based) of images constituting the final panorama (optional).
Returns
Status code.

◆ setWarper()

void cv::Stitcher::setWarper ( Ptr< WarperCreator > creator)
inline

◆ setWaveCorrection()

void cv::Stitcher::setWaveCorrection ( bool flag)
inline
Python:
cv.Stitcher.setWaveCorrection(flag) -> None

◆ setWaveCorrectKind()

void cv::Stitcher::setWaveCorrectKind ( detail::WaveCorrectKind kind)
inline

◆ stitch() [1/2]

Status cv::Stitcher::stitch ( InputArrayOfArrays images,
InputArrayOfArrays masks,
OutputArray pano )
Python:
cv.Stitcher.stitch(images[, pano]) -> retval, pano
cv.Stitcher.stitch(images, masks[, pano]) -> retval, pano

These functions try to stitch the given images.

Parameters
imagesInput images.
masksMasks for each input image specifying where to look for keypoints (optional).
panoFinal pano.
Returns
Status code.

◆ stitch() [2/2]

Status cv::Stitcher::stitch ( InputArrayOfArrays images,
OutputArray pano )
Python:
cv.Stitcher.stitch(images[, pano]) -> retval, pano
cv.Stitcher.stitch(images, masks[, pano]) -> retval, pano

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ warper() [1/2]

Ptr< WarperCreator > cv::Stitcher::warper ( )
inline

◆ warper() [2/2]

const Ptr< WarperCreator > cv::Stitcher::warper ( ) const
inline

◆ waveCorrection()

bool cv::Stitcher::waveCorrection ( ) const
inline
Python:
cv.Stitcher.waveCorrection() -> retval

◆ waveCorrectKind()

detail::WaveCorrectKind cv::Stitcher::waveCorrectKind ( ) const
inline

◆ workScale()

double cv::Stitcher::workScale ( ) const
inline
Python:
cv.Stitcher.workScale() -> retval

Member Data Documentation

◆ ORIG_RESOL

const double cv::Stitcher::ORIG_RESOL
static

When setting a resolution for stitching, this values is a placeholder for preserving the original resolution.


The documentation for this class was generated from the following file: