OpenCV  4.5.2
Open Source Computer Vision
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
cv::Stitcher Class Reference

High level image stitcher. More...

#include <opencv2/stitching.hpp>

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< detail::CameraParamscameras () const
 
std::vector< int > component () const
 
Status composePanorama (OutputArray pano)
 
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. More...
 
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. More...
 
Ptr< detail::Estimatorestimator ()
 
const Ptr< detail::Estimatorestimator () const
 
Ptr< detail::ExposureCompensatorexposureCompensator ()
 
const Ptr< detail::ExposureCompensatorexposureCompensator () const
 
Ptr< Feature2DfeaturesFinder ()
 
const Ptr< Feature2DfeaturesFinder () const
 
Ptr< detail::FeaturesMatcherfeaturesMatcher ()
 
const Ptr< detail::FeaturesMatcherfeaturesMatcher () const
 
InterpolationFlags interpolationFlags () const
 
const cv::UMatmatchingMask () const
 
double panoConfidenceThresh () const
 
double registrationResol () const
 
UMat resultMask () const
 
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, const std::vector< int > &component)
 These function restors camera rotation and camera intrinsics of each camera that can be got with Stitcher::cameras call. More...
 
Status setTransform (InputArrayOfArrays images, const std::vector< detail::CameraParams > &cameras)
 
void setWarper (Ptr< WarperCreator > creator)
 
void setWaveCorrection (bool flag)
 
void setWaveCorrectKind (detail::WaveCorrectKind kind)
 
Status stitch (InputArrayOfArrays images, OutputArray pano)
 
Status stitch (InputArrayOfArrays images, InputArrayOfArrays masks, OutputArray pano)
 These functions try to stitch the given images. More...
 
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. More...
 

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<detail::CameraParams> cv::Stitcher::cameras ( ) const
inline

◆ component()

std::vector<int> cv::Stitcher::component ( ) const
inline

◆ composePanorama() [1/2]

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

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

◆ composePanorama() [2/2]

Status cv::Stitcher::composePanorama ( InputArrayOfArrays  images,
OutputArray  pano 
)
Python:
retval, pano=cv.Stitcher.composePanorama([, pano])
retval, pano=cv.Stitcher.composePanorama(images[, 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.

◆ compositingResol()

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

◆ create()

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

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:
retval=cv.Stitcher.estimateTransform(images[, masks])

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.

◆ 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]

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

◆ featuresMatcher() [1/2]

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

◆ featuresMatcher() [2/2]

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

◆ interpolationFlags()

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

◆ matchingMask()

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

◆ panoConfidenceThresh()

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

◆ registrationResol()

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

◆ resultMask()

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

◆ seamEstimationResol()

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

◆ 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:
None=cv.Stitcher.setCompositingResol(resol_mpx)

◆ 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:
None=cv.Stitcher.setInterpolationFlags(interp_flags)

◆ setMatchingMask()

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

◆ setPanoConfidenceThresh()

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

◆ setRegistrationResol()

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

◆ setSeamEstimationResol()

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

◆ 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,
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.

◆ setTransform() [2/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.

◆ setWarper()

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

◆ setWaveCorrection()

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

◆ setWaveCorrectKind()

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

◆ stitch() [1/2]

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

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

◆ stitch() [2/2]

Status cv::Stitcher::stitch ( InputArrayOfArrays  images,
InputArrayOfArrays  masks,
OutputArray  pano 
)
Python:
retval, pano=cv.Stitcher.stitch(images[, pano])
retval, pano=cv.Stitcher.stitch(images, masks[, 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.

◆ 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:
retval=cv.Stitcher.waveCorrection()

◆ waveCorrectKind()

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

◆ workScale()

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

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: