OpenCV  4.1.0
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::BundleAdjusterBase
bundleAdjuster () 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.
 
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::ExposureCompensator
exposureCompensator () const
 
Ptr< Feature2DfeaturesFinder ()
 
const Ptr< Feature2DfeaturesFinder () const
 
Ptr< detail::FeaturesMatcherfeaturesMatcher ()
 
const Ptr
< detail::FeaturesMatcher
featuresMatcher () 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)
 
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.
 
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

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
Enumerator
OK 
ERR_NEED_MORE_IMGS 
ERR_HOMOGRAPHY_EST_FAIL 
ERR_CAMERA_PARAMS_ADJUST_FAIL 

Member Function Documentation

Ptr<detail::Blender> cv::Stitcher::blender ( )
inline
const Ptr<detail::Blender> cv::Stitcher::blender ( ) const
inline
Ptr<detail::BundleAdjusterBase> cv::Stitcher::bundleAdjuster ( )
inline
const Ptr<detail::BundleAdjusterBase> cv::Stitcher::bundleAdjuster ( ) const
inline
std::vector<detail::CameraParams> cv::Stitcher::cameras ( ) const
inline
std::vector<int> cv::Stitcher::component ( ) const
inline
Status cv::Stitcher::composePanorama ( OutputArray  pano)
Python:
retval, pano=cv.Stitcher.composePanorama([, pano])

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

Status cv::Stitcher::composePanorama ( InputArrayOfArrays  images,
OutputArray  pano 
)
Python:
retval, pano=cv.Stitcher.composePanorama([, 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.
double cv::Stitcher::compositingResol ( ) const
inline
Python:
retval=cv.Stitcher.compositingResol()
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.
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.
Ptr<detail::Estimator> cv::Stitcher::estimator ( )
inline
const Ptr<detail::Estimator> cv::Stitcher::estimator ( ) const
inline
Ptr<detail::ExposureCompensator> cv::Stitcher::exposureCompensator ( )
inline
const Ptr<detail::ExposureCompensator> cv::Stitcher::exposureCompensator ( ) const
inline
Ptr<Feature2D> cv::Stitcher::featuresFinder ( )
inline
const Ptr<Feature2D> cv::Stitcher::featuresFinder ( ) const
inline
Ptr<detail::FeaturesMatcher> cv::Stitcher::featuresMatcher ( )
inline
const Ptr<detail::FeaturesMatcher> cv::Stitcher::featuresMatcher ( ) const
inline
InterpolationFlags cv::Stitcher::interpolationFlags ( ) const
inline
Python:
retval=cv.Stitcher.interpolationFlags()
const cv::UMat& cv::Stitcher::matchingMask ( ) const
inline
double cv::Stitcher::panoConfidenceThresh ( ) const
inline
Python:
retval=cv.Stitcher.panoConfidenceThresh()
double cv::Stitcher::registrationResol ( ) const
inline
Python:
retval=cv.Stitcher.registrationResol()
UMat cv::Stitcher::resultMask ( ) const
inline
double cv::Stitcher::seamEstimationResol ( ) const
inline
Python:
retval=cv.Stitcher.seamEstimationResol()
Ptr<detail::SeamFinder> cv::Stitcher::seamFinder ( )
inline
const Ptr<detail::SeamFinder> cv::Stitcher::seamFinder ( ) const
inline
void cv::Stitcher::setBlender ( Ptr< detail::Blender b)
inline
void cv::Stitcher::setBundleAdjuster ( Ptr< detail::BundleAdjusterBase bundle_adjuster)
inline
void cv::Stitcher::setCompositingResol ( double  resol_mpx)
inline
Python:
None=cv.Stitcher.setCompositingResol(resol_mpx)
void cv::Stitcher::setEstimator ( Ptr< detail::Estimator estimator)
inline
void cv::Stitcher::setExposureCompensator ( Ptr< detail::ExposureCompensator exposure_comp)
inline
void cv::Stitcher::setFeaturesFinder ( Ptr< Feature2D features_finder)
inline
void cv::Stitcher::setFeaturesMatcher ( Ptr< detail::FeaturesMatcher features_matcher)
inline
void cv::Stitcher::setInterpolationFlags ( InterpolationFlags  interp_flags)
inline
Python:
None=cv.Stitcher.setInterpolationFlags(interp_flags)
void cv::Stitcher::setMatchingMask ( const cv::UMat mask)
inline
void cv::Stitcher::setPanoConfidenceThresh ( double  conf_thresh)
inline
Python:
None=cv.Stitcher.setPanoConfidenceThresh(conf_thresh)
void cv::Stitcher::setRegistrationResol ( double  resol_mpx)
inline
Python:
None=cv.Stitcher.setRegistrationResol(resol_mpx)
void cv::Stitcher::setSeamEstimationResol ( double  resol_mpx)
inline
Python:
None=cv.Stitcher.setSeamEstimationResol(resol_mpx)
void cv::Stitcher::setSeamFinder ( Ptr< detail::SeamFinder seam_finder)
inline
void cv::Stitcher::setWarper ( Ptr< WarperCreator creator)
inline
void cv::Stitcher::setWaveCorrection ( bool  flag)
inline
Python:
None=cv.Stitcher.setWaveCorrection(flag)
void cv::Stitcher::setWaveCorrectKind ( detail::WaveCorrectKind  kind)
inline
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.

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.
Ptr<WarperCreator> cv::Stitcher::warper ( )
inline
const Ptr<WarperCreator> cv::Stitcher::warper ( ) const
inline
bool cv::Stitcher::waveCorrection ( ) const
inline
Python:
retval=cv.Stitcher.waveCorrection()
detail::WaveCorrectKind cv::Stitcher::waveCorrectKind ( ) const
inline
double cv::Stitcher::workScale ( ) const
inline
Python:
retval=cv.Stitcher.workScale()

Member Data Documentation

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: