Class cv::Stitcher#
High level image stitcher. View details
#include <opencv2/stitching.hpp>Collaboration diagram for cv::Stitcher:
Public Types#
enum Status {
OK = 0,
ERR_NEED_MORE_IMGS = 1,
ERR_HOMOGRAPHY_EST_FAIL = 2,
ERR_CAMERA_PARAMS_ADJUST_FAIL = 3
}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
- Examples
- samples/python/snippets/stitching.py.
Member Enumeration Documentation#
enum Mode
|
Mode for creating photo panoramas. Expects images under perspective transformation and projects resulting pano to sphere. |
|
Mode for composing scans. Expects images under affine transformation does not compensate exposure by default. |
enum Status
|
|
|
|
Member Function Documentation#
create()#
static Ptr< Stitcher > cv::Stitcher::create(Mode mode = Stitcher::PANORAMA)
Python:
cv.Stitcher.create([, mode]) -> retval
cv.Stitcher_create([, mode]) -> retval
Creates a Stitcher configured in one of the stitching modes.
Parameters
mode— Scenario 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.
blender()#
Ptr< detail::Blender > cv::Stitcher::blender()
blender()#
const Ptr< detail::Blender > cv::Stitcher::blender()
bundleAdjuster()#
Ptr< detail::BundleAdjusterBase > cv::Stitcher::bundleAdjuster()
bundleAdjuster()#
const Ptr< detail::BundleAdjusterBase > cv::Stitcher::bundleAdjuster()
cameras()#
std::vector< cv::detail::CameraParams > cv::Stitcher::cameras()
Python:
cv.Stitcher.cameras() -> retval
Returns estimated camera parameters for all stitched images
component()#
std::vector< int > cv::Stitcher::component()
Python:
cv.Stitcher.component() -> retval
Returns indices of input images used in panorama stitching.
composePanorama()#
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
images— Input images.pano— Final pano.
Returns
Status code.
composePanorama()#
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()
Python:
cv.Stitcher.compositingResol() -> retval
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
images— Input images.masks— Masks for each input image specifying where to look for keypoints (optional).
Returns
Status code.
Here is the call graph for this function:
estimator()#
Ptr< detail::Estimator > cv::Stitcher::estimator()
estimator()#
const Ptr< detail::Estimator > cv::Stitcher::estimator()
exposureCompensator()#
Ptr< detail::ExposureCompensator > cv::Stitcher::exposureCompensator()
exposureCompensator()#
const Ptr< detail::ExposureCompensator > cv::Stitcher::exposureCompensator()
featuresFinder()#
Ptr< Feature2D > cv::Stitcher::featuresFinder()
featuresFinder()#
Ptr< Feature2D > cv::Stitcher::featuresFinder()
featuresMatcher()#
Ptr< detail::FeaturesMatcher > cv::Stitcher::featuresMatcher()
featuresMatcher()#
Ptr< detail::FeaturesMatcher > cv::Stitcher::featuresMatcher()
interpolationFlags()#
InterpolationFlags cv::Stitcher::interpolationFlags()
Python:
cv.Stitcher.interpolationFlags() -> retval
matchingMask()#
const cv::UMat & cv::Stitcher::matchingMask()
panoConfidenceThresh()#
double cv::Stitcher::panoConfidenceThresh()
Python:
cv.Stitcher.panoConfidenceThresh() -> retval
registrationResol()#
double cv::Stitcher::registrationResol()
Python:
cv.Stitcher.registrationResol() -> retval
resultMask()#
UMat cv::Stitcher::resultMask()
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()
Python:
cv.Stitcher.seamEstimationResol() -> retval
seamFinder()#
Ptr< detail::SeamFinder > cv::Stitcher::seamFinder()
seamFinder()#
const Ptr< detail::SeamFinder > cv::Stitcher::seamFinder()
setBlender()#
void cv::Stitcher::setBlender(Ptr< detail::Blender > b)
setBundleAdjuster()#
void cv::Stitcher::setBundleAdjuster(Ptr< detail::BundleAdjusterBase > bundle_adjuster)
setCompositingResol()#
void cv::Stitcher::setCompositingResol(double resol_mpx)
Python:
cv.Stitcher.setCompositingResol(resol_mpx)
setEstimator()#
void cv::Stitcher::setEstimator(Ptr< detail::Estimator > estimator)
setExposureCompensator()#
void cv::Stitcher::setExposureCompensator(Ptr< detail::ExposureCompensator > exposure_comp)
setFeaturesFinder()#
void cv::Stitcher::setFeaturesFinder(Ptr< Feature2D > features_finder)
setFeaturesMatcher()#
void cv::Stitcher::setFeaturesMatcher(Ptr< detail::FeaturesMatcher > features_matcher)
setInterpolationFlags()#
void cv::Stitcher::setInterpolationFlags(InterpolationFlags interp_flags)
Python:
cv.Stitcher.setInterpolationFlags(interp_flags)
setMatchingMask()#
void cv::Stitcher::setMatchingMask(const cv::UMat & mask)
setPanoConfidenceThresh()#
void cv::Stitcher::setPanoConfidenceThresh(double conf_thresh)
Python:
cv.Stitcher.setPanoConfidenceThresh(conf_thresh)
setRegistrationResol()#
void cv::Stitcher::setRegistrationResol(double resol_mpx)
Python:
cv.Stitcher.setRegistrationResol(resol_mpx)
setSeamEstimationResol()#
void cv::Stitcher::setSeamEstimationResol(double resol_mpx)
Python:
cv.Stitcher.setSeamEstimationResol(resol_mpx)
setSeamFinder()#
void cv::Stitcher::setSeamFinder(Ptr< detail::SeamFinder > seam_finder)
setTransform()#
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()#
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
images— Input images.cameras— Estimated rotation of cameras for each of the input images.component— Indices (0-based) of images constituting the final panorama (optional).
Returns
Status code.
setWarper()#
void cv::Stitcher::setWarper(Ptr< WarperCreator > creator)
setWaveCorrection()#
void cv::Stitcher::setWaveCorrection(bool flag)
Python:
cv.Stitcher.setWaveCorrection(flag)
setWaveCorrectKind()#
void cv::Stitcher::setWaveCorrectKind(detail::WaveCorrectKind kind)
stitch()#
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
images— Input images.masks— Masks for each input image specifying where to look for keypoints (optional).pano— Final pano.
Returns
Status code.
stitch()#
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()#
Ptr< WarperCreator > cv::Stitcher::warper()
warper()#
const Ptr< WarperCreator > cv::Stitcher::warper()
waveCorrection()#
bool cv::Stitcher::waveCorrection()
Python:
cv.Stitcher.waveCorrection() -> retval
waveCorrectKind()#
detail::WaveCorrectKind cv::Stitcher::waveCorrectKind()
workScale()#
double cv::Stitcher::workScale()
Python:
cv.Stitcher.workScale() -> retval
estimateCameraParams()#
Status cv::Stitcher::estimateCameraParams()
matchImages()#
Status cv::Stitcher::matchImages()
Member Data Documentation#
ORIG_RESOL#
static double cv::Stitcher::ORIG_RESOL = -1.0
When setting a resolution for stitching, this values is a placeholder for preserving the original resolution.
blender_#
Ptr< detail::Blender > cv::Stitcher::blender_
bundle_adjuster_#
Ptr< detail::BundleAdjusterBase > cv::Stitcher::bundle_adjuster_
cameras_#
std::vector< detail::CameraParams > cv::Stitcher::cameras_
compose_resol_#
double cv::Stitcher::compose_resol_
conf_thresh_#
double cv::Stitcher::conf_thresh_
do_wave_correct_#
bool cv::Stitcher::do_wave_correct_
estimator_#
Ptr< detail::Estimator > cv::Stitcher::estimator_
exposure_comp_#
Ptr< detail::ExposureCompensator > cv::Stitcher::exposure_comp_
features_#
std::vector< detail::ImageFeatures > cv::Stitcher::features_
features_finder_#
Ptr< Feature2D > cv::Stitcher::features_finder_
features_matcher_#
Ptr< detail::FeaturesMatcher > cv::Stitcher::features_matcher_
full_img_sizes_#
std::vector< cv::Size > cv::Stitcher::full_img_sizes_
imgs_#
std::vector< cv::UMat > cv::Stitcher::imgs_
indices_#
std::vector< int > cv::Stitcher::indices_
interp_flags_#
InterpolationFlags cv::Stitcher::interp_flags_
masks_#
std::vector< cv::UMat > cv::Stitcher::masks_
matching_mask_#
cv::UMat cv::Stitcher::matching_mask_
pairwise_matches_#
std::vector< detail::MatchesInfo > cv::Stitcher::pairwise_matches_
registr_resol_#
double cv::Stitcher::registr_resol_
result_mask_#
UMat cv::Stitcher::result_mask_
seam_est_imgs_#
std::vector< cv::UMat > cv::Stitcher::seam_est_imgs_
seam_est_resol_#
double cv::Stitcher::seam_est_resol_
seam_finder_#
Ptr< detail::SeamFinder > cv::Stitcher::seam_finder_
seam_scale_#
double cv::Stitcher::seam_scale_
seam_work_aspect_#
double cv::Stitcher::seam_work_aspect_
warped_image_scale_#
double cv::Stitcher::warped_image_scale_
warper_#
Ptr< WarperCreator > cv::Stitcher::warper_
wave_correct_kind_#
detail::WaveCorrectKind cv::Stitcher::wave_correct_kind_
work_scale_#
double cv::Stitcher::work_scale_
Source file#
The documentation for this class was generated from the following file:
opencv2/stitching.hpp