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

High level image stitcher. More...

#include <opencv2/stitching.hpp>

Public Types

enum  { ORIG_RESOL = -1 }
 
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)
 
Status estimateTransform (InputArrayOfArrays images, const std::vector< std::vector< Rect > > &rois)
 These functions try to match the given images and to estimate rotations of each camera. More...
 
Ptr< detail::ExposureCompensatorexposureCompensator ()
 
const Ptr< detail::ExposureCompensatorexposureCompensator () const
 
Ptr< detail::FeaturesFinderfeaturesFinder ()
 
const Ptr< detail::FeaturesFinderfeaturesFinder () const
 
Ptr< detail::FeaturesMatcherfeaturesMatcher ()
 
const Ptr< detail::FeaturesMatcherfeaturesMatcher () const
 
const cv::UMatmatchingMask () const
 
double panoConfidenceThresh () const
 
double registrationResol () 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 setExposureCompensator (Ptr< detail::ExposureCompensator > exposure_comp)
 
void setFeaturesFinder (Ptr< detail::FeaturesFinder > features_finder)
 
void setFeaturesMatcher (Ptr< detail::FeaturesMatcher > features_matcher)
 
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, const std::vector< std::vector< Rect > > &rois, 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=PANORAMA, bool try_use_gpu=false)
 Creates a Stitcher configured in one of the stitching modes. More...
 
static Stitcher createDefault (bool try_use_gpu=false)
 Creates a stitcher with the default parameters. More...
 

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 detailed example on image stitching can be found at opencv_source_code/samples/cpp/stitching_detailed.cpp

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ORIG_RESOL 

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

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

◆ compositingResol()

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

◆ create()

static Ptr<Stitcher> cv::Stitcher::create ( Mode  mode = PANORAMA,
bool  try_use_gpu = false 
)
static

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.
try_use_gpuFlag indicating whether GPU should be used whenever it's possible.
Returns
Stitcher class instance.

◆ createDefault()

static Stitcher cv::Stitcher::createDefault ( bool  try_use_gpu = false)
static

Creates a stitcher with the default parameters.

Parameters
try_use_gpuFlag indicating whether GPU should be used whenever it's possible.
Returns
Stitcher class instance.

◆ estimateTransform() [1/2]

Status cv::Stitcher::estimateTransform ( InputArrayOfArrays  images)
Python:
cv.Stitcher.estimateTransform(images) -> retval

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

◆ estimateTransform() [2/2]

Status cv::Stitcher::estimateTransform ( InputArrayOfArrays  images,
const std::vector< std::vector< Rect > > &  rois 
)
Python:
cv.Stitcher.estimateTransform(images) -> 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.
roisRegion of interest rectangles.
Returns
Status code.

◆ 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<detail::FeaturesFinder> cv::Stitcher::featuresFinder ( )
inline

◆ featuresFinder() [2/2]

const Ptr<detail::FeaturesFinder> 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

◆ 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

◆ 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

◆ setExposureCompensator()

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

◆ setFeaturesFinder()

void cv::Stitcher::setFeaturesFinder ( Ptr< detail::FeaturesFinder features_finder)
inline

◆ setFeaturesMatcher()

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

◆ 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

◆ 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,
OutputArray  pano 
)
Python:
cv.Stitcher.stitch(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.

Examples:
samples/cpp/stitching.cpp.

◆ stitch() [2/2]

Status cv::Stitcher::stitch ( InputArrayOfArrays  images,
const std::vector< std::vector< Rect > > &  rois,
OutputArray  pano 
)
Python:
cv.Stitcher.stitch(images[, pano]) -> retval, pano

These functions try to stitch the given images.

Parameters
imagesInput images.
roisRegion of interest rectangles.
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:
cv.Stitcher.waveCorrection() -> retval

◆ waveCorrectKind()

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

◆ workScale()

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

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