| OpenCV 4.3.0 Open Source Computer Vision

Modules | Classes | Functions
Images stitching

## Modules
| Features Finding and Images Matching
| Rotation Estimation
| Autocalibration
| Images Warping
| Seam Estimation
| Exposure Compensation
| Image Blenders

## Classes
struct | cv::detail::CameraParams
| Describes camera parameters. More...
class | cv::detail::DisjointSets
class | cv::detail::Graph
struct | cv::detail::GraphEdge
class | cv::Stitcher
| High level image stitcher. More...
class | cv::detail::Timelapser
class | cv::detail::TimelapserCrop

## Functions
| cv::detail::GraphEdge::GraphEdge (int from, int to, float weight)
Ptr< Stitcher > | cv::createStitcher (bool try_use_gpu=false)
Ptr< Stitcher > | cv::createStitcherScans (bool try_use_gpu=false)
bool | cv::detail::overlapRoi (Point tl1, Point tl2, Size sz1, Size sz2, Rect &roi)
Rect | cv::detail::resultRoi (const std::vector< Point > &corners, const std::vector< UMat > &images)
Rect | cv::detail::resultRoi (const std::vector< Point > &corners, const std::vector< Size > &sizes)
Rect | cv::detail::resultRoiIntersection (const std::vector< Point > &corners, const std::vector< Size > &sizes)
Point | cv::detail::resultTl (const std::vector< Point > &corners)
void | cv::detail::selectRandomSubset (int count, int size, std::vector< int > &subset)
int & | cv::detail::stitchingLogLevel ()

## Detailed Description

This figure illustrates the stitching module pipeline implemented in the Stitcher class. Using that class it's possible to configure/remove some steps, i.e. adjust the stitching pipeline according to the particular needs. All building blocks from the pipeline are available in the detail namespace, one can combine and use them separately.

The implemented stitching pipeline is very similar to the one proposed in [30] .

stitching pipeline

## Camera models

There are currently 2 camera models implemented in stitching pipeline.

- Homography model expecting perspective transformations between images implemented in cv::detail::BestOf2NearestMatcher cv::detail::HomographyBasedEstimator cv::detail::BundleAdjusterReproj cv::detail::BundleAdjusterRay
- Affine model expecting affine transformation with 6 DOF or 4 DOF implemented in cv::detail::AffineBestOf2NearestMatcher cv::detail::AffineBasedEstimator cv::detail::BundleAdjusterAffine cv::detail::BundleAdjusterAffinePartial cv::AffineWarper

Homography model is useful for creating photo panoramas captured by camera, while affine-based model can be used to stitch scans and object captured by specialized devices. Use cv::Stitcher::create to get preconfigured pipeline for one of those models.

Note
  Certain detailed settings of cv::Stitcher might not make sense. Especially you should not mix classes implementing affine model and classes implementing Homography model, as they work with different transformations.

## Function Documentation

## ◆ GraphEdge()

cv::detail::GraphEdge::GraphEdge | ( | int | from,
|  | int | to,
|  | float | weight
| ) |  |
| inline

`#include <opencv2/stitching/detail/util.hpp>`

## ◆ createStitcher()

Ptr<Stitcher> cv::createStitcher | ( | bool | try_use_gpu = `false` | ) |

`#include <opencv2/stitching.hpp>`

Deprecated:
  use Stitcher::create

## ◆ createStitcherScans()

Ptr<Stitcher> cv::createStitcherScans | ( | bool | try_use_gpu = `false` | ) |

`#include <opencv2/stitching.hpp>`

Deprecated:
  use Stitcher::create

## ◆ overlapRoi()

bool cv::detail::overlapRoi | ( | Point | tl1,
|  | Point | tl2,
|  | Size | sz1,
|  | Size | sz2,
|  | Rect & | roi
| ) |  |

Python:
| retval | = | cv.detail.overlapRoi( | tl1, tl2, sz1, sz2, roi | )

`#include <opencv2/stitching/detail/util.hpp>`

## ◆ resultRoi() [1/2]

Rect cv::detail::resultRoi | ( | const std::vector< Point > & | corners,
|  | const std::vector< UMat > & | images
| ) |  |

Python:
| retval | = | cv.detail.resultRoi( | corners, images | )
| retval | = | cv.detail.resultRoi( | corners, sizes | )

`#include <opencv2/stitching/detail/util.hpp>`

Examples:
  samples/cpp/stitching_detailed.cpp.

## ◆ resultRoi() [2/2]

Rect cv::detail::resultRoi | ( | const std::vector< Point > & | corners,
|  | const std::vector< Size > & | sizes
| ) |  |

Python:
| retval | = | cv.detail.resultRoi( | corners, images | )
| retval | = | cv.detail.resultRoi( | corners, sizes | )

`#include <opencv2/stitching/detail/util.hpp>`

## ◆ resultRoiIntersection()

Rect cv::detail::resultRoiIntersection | ( | const std::vector< Point > & | corners,
|  | const std::vector< Size > & | sizes
| ) |  |

Python:
| retval | = | cv.detail.resultRoiIntersection( | corners, sizes | )

`#include <opencv2/stitching/detail/util.hpp>`

## ◆ resultTl()

Point cv::detail::resultTl | ( | const std::vector< Point > & | corners | ) |

Python:
| retval | = | cv.detail.resultTl( | corners | )

`#include <opencv2/stitching/detail/util.hpp>`

## ◆ selectRandomSubset()

void cv::detail::selectRandomSubset | ( | int | count,
|  | int | size,
|  | std::vector< int > & | subset
| ) |  |

Python:
| None | = | cv.detail.selectRandomSubset( | count, size, subset | )

`#include <opencv2/stitching/detail/util.hpp>`

## ◆ stitchingLogLevel()

int& cv::detail::stitchingLogLevel | ( |  | ) |

Python:
| retval | = | cv.detail.stitchingLogLevel( |  | )

`#include <opencv2/stitching/detail/util.hpp>`