Removed Sphinx documentation files
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
Autocalibration
|
||||
===============
|
||||
|
||||
.. highlight:: cpp
|
||||
|
||||
detail::focalsFromHomography
|
||||
----------------------------
|
||||
Tries to estimate focal lengths from the given homography under the assumption that the camera undergoes rotations around its centre only.
|
||||
|
||||
.. ocv:function:: void detail::focalsFromHomography(const Mat &H, double &f0, double &f1, bool &f0_ok, bool &f1_ok)
|
||||
|
||||
:param H: Homography.
|
||||
|
||||
:param f0: Estimated focal length along X axis.
|
||||
|
||||
:param f1: Estimated focal length along Y axis.
|
||||
|
||||
:param f0_ok: True, if f0 was estimated successfully, false otherwise.
|
||||
|
||||
:param f1_ok: True, if f1 was estimated successfully, false otherwise.
|
||||
|
||||
detail::estimateFocal
|
||||
---------------------
|
||||
Estimates focal lengths for each given camera.
|
||||
|
||||
.. ocv:function:: void detail::estimateFocal(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches, std::vector<double> &focals)
|
||||
|
||||
:param features: Features of images.
|
||||
|
||||
:param pairwise_matches: Matches between all image pairs.
|
||||
|
||||
:param focals: Estimated focal lengths for each camera.
|
@@ -1,115 +0,0 @@
|
||||
Image Blenders
|
||||
==============
|
||||
|
||||
.. highlight:: cpp
|
||||
|
||||
detail::Blender
|
||||
---------------
|
||||
.. ocv:class:: detail::Blender
|
||||
|
||||
Base class for all blenders. ::
|
||||
|
||||
class CV_EXPORTS Blender
|
||||
{
|
||||
public:
|
||||
virtual ~Blender() {}
|
||||
|
||||
enum { NO, FEATHER, MULTI_BAND };
|
||||
static Ptr<Blender> createDefault(int type, bool try_gpu = false);
|
||||
|
||||
void prepare(const std::vector<Point> &corners, const std::vector<Size> &sizes);
|
||||
virtual void prepare(Rect dst_roi);
|
||||
virtual void feed(const Mat &img, const Mat &mask, Point tl);
|
||||
virtual void blend(Mat &dst, Mat &dst_mask);
|
||||
|
||||
protected:
|
||||
Mat dst_, dst_mask_;
|
||||
Rect dst_roi_;
|
||||
};
|
||||
|
||||
detail::Blender::prepare
|
||||
------------------------
|
||||
|
||||
Prepares the blender for blending.
|
||||
|
||||
.. ocv:function:: void detail::Blender::prepare(const std::vector<Point> &corners, const std::vector<Size> &sizes)
|
||||
|
||||
:param corners: Source images top-left corners
|
||||
|
||||
:param sizes: Source image sizes
|
||||
|
||||
detail::Blender::feed
|
||||
---------------------
|
||||
|
||||
Processes the image.
|
||||
|
||||
.. ocv:function:: void detail::Blender::feed(InputArray img, InputArray mask, Point tl)
|
||||
|
||||
:param img: Source image
|
||||
|
||||
:param mask: Source image mask
|
||||
|
||||
:param tl: Source image top-left corners
|
||||
|
||||
detail::Blender::blend
|
||||
----------------------
|
||||
|
||||
Blends and returns the final pano.
|
||||
|
||||
.. ocv:function:: void detail::Blender::blend(InputOutputArray dst, InputOutputArray dst_mask)
|
||||
|
||||
:param dst: Final pano
|
||||
|
||||
:param dst_mask: Final pano mask
|
||||
|
||||
detail::FeatherBlender
|
||||
----------------------
|
||||
.. ocv:class:: detail::FeatherBlender : public detail::Blender
|
||||
|
||||
Simple blender which mixes images at its borders. ::
|
||||
|
||||
class CV_EXPORTS FeatherBlender : public Blender
|
||||
{
|
||||
public:
|
||||
FeatherBlender(float sharpness = 0.02f) { setSharpness(sharpness); }
|
||||
|
||||
float sharpness() const { return sharpness_; }
|
||||
void setSharpness(float val) { sharpness_ = val; }
|
||||
|
||||
void prepare(Rect dst_roi);
|
||||
void feed(const Mat &img, const Mat &mask, Point tl);
|
||||
void blend(Mat &dst, Mat &dst_mask);
|
||||
|
||||
// Creates weight maps for fixed set of source images by their masks and top-left corners.
|
||||
// Final image can be obtained by simple weighting of the source images.
|
||||
Rect createWeightMaps(const std::vector<Mat> &masks, const std::vector<Point> &corners,
|
||||
std::vector<Mat> &weight_maps);
|
||||
|
||||
private:
|
||||
/* hidden */
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::Blender`
|
||||
|
||||
detail::MultiBandBlender
|
||||
------------------------
|
||||
.. ocv:class:: detail::MultiBandBlender : public detail::Blender
|
||||
|
||||
Blender which uses multi-band blending algorithm (see [BA83]_). ::
|
||||
|
||||
class CV_EXPORTS MultiBandBlender : public Blender
|
||||
{
|
||||
public:
|
||||
MultiBandBlender(int try_gpu = false, int num_bands = 5);
|
||||
int numBands() const { return actual_num_bands_; }
|
||||
void setNumBands(int val) { actual_num_bands_ = val; }
|
||||
|
||||
void prepare(Rect dst_roi);
|
||||
void feed(const Mat &img, const Mat &mask, Point tl);
|
||||
void blend(Mat &dst, Mat &dst_mask);
|
||||
|
||||
private:
|
||||
/* hidden */
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::Blender`
|
@@ -1,29 +0,0 @@
|
||||
Camera
|
||||
======
|
||||
|
||||
.. highlight:: cpp
|
||||
|
||||
detail::CameraParams
|
||||
--------------------
|
||||
.. ocv:struct:: detail::CameraParams
|
||||
|
||||
Describes camera parameters.
|
||||
|
||||
.. note:: Translation is assumed to be zero during the whole stitching pipeline.
|
||||
|
||||
::
|
||||
|
||||
struct CV_EXPORTS CameraParams
|
||||
{
|
||||
CameraParams();
|
||||
CameraParams(const CameraParams& other);
|
||||
const CameraParams& operator =(const CameraParams& other);
|
||||
Mat K() const;
|
||||
|
||||
double focal; // Focal length
|
||||
double aspect; // Aspect ratio
|
||||
double ppx; // Principal point X
|
||||
double ppy; // Principal point Y
|
||||
Mat R; // Rotation
|
||||
Mat t; // Translation
|
||||
};
|
@@ -1,110 +0,0 @@
|
||||
Exposure Compensation
|
||||
=====================
|
||||
|
||||
.. highlight:: cpp
|
||||
|
||||
detail::ExposureCompensator
|
||||
----------------------------
|
||||
.. ocv:class:: detail::ExposureCompensator
|
||||
|
||||
Base class for all exposure compensators. ::
|
||||
|
||||
class CV_EXPORTS ExposureCompensator
|
||||
{
|
||||
public:
|
||||
virtual ~ExposureCompensator() {}
|
||||
|
||||
enum { NO, GAIN, GAIN_BLOCKS };
|
||||
static Ptr<ExposureCompensator> createDefault(int type);
|
||||
|
||||
void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,
|
||||
const std::vector<Mat> &masks);
|
||||
virtual void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,
|
||||
const std::vector<std::pair<Mat,uchar> > &masks) = 0;
|
||||
virtual void apply(int index, Point corner, Mat &image, const Mat &mask) = 0;
|
||||
};
|
||||
|
||||
detail::ExposureCompensator::feed
|
||||
----------------------------------
|
||||
|
||||
.. ocv:function:: void detail::ExposureCompensator::feed(const std::vector<Point> &corners, const std::vector<UMat> &images, const std::vector<UMat> &masks)
|
||||
|
||||
.. ocv:function:: void detail::ExposureCompensator::feed(const std::vector<Point> &corners, const std::vector<UMat> &images, const std::vector<std::pair<UMat,uchar> > &masks)
|
||||
|
||||
:param corners: Source image top-left corners
|
||||
|
||||
:param images: Source images
|
||||
|
||||
:param masks: Image masks to update (second value in pair specifies the value which should be used to detect where image is)
|
||||
|
||||
detil::ExposureCompensator::apply
|
||||
----------------------------------
|
||||
|
||||
Compensate exposure in the specified image.
|
||||
|
||||
.. ocv:function:: void detail::ExposureCompensator::apply(int index, Point corner, InputOutputArray image, InputArray mask)
|
||||
|
||||
:param index: Image index
|
||||
|
||||
:param corner: Image top-left corner
|
||||
|
||||
:param image: Image to process
|
||||
|
||||
:param mask: Image mask
|
||||
|
||||
detail::NoExposureCompensator
|
||||
-----------------------------
|
||||
.. ocv:class:: detail::NoExposureCompensator : public detail::ExposureCompensator
|
||||
|
||||
Stub exposure compensator which does nothing. ::
|
||||
|
||||
class CV_EXPORTS NoExposureCompensator : public ExposureCompensator
|
||||
{
|
||||
public:
|
||||
void feed(const std::vector<Point> &/*corners*/, const std::vector<Mat> &/*images*/,
|
||||
const std::vector<std::pair<Mat,uchar> > &/*masks*/) { }
|
||||
void apply(int /*index*/, Point /*corner*/, Mat &/*image*/, const Mat &/*mask*/) { }
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::ExposureCompensator`
|
||||
|
||||
detail::GainCompensator
|
||||
-----------------------
|
||||
.. ocv:class:: detail::GainCompensator : public detail::ExposureCompensator
|
||||
|
||||
Exposure compensator which tries to remove exposure related artifacts by adjusting image intensities, see [BL07]_ and [WJ10]_ for details. ::
|
||||
|
||||
class CV_EXPORTS GainCompensator : public ExposureCompensator
|
||||
{
|
||||
public:
|
||||
void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,
|
||||
const std::vector<std::pair<Mat,uchar> > &masks);
|
||||
void apply(int index, Point corner, Mat &image, const Mat &mask);
|
||||
std::vector<double> gains() const;
|
||||
|
||||
private:
|
||||
/* hidden */
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::ExposureCompensator`
|
||||
|
||||
detail::BlocksGainCompensator
|
||||
-----------------------------
|
||||
.. ocv:class:: detail::BlocksGainCompensator : public detail::ExposureCompensator
|
||||
|
||||
Exposure compensator which tries to remove exposure related artifacts by adjusting image block intensities, see [UES01]_ for details. ::
|
||||
|
||||
class CV_EXPORTS BlocksGainCompensator : public ExposureCompensator
|
||||
{
|
||||
public:
|
||||
BlocksGainCompensator(int bl_width = 32, int bl_height = 32)
|
||||
: bl_width_(bl_width), bl_height_(bl_height) {}
|
||||
void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,
|
||||
const std::vector<std::pair<Mat,uchar> > &masks);
|
||||
void apply(int index, Point corner, Mat &image, const Mat &mask);
|
||||
|
||||
private:
|
||||
/* hidden */
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::ExposureCompensator`
|
@@ -1,210 +0,0 @@
|
||||
High Level Functionality
|
||||
========================
|
||||
|
||||
.. highlight:: cpp
|
||||
|
||||
Stitcher
|
||||
--------
|
||||
.. ocv:class:: Stitcher
|
||||
|
||||
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 (see :ref:`stitching-pipeline`). ::
|
||||
|
||||
class CV_EXPORTS Stitcher
|
||||
{
|
||||
public:
|
||||
enum { ORIG_RESOL = -1 };
|
||||
enum Status { OK, ERR_NEED_MORE_IMGS };
|
||||
|
||||
// Creates stitcher with default parameters
|
||||
static Stitcher createDefault(bool try_use_gpu = false);
|
||||
|
||||
Status estimateTransform(InputArray images);
|
||||
Status estimateTransform(InputArray images, const std::vector<std::vector<Rect> > &rois);
|
||||
|
||||
Status composePanorama(OutputArray pano);
|
||||
Status composePanorama(InputArray images, OutputArray pano);
|
||||
|
||||
Status stitch(InputArray images, OutputArray pano);
|
||||
Status stitch(InputArray images, const std::vector<std::vector<Rect> > &rois, OutputArray pano);
|
||||
|
||||
double registrationResol() const { return registr_resol_; }
|
||||
void setRegistrationResol(double resol_mpx) { registr_resol_ = resol_mpx; }
|
||||
|
||||
double seamEstimationResol() const { return seam_est_resol_; }
|
||||
void setSeamEstimationResol(double resol_mpx) { seam_est_resol_ = resol_mpx; }
|
||||
|
||||
double compositingResol() const { return compose_resol_; }
|
||||
void setCompositingResol(double resol_mpx) { compose_resol_ = resol_mpx; }
|
||||
|
||||
double panoConfidenceThresh() const { return conf_thresh_; }
|
||||
void setPanoConfidenceThresh(double conf_thresh) { conf_thresh_ = conf_thresh; }
|
||||
|
||||
bool waveCorrection() const { return do_wave_correct_; }
|
||||
void setWaveCorrection(bool flag) { do_wave_correct_ = flag; }
|
||||
|
||||
detail::WaveCorrectKind waveCorrectKind() const { return wave_correct_kind_; }
|
||||
void setWaveCorrectKind(detail::WaveCorrectKind kind) { wave_correct_kind_ = kind; }
|
||||
|
||||
Ptr<detail::FeaturesFinder> featuresFinder() { return features_finder_; }
|
||||
const Ptr<detail::FeaturesFinder> featuresFinder() const { return features_finder_; }
|
||||
void setFeaturesFinder(Ptr<detail::FeaturesFinder> features_finder)
|
||||
{ features_finder_ = features_finder; }
|
||||
|
||||
Ptr<detail::FeaturesMatcher> featuresMatcher() { return features_matcher_; }
|
||||
const Ptr<detail::FeaturesMatcher> featuresMatcher() const { return features_matcher_; }
|
||||
void setFeaturesMatcher(Ptr<detail::FeaturesMatcher> features_matcher)
|
||||
{ features_matcher_ = features_matcher; }
|
||||
|
||||
const cv::Mat& matchingMask() const { return matching_mask_; }
|
||||
void setMatchingMask(const cv::Mat &mask)
|
||||
{
|
||||
CV_Assert(mask.type() == CV_8U && mask.cols == mask.rows);
|
||||
matching_mask_ = mask.clone();
|
||||
}
|
||||
|
||||
Ptr<detail::BundleAdjusterBase> bundleAdjuster() { return bundle_adjuster_; }
|
||||
const Ptr<detail::BundleAdjusterBase> bundleAdjuster() const { return bundle_adjuster_; }
|
||||
void setBundleAdjuster(Ptr<detail::BundleAdjusterBase> bundle_adjuster)
|
||||
{ bundle_adjuster_ = bundle_adjuster; }
|
||||
|
||||
Ptr<WarperCreator> warper() { return warper_; }
|
||||
const Ptr<WarperCreator> warper() const { return warper_; }
|
||||
void setWarper(Ptr<WarperCreator> warper) { warper_ = warper; }
|
||||
|
||||
Ptr<detail::ExposureCompensator> exposureCompensator() { return exposure_comp_; }
|
||||
const Ptr<detail::ExposureCompensator> exposureCompensator() const { return exposure_comp_; }
|
||||
void setExposureCompensator(Ptr<detail::ExposureCompensator> exposure_comp)
|
||||
{ exposure_comp_ = exposure_comp; }
|
||||
|
||||
Ptr<detail::SeamFinder> seamFinder() { return seam_finder_; }
|
||||
const Ptr<detail::SeamFinder> seamFinder() const { return seam_finder_; }
|
||||
void setSeamFinder(Ptr<detail::SeamFinder> seam_finder) { seam_finder_ = seam_finder; }
|
||||
|
||||
Ptr<detail::Blender> blender() { return blender_; }
|
||||
const Ptr<detail::Blender> blender() const { return blender_; }
|
||||
void setBlender(Ptr<detail::Blender> blender) { blender_ = blender; }
|
||||
|
||||
private:
|
||||
/* hidden */
|
||||
};
|
||||
|
||||
.. 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
|
||||
|
||||
Stitcher::createDefault
|
||||
-----------------------
|
||||
Creates a stitcher with the default parameters.
|
||||
|
||||
.. ocv:function:: Stitcher Stitcher::createDefault(bool try_use_gpu = false)
|
||||
|
||||
:param try_use_gpu: Flag indicating whether GPU should be used whenever it's possible.
|
||||
|
||||
:return: Stitcher class instance.
|
||||
|
||||
Stitcher::estimateTransform
|
||||
---------------------------
|
||||
|
||||
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 :ocv:func:`Stitcher::stitch`.
|
||||
|
||||
.. ocv:function:: Status Stitcher::estimateTransform(InputArrayOfArrays images)
|
||||
|
||||
.. ocv:function:: Status Stitcher::estimateTransform(InputArrayOfArrays images, const std::vector<std::vector<Rect> > &rois)
|
||||
|
||||
:param images: Input images.
|
||||
|
||||
:param rois: Region of interest rectangles.
|
||||
|
||||
:return: Status code.
|
||||
|
||||
Stitcher::composePanorama
|
||||
-------------------------
|
||||
|
||||
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 :ocv:func:`Stitcher::stitch`.
|
||||
|
||||
.. ocv:function:: Status Stitcher::composePanorama(OutputArray pano)
|
||||
|
||||
.. ocv:function:: Status Stitcher::composePanorama(InputArrayOfArrays images, OutputArray pano)
|
||||
|
||||
:param images: Input images.
|
||||
|
||||
:param pano: Final pano.
|
||||
|
||||
:return: Status code.
|
||||
|
||||
Stitcher::stitch
|
||||
----------------
|
||||
|
||||
These functions try to stitch the given images.
|
||||
|
||||
.. ocv:function:: Status Stitcher::stitch(InputArrayOfArrays images, OutputArray pano)
|
||||
|
||||
.. ocv:function:: Status Stitcher::stitch(InputArrayOfArrays images, const std::vector<std::vector<Rect> > &rois, OutputArray pano)
|
||||
|
||||
:param images: Input images.
|
||||
|
||||
:param rois: Region of interest rectangles.
|
||||
|
||||
:param pano: Final pano.
|
||||
|
||||
:return: Status code.
|
||||
|
||||
WarperCreator
|
||||
-------------
|
||||
.. ocv:class:: WarperCreator
|
||||
|
||||
Image warper factories base class. ::
|
||||
|
||||
class WarperCreator
|
||||
{
|
||||
public:
|
||||
virtual ~WarperCreator() {}
|
||||
virtual Ptr<detail::RotationWarper> create(float scale) const = 0;
|
||||
};
|
||||
|
||||
PlaneWarper
|
||||
-----------
|
||||
.. ocv:class:: PlaneWarper : public WarperCreator
|
||||
|
||||
Plane warper factory class. ::
|
||||
|
||||
class PlaneWarper : public WarperCreator
|
||||
{
|
||||
public:
|
||||
Ptr<detail::RotationWarper> create(float scale) const { return new detail::PlaneWarper(scale); }
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::PlaneWarper`
|
||||
|
||||
CylindricalWarper
|
||||
-----------------
|
||||
.. ocv:class:: CylindricalWarper : public WarperCreator
|
||||
|
||||
Cylindrical warper factory class. ::
|
||||
|
||||
class CylindricalWarper: public WarperCreator
|
||||
{
|
||||
public:
|
||||
Ptr<detail::RotationWarper> create(float scale) const { return new detail::CylindricalWarper(scale); }
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::CylindricalWarper`
|
||||
|
||||
SphericalWarper
|
||||
---------------
|
||||
.. ocv:class:: SphericalWarper : public WarperCreator
|
||||
|
||||
Spherical warper factory class. ::
|
||||
|
||||
class SphericalWarper: public WarperCreator
|
||||
{
|
||||
public:
|
||||
Ptr<detail::RotationWarper> create(float scale) const { return new detail::SphericalWarper(scale); }
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::SphericalWarper`
|
@@ -1,29 +0,0 @@
|
||||
.. _stitching-pipeline:
|
||||
|
||||
Stitching Pipeline
|
||||
==================
|
||||
|
||||
This figure illustrates the stitching module pipeline implemented in the :ocv:class:`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 [BL07]_.
|
||||
|
||||
.. image:: StitchingPipeline.jpg
|
||||
|
||||
References
|
||||
==========
|
||||
|
||||
.. [BL07] M. Brown and D. Lowe. Automatic Panoramic Image Stitching using Invariant Features. International Journal of Computer Vision, 74(1), pages 59-73, 2007.
|
||||
|
||||
.. [RS10] Richard Szeliski. Computer Vision: Algorithms and Applications. Springer, New York, 2010.
|
||||
|
||||
.. [RS04] Richard Szeliski. Image alignment and stitching: A tutorial. Technical Report MSR-TR-2004-92, Microsoft Research, December 2004.
|
||||
|
||||
.. [SS00] Heung-Yeung Shum and Richard Szeliski. Construction of panoramic mosaics with global and local alignment. International Journal of Computer Vision, 36(2):101-130, February 2000. Erratum published July 2002, 48(2):151-152.
|
||||
|
||||
.. [V03] Vivek Kwatra, Arno Schödl, Irfan Essa, Greg Turk and Aaron Bobick. Graphcut Textures: Image and Video Synthesis Using Graph Cuts. To appear in Proc. ACM Transactions on Graphics, SIGGRAPH 2003.
|
||||
|
||||
.. [UES01] M. Uyttendaele, A. Eden, and R. Szeliski. Eliminating ghosting and exposure artifacts in image mosaics. In Proc. CVPR’01, volume 2, pages 509–516, 2001
|
||||
|
||||
.. [WJ10] Wei Xu and Jane Mulligan. Performance evaluation of color correction approaches for automatic multiview image and video stitching. In Intl. Conf on Computer Vision and Pattern Recognition (CVPR10), San Francisco, CA, 2010
|
||||
|
||||
.. [BA83] Burt, P., and Adelson, E. H., A Multiresolution Spline with Application to Image Mosaics. ACM Transactions on Graphics, 2(4):217-236, 1983.
|
@@ -1,250 +0,0 @@
|
||||
Features Finding and Images Matching
|
||||
====================================
|
||||
|
||||
.. highlight:: cpp
|
||||
|
||||
detail::ImageFeatures
|
||||
-----------------------
|
||||
.. ocv:struct:: detail::ImageFeatures
|
||||
|
||||
Structure containing image keypoints and descriptors. ::
|
||||
|
||||
struct CV_EXPORTS ImageFeatures
|
||||
{
|
||||
int img_idx;
|
||||
Size img_size;
|
||||
std::vector<KeyPoint> keypoints;
|
||||
Mat descriptors;
|
||||
};
|
||||
|
||||
detail::FeaturesFinder
|
||||
----------------------
|
||||
.. ocv:class:: detail::FeaturesFinder
|
||||
|
||||
Feature finders base class. ::
|
||||
|
||||
class CV_EXPORTS FeaturesFinder
|
||||
{
|
||||
public:
|
||||
virtual ~FeaturesFinder() {}
|
||||
void operator ()(const Mat &image, ImageFeatures &features);
|
||||
void operator ()(const Mat &image, ImageFeatures &features, const std::vector<cv::Rect> &rois);
|
||||
virtual void collectGarbage() {}
|
||||
|
||||
protected:
|
||||
virtual void find(const Mat &image, ImageFeatures &features) = 0;
|
||||
};
|
||||
|
||||
detail::FeaturesFinder::operator()
|
||||
----------------------------------
|
||||
|
||||
Finds features in the given image.
|
||||
|
||||
.. ocv:function:: void detail::FeaturesFinder::operator ()(InputArray image, ImageFeatures &features)
|
||||
|
||||
.. ocv:function:: void detail::FeaturesFinder::operator ()(InputArray image, ImageFeatures &features, const std::vector<cv::Rect> &rois)
|
||||
|
||||
:param image: Source image
|
||||
|
||||
:param features: Found features
|
||||
|
||||
:param rois: Regions of interest
|
||||
|
||||
.. seealso:: :ocv:struct:`detail::ImageFeatures`, :ocv:class:`Rect_`
|
||||
|
||||
detail::FeaturesFinder::collectGarbage
|
||||
--------------------------------------
|
||||
|
||||
Frees unused memory allocated before if there is any.
|
||||
|
||||
.. ocv:function:: void detail::FeaturesFinder::collectGarbage()
|
||||
|
||||
detail::FeaturesFinder::find
|
||||
----------------------------
|
||||
|
||||
This method must implement features finding logic in order to make the wrappers `detail::FeaturesFinder::operator()`_ work.
|
||||
|
||||
.. ocv:function:: void detail::FeaturesFinder::find(InputArray image, ImageFeatures &features)
|
||||
|
||||
:param image: Source image
|
||||
|
||||
:param features: Found features
|
||||
|
||||
.. seealso:: :ocv:struct:`detail::ImageFeatures`
|
||||
|
||||
detail::SurfFeaturesFinder
|
||||
--------------------------
|
||||
.. ocv:class:: detail::SurfFeaturesFinder : public detail::FeaturesFinder
|
||||
|
||||
SURF features finder. ::
|
||||
|
||||
class CV_EXPORTS SurfFeaturesFinder : public FeaturesFinder
|
||||
{
|
||||
public:
|
||||
SurfFeaturesFinder(double hess_thresh = 300., int num_octaves = 3, int num_layers = 4,
|
||||
int num_octaves_descr = /*4*/3, int num_layers_descr = /*2*/4);
|
||||
|
||||
private:
|
||||
/* hidden */
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::FeaturesFinder`, ``SURF``
|
||||
|
||||
detail::OrbFeaturesFinder
|
||||
-------------------------
|
||||
.. ocv:class:: detail::OrbFeaturesFinder : public detail::FeaturesFinder
|
||||
|
||||
ORB features finder. ::
|
||||
|
||||
class CV_EXPORTS OrbFeaturesFinder : public FeaturesFinder
|
||||
{
|
||||
public:
|
||||
OrbFeaturesFinder(Size _grid_size = Size(3,1), size_t n_features = 1500,
|
||||
const ORB::CommonParams &detector_params = ORB::CommonParams(1.3f, 5));
|
||||
|
||||
private:
|
||||
/* hidden */
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::FeaturesFinder`, :ocv:class:`ORB`
|
||||
|
||||
detail::MatchesInfo
|
||||
-------------------
|
||||
.. ocv:struct:: detail::MatchesInfo
|
||||
|
||||
Structure containing information about matches between two images. It's assumed that there is a homography between those images. ::
|
||||
|
||||
struct CV_EXPORTS MatchesInfo
|
||||
{
|
||||
MatchesInfo();
|
||||
MatchesInfo(const MatchesInfo &other);
|
||||
const MatchesInfo& operator =(const MatchesInfo &other);
|
||||
|
||||
int src_img_idx, dst_img_idx; // Images indices (optional)
|
||||
std::vector<DMatch> matches;
|
||||
std::vector<uchar> inliers_mask; // Geometrically consistent matches mask
|
||||
int num_inliers; // Number of geometrically consistent matches
|
||||
Mat H; // Estimated homography
|
||||
double confidence; // Confidence two images are from the same panorama
|
||||
};
|
||||
|
||||
detail::FeaturesMatcher
|
||||
-----------------------
|
||||
.. ocv:class:: detail::FeaturesMatcher
|
||||
|
||||
Feature matchers base class. ::
|
||||
|
||||
class CV_EXPORTS FeaturesMatcher
|
||||
{
|
||||
public:
|
||||
virtual ~FeaturesMatcher() {}
|
||||
|
||||
void operator ()(const ImageFeatures &features1, const ImageFeatures &features2,
|
||||
MatchesInfo& matches_info) { match(features1, features2, matches_info); }
|
||||
|
||||
void operator ()(const std::vector<ImageFeatures> &features, std::vector<MatchesInfo> &pairwise_matches,
|
||||
const Mat &mask = cv::Mat());
|
||||
|
||||
bool isThreadSafe() const { return is_thread_safe_; }
|
||||
|
||||
virtual void collectGarbage() {}
|
||||
|
||||
protected:
|
||||
FeaturesMatcher(bool is_thread_safe = false) : is_thread_safe_(is_thread_safe) {}
|
||||
|
||||
virtual void match(const ImageFeatures &features1, const ImageFeatures &features2,
|
||||
MatchesInfo& matches_info) = 0;
|
||||
|
||||
bool is_thread_safe_;
|
||||
};
|
||||
|
||||
detail::FeaturesMatcher::operator()
|
||||
-----------------------------------
|
||||
|
||||
Performs images matching.
|
||||
|
||||
.. ocv:function:: void detail::FeaturesMatcher::operator ()(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo& matches_info)
|
||||
|
||||
:param features1: First image features
|
||||
|
||||
:param features2: Second image features
|
||||
|
||||
:param matches_info: Found matches
|
||||
|
||||
.. ocv:function:: void detail::FeaturesMatcher::operator ()( const std::vector<ImageFeatures> & features, std::vector<MatchesInfo> & pairwise_matches, const UMat & mask=UMat() )
|
||||
|
||||
:param features: Features of the source images
|
||||
|
||||
:param pairwise_matches: Found pairwise matches
|
||||
|
||||
:param mask: Mask indicating which image pairs must be matched
|
||||
|
||||
The function is parallelized with the TBB library.
|
||||
|
||||
.. seealso:: :ocv:struct:`detail::MatchesInfo`
|
||||
|
||||
detail::FeaturesMatcher::isThreadSafe
|
||||
-------------------------------------
|
||||
|
||||
.. ocv:function:: bool detail::FeaturesMatcher::isThreadSafe() const
|
||||
|
||||
:return: True, if it's possible to use the same matcher instance in parallel, false otherwise
|
||||
|
||||
detail::FeaturesMatcher::collectGarbage
|
||||
---------------------------------------
|
||||
|
||||
Frees unused memory allocated before if there is any.
|
||||
|
||||
.. ocv:function:: void detail::FeaturesMatcher::collectGarbage()
|
||||
|
||||
detail::FeaturesMatcher::match
|
||||
------------------------------
|
||||
|
||||
This method must implement matching logic in order to make the wrappers `detail::FeaturesMatcher::operator()`_ work.
|
||||
|
||||
.. ocv:function:: void detail::FeaturesMatcher::match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo& matches_info)
|
||||
|
||||
:param features1: first image features
|
||||
|
||||
:param features2: second image features
|
||||
|
||||
:param matches_info: found matches
|
||||
|
||||
detail::BestOf2NearestMatcher
|
||||
-----------------------------
|
||||
.. ocv:class:: detail::BestOf2NearestMatcher : public detail::FeaturesMatcher
|
||||
|
||||
Features matcher which finds two best matches for each feature and leaves the best one only if the ratio between descriptor distances is greater than the threshold ``match_conf``. ::
|
||||
|
||||
class CV_EXPORTS BestOf2NearestMatcher : public FeaturesMatcher
|
||||
{
|
||||
public:
|
||||
BestOf2NearestMatcher(bool try_use_gpu = false, float match_conf = 0.65f,
|
||||
int num_matches_thresh1 = 6, int num_matches_thresh2 = 6);
|
||||
|
||||
void collectGarbage();
|
||||
|
||||
protected:
|
||||
void match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info);
|
||||
|
||||
int num_matches_thresh1_;
|
||||
int num_matches_thresh2_;
|
||||
Ptr<FeaturesMatcher> impl_;
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::FeaturesMatcher`
|
||||
|
||||
detail::BestOf2NearestMatcher::BestOf2NearestMatcher
|
||||
----------------------------------------------------
|
||||
|
||||
Constructs a "best of 2 nearest" matcher.
|
||||
|
||||
.. ocv:function:: detail::BestOf2NearestMatcher::BestOf2NearestMatcher(bool try_use_gpu = false, float match_conf = 0.3f, int num_matches_thresh1 = 6, int num_matches_thresh2 = 6)
|
||||
|
||||
:param try_use_gpu: Should try to use GPU or not
|
||||
|
||||
:param match_conf: Match distances ration threshold
|
||||
|
||||
:param num_matches_thresh1: Minimum number of matches required for the 2D projective transform estimation used in the inliers classification step
|
||||
|
||||
:param num_matches_thresh2: Minimum number of matches required for the 2D projective transform re-estimation on inliers
|
@@ -1,243 +0,0 @@
|
||||
Rotation Estimation
|
||||
===================
|
||||
|
||||
.. highlight:: cpp
|
||||
|
||||
detail::Estimator
|
||||
-----------------
|
||||
.. ocv:class:: detail::Estimator
|
||||
|
||||
Rotation estimator base class. It takes features of all images, pairwise matches between all images and estimates rotations of all cameras.
|
||||
|
||||
.. note:: The coordinate system origin is implementation-dependent, but you can always normalize the rotations in respect to the first camera, for instance.
|
||||
|
||||
::
|
||||
|
||||
class CV_EXPORTS Estimator
|
||||
{
|
||||
public:
|
||||
virtual ~Estimator() {}
|
||||
|
||||
bool operator ()(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches,
|
||||
std::vector<CameraParams> &cameras);
|
||||
|
||||
protected:
|
||||
virtual bool estimate(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches,
|
||||
std::vector<CameraParams> &cameras) = 0;
|
||||
};
|
||||
|
||||
detail::Estimator::operator()
|
||||
-----------------------------
|
||||
|
||||
Estimates camera parameters.
|
||||
|
||||
.. ocv:function:: bool detail::Estimator::operator ()(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches, std::vector<CameraParams> &cameras)
|
||||
|
||||
:param features: Features of images
|
||||
|
||||
:param pairwise_matches: Pairwise matches of images
|
||||
|
||||
:param cameras: Estimated camera parameters
|
||||
|
||||
:return: True in case of success, false otherwise
|
||||
|
||||
detail::Estimator::estimate
|
||||
---------------------------
|
||||
|
||||
This method must implement camera parameters estimation logic in order to make the wrapper `detail::Estimator::operator()`_ work.
|
||||
|
||||
.. ocv:function:: bool detail::Estimator::estimate(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches, std::vector<CameraParams> &cameras)
|
||||
|
||||
:param features: Features of images
|
||||
|
||||
:param pairwise_matches: Pairwise matches of images
|
||||
|
||||
:param cameras: Estimated camera parameters
|
||||
|
||||
:return: True in case of success, false otherwise
|
||||
|
||||
detail::HomographyBasedEstimator
|
||||
--------------------------------
|
||||
.. ocv:class:: detail::HomographyBasedEstimator : public detail::Estimator
|
||||
|
||||
Homography based rotation estimator. ::
|
||||
|
||||
class CV_EXPORTS HomographyBasedEstimator : public Estimator
|
||||
{
|
||||
public:
|
||||
HomographyBasedEstimator(bool is_focals_estimated = false)
|
||||
: is_focals_estimated_(is_focals_estimated) {}
|
||||
|
||||
private:
|
||||
/* hidden */
|
||||
};
|
||||
|
||||
detail::BundleAdjusterBase
|
||||
--------------------------
|
||||
.. ocv:class:: detail::BundleAdjusterBase : public detail::Estimator
|
||||
|
||||
Base class for all camera parameters refinement methods. ::
|
||||
|
||||
class CV_EXPORTS BundleAdjusterBase : public Estimator
|
||||
{
|
||||
public:
|
||||
const Mat refinementMask() const { return refinement_mask_.clone(); }
|
||||
void setRefinementMask(const Mat &mask)
|
||||
{
|
||||
CV_Assert(mask.type() == CV_8U && mask.size() == Size(3, 3));
|
||||
refinement_mask_ = mask.clone();
|
||||
}
|
||||
|
||||
double confThresh() const { return conf_thresh_; }
|
||||
void setConfThresh(double conf_thresh) { conf_thresh_ = conf_thresh; }
|
||||
|
||||
CvTermCriteria termCriteria() { return term_criteria_; }
|
||||
void setTermCriteria(const CvTermCriteria& term_criteria) { term_criteria_ = term_criteria; }
|
||||
|
||||
protected:
|
||||
BundleAdjusterBase(int num_params_per_cam, int num_errs_per_measurement)
|
||||
: num_params_per_cam_(num_params_per_cam),
|
||||
num_errs_per_measurement_(num_errs_per_measurement)
|
||||
{
|
||||
setRefinementMask(Mat::ones(3, 3, CV_8U));
|
||||
setConfThresh(1.);
|
||||
setTermCriteria(cvTermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 1000, DBL_EPSILON));
|
||||
}
|
||||
|
||||
// Runs bundle adjustment
|
||||
virtual void estimate(const std::vector<ImageFeatures> &features,
|
||||
const std::vector<MatchesInfo> &pairwise_matches,
|
||||
std::vector<CameraParams> &cameras);
|
||||
|
||||
virtual void setUpInitialCameraParams(const std::vector<CameraParams> &cameras) = 0;
|
||||
virtual void obtainRefinedCameraParams(std::vector<CameraParams> &cameras) const = 0;
|
||||
virtual void calcError(Mat &err) = 0;
|
||||
virtual void calcJacobian(Mat &jac) = 0;
|
||||
|
||||
// 3x3 8U mask, where 0 means don't refine respective parameter, != 0 means refine
|
||||
Mat refinement_mask_;
|
||||
|
||||
int num_images_;
|
||||
int total_num_matches_;
|
||||
|
||||
int num_params_per_cam_;
|
||||
int num_errs_per_measurement_;
|
||||
|
||||
const ImageFeatures *features_;
|
||||
const MatchesInfo *pairwise_matches_;
|
||||
|
||||
// Threshold to filter out poorly matched image pairs
|
||||
double conf_thresh_;
|
||||
|
||||
//Levenberg–Marquardt algorithm termination criteria
|
||||
CvTermCriteria term_criteria_;
|
||||
|
||||
// Camera parameters matrix (CV_64F)
|
||||
Mat cam_params_;
|
||||
|
||||
// Connected images pairs
|
||||
std::vector<std::pair<int,int> > edges_;
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::Estimator`
|
||||
|
||||
detail::BundleAdjusterBase::BundleAdjusterBase
|
||||
----------------------------------------------
|
||||
|
||||
Construct a bundle adjuster base instance.
|
||||
|
||||
.. ocv:function:: detail::BundleAdjusterBase::BundleAdjusterBase(int num_params_per_cam, int num_errs_per_measurement)
|
||||
|
||||
:param num_params_per_cam: Number of parameters per camera
|
||||
|
||||
:param num_errs_per_measurement: Number of error terms (components) per match
|
||||
|
||||
detail::BundleAdjusterBase::setUpInitialCameraParams
|
||||
----------------------------------------------------
|
||||
|
||||
Sets initial camera parameter to refine.
|
||||
|
||||
.. ocv:function:: void detail::BundleAdjusterBase::setUpInitialCameraParams(const std::vector<CameraParams> &cameras)
|
||||
|
||||
:param cameras: Camera parameters
|
||||
|
||||
detail::BundleAdjusterBase::calcError
|
||||
-------------------------------------
|
||||
|
||||
Calculates error vector.
|
||||
|
||||
.. ocv:function:: void detail::BundleAdjusterBase::calcError(Mat &err)
|
||||
|
||||
:param err: Error column-vector of length ``total_num_matches * num_errs_per_measurement``
|
||||
|
||||
detail::BundleAdjusterBase::calcJacobian
|
||||
----------------------------------------
|
||||
|
||||
Calculates the cost function jacobian.
|
||||
|
||||
.. ocv:function:: void detail::BundleAdjusterBase::calcJacobian(Mat &jac)
|
||||
|
||||
:param jac: Jacobian matrix of dimensions ``(total_num_matches * num_errs_per_measurement) x (num_images * num_params_per_cam)``
|
||||
|
||||
detail::BundleAdjusterBase::obtainRefinedCameraParams
|
||||
-----------------------------------------------------
|
||||
|
||||
Gets the refined camera parameters.
|
||||
|
||||
.. ocv:function:: void detail::BundleAdjusterBase::obtainRefinedCameraParams(std::vector<CameraParams> &cameras) const
|
||||
|
||||
:param cameras: Refined camera parameters
|
||||
|
||||
detail::BundleAdjusterReproj
|
||||
----------------------------
|
||||
.. ocv:class:: detail::BundleAdjusterReproj : public detail::BundleAdjusterBase
|
||||
|
||||
Implementation of the camera parameters refinement algorithm which minimizes sum of the reprojection error squares. ::
|
||||
|
||||
class CV_EXPORTS BundleAdjusterReproj : public BundleAdjusterBase
|
||||
{
|
||||
public:
|
||||
BundleAdjusterReproj() : BundleAdjusterBase(7, 2) {}
|
||||
|
||||
private:
|
||||
/* hidden */
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::BundleAdjusterBase`, :ocv:class:`detail::Estimator`
|
||||
|
||||
detail::BundleAdjusterRay
|
||||
-------------------------
|
||||
.. ocv:class:: detail::BundleAdjusterRay : public detail::BundleAdjusterBase
|
||||
|
||||
Implementation of the camera parameters refinement algorithm which minimizes sum of the distances between the rays passing through the camera center and a feature. ::
|
||||
|
||||
class CV_EXPORTS BundleAdjusterRay : public BundleAdjusterBase
|
||||
{
|
||||
public:
|
||||
BundleAdjusterRay() : BundleAdjusterBase(4, 3) {}
|
||||
|
||||
private:
|
||||
/* hidden */
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::BundleAdjusterBase`
|
||||
|
||||
detail::WaveCorrectKind
|
||||
-----------------------
|
||||
Wave correction kind.
|
||||
|
||||
.. ocv:enum:: detail::WaveCorrectKind
|
||||
|
||||
.. ocv:emember:: WAVE_CORRECT_HORIZ
|
||||
.. ocv:emember:: WAVE_CORRECT_VERT
|
||||
|
||||
|
||||
detail::waveCorrect
|
||||
-------------------
|
||||
Tries to make panorama more horizontal (or vertical).
|
||||
|
||||
.. ocv:function:: void detail::waveCorrect(std::vector<Mat> &rmats, WaveCorrectKind kind)
|
||||
|
||||
:param rmats: Camera rotation matrices.
|
||||
|
||||
:param kind: Correction kind, see :ocv:enum:`detail::WaveCorrectKind`.
|
@@ -1,135 +0,0 @@
|
||||
Seam Estimation
|
||||
===============
|
||||
|
||||
.. highlight:: cpp
|
||||
|
||||
detail::SeamFinder
|
||||
------------------
|
||||
.. ocv:class:: detail::SeamFinder
|
||||
|
||||
Base class for a seam estimator. ::
|
||||
|
||||
class CV_EXPORTS SeamFinder
|
||||
{
|
||||
public:
|
||||
virtual ~SeamFinder() {}
|
||||
virtual void find(const std::vector<Mat> &src, const std::vector<Point> &corners,
|
||||
std::vector<Mat> &masks) = 0;
|
||||
};
|
||||
|
||||
detail::SeamFinder::find
|
||||
------------------------
|
||||
|
||||
Estimates seams.
|
||||
|
||||
.. ocv:function:: void detail::SeamFinder::find(const std::vector<UMat> &src, const std::vector<Point> &corners, std::vector<UMat> &masks)
|
||||
|
||||
:param src: Source images
|
||||
|
||||
:param corners: Source image top-left corners
|
||||
|
||||
:param masks: Source image masks to update
|
||||
|
||||
|
||||
detail::NoSeamFinder
|
||||
--------------------
|
||||
.. ocv:class:: detail::NoSeamFinder : public detail::SeamFinder
|
||||
|
||||
Stub seam estimator which does nothing. ::
|
||||
|
||||
class CV_EXPORTS NoSeamFinder : public SeamFinder
|
||||
{
|
||||
public:
|
||||
void find(const std::vector<Mat>&, const std::vector<Point>&, std::vector<Mat>&) {}
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::SeamFinder`
|
||||
|
||||
detail::PairwiseSeamFinder
|
||||
--------------------------
|
||||
.. ocv:class:: detail::PairwiseSeamFinder : public detail::SeamFinder
|
||||
|
||||
Base class for all pairwise seam estimators. ::
|
||||
|
||||
class CV_EXPORTS PairwiseSeamFinder : public SeamFinder
|
||||
{
|
||||
public:
|
||||
virtual void find(const std::vector<Mat> &src, const std::vector<Point> &corners,
|
||||
std::vector<Mat> &masks);
|
||||
|
||||
protected:
|
||||
void run();
|
||||
virtual void findInPair(size_t first, size_t second, Rect roi) = 0;
|
||||
|
||||
std::vector<Mat> images_;
|
||||
std::vector<Size> sizes_;
|
||||
std::vector<Point> corners_;
|
||||
std::vector<Mat> masks_;
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::SeamFinder`
|
||||
|
||||
detail::PairwiseSeamFinder::findInPair
|
||||
--------------------------------------
|
||||
|
||||
Resolves masks intersection of two specified images in the given ROI.
|
||||
|
||||
.. ocv:function:: void detail::PairwiseSeamFinder::findInPair(size_t first, size_t second, Rect roi)
|
||||
|
||||
:param first: First image index
|
||||
|
||||
:param second: Second image index
|
||||
|
||||
:param roi: Region of interest
|
||||
|
||||
detail::VoronoiSeamFinder
|
||||
-------------------------
|
||||
.. ocv:class:: detail::VoronoiSeamFinder : public detail::PairwiseSeamFinder
|
||||
|
||||
Voronoi diagram-based seam estimator. ::
|
||||
|
||||
class CV_EXPORTS VoronoiSeamFinder : public PairwiseSeamFinder
|
||||
{
|
||||
public:
|
||||
virtual void find(const std::vector<Size> &size, const std::vector<Point> &corners,
|
||||
std::vector<Mat> &masks);
|
||||
private:
|
||||
void findInPair(size_t first, size_t second, Rect roi);
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::PairwiseSeamFinder`
|
||||
|
||||
detail::GraphCutSeamFinderBase
|
||||
------------------------------
|
||||
.. ocv:class:: detail::GraphCutSeamFinderBase
|
||||
|
||||
Base class for all minimum graph-cut-based seam estimators. ::
|
||||
|
||||
class CV_EXPORTS GraphCutSeamFinderBase
|
||||
{
|
||||
public:
|
||||
enum { COST_COLOR, COST_COLOR_GRAD };
|
||||
};
|
||||
|
||||
detail::GraphCutSeamFinder
|
||||
--------------------------
|
||||
.. ocv:class:: detail::GraphCutSeamFinder : public detail::GraphCutSeamFinderBase, public detail::SeamFinder
|
||||
|
||||
Minimum graph cut-based seam estimator. See details in [V03]_. ::
|
||||
|
||||
class CV_EXPORTS GraphCutSeamFinder : public GraphCutSeamFinderBase, public SeamFinder
|
||||
{
|
||||
public:
|
||||
GraphCutSeamFinder(int cost_type = COST_COLOR_GRAD, float terminal_cost = 10000.f,
|
||||
float bad_region_penalty = 1000.f);
|
||||
|
||||
void find(const std::vector<Mat> &src, const std::vector<Point> &corners,
|
||||
std::vector<Mat> &masks);
|
||||
|
||||
private:
|
||||
/* hidden */
|
||||
};
|
||||
|
||||
.. seealso::
|
||||
:ocv:class:`detail::GraphCutSeamFinderBase`,
|
||||
:ocv:class:`detail::SeamFinder`
|
@@ -1,17 +0,0 @@
|
||||
***************************
|
||||
stitching. Images stitching
|
||||
***************************
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
introduction
|
||||
high_level
|
||||
camera
|
||||
matching
|
||||
motion_estimation
|
||||
autocalib
|
||||
warpers
|
||||
seam_estimation
|
||||
exposure_compensation
|
||||
blenders
|
@@ -1,263 +0,0 @@
|
||||
Images Warping
|
||||
==============
|
||||
|
||||
.. highlight:: cpp
|
||||
|
||||
detail::RotationWarper
|
||||
----------------------
|
||||
.. ocv:class:: detail::RotationWarper
|
||||
|
||||
Rotation-only model image warper interface. ::
|
||||
|
||||
class CV_EXPORTS RotationWarper
|
||||
{
|
||||
public:
|
||||
virtual ~RotationWarper() {}
|
||||
|
||||
virtual Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R) = 0;
|
||||
|
||||
virtual Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) = 0;
|
||||
|
||||
virtual Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,
|
||||
OutputArray dst) = 0;
|
||||
|
||||
virtual void warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,
|
||||
Size dst_size, OutputArray dst) = 0;
|
||||
|
||||
virtual Rect warpRoi(Size src_size, InputArray K, InputArray R) = 0;
|
||||
};
|
||||
|
||||
detail::RotationWarper::warpPoint
|
||||
---------------------------------
|
||||
|
||||
Projects the image point.
|
||||
|
||||
.. ocv:function:: Point2f detail::RotationWarper::warpPoint(const Point2f &pt, InputArray K, InputArray R)
|
||||
|
||||
:param pt: Source point
|
||||
|
||||
:param K: Camera intrinsic parameters
|
||||
|
||||
:param R: Camera rotation matrix
|
||||
|
||||
:return: Projected point
|
||||
|
||||
detail::RotationWarper::buildMaps
|
||||
---------------------------------
|
||||
|
||||
Builds the projection maps according to the given camera data.
|
||||
|
||||
.. ocv:function:: Rect detail::RotationWarper::buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap)
|
||||
|
||||
:param src_size: Source image size
|
||||
|
||||
:param K: Camera intrinsic parameters
|
||||
|
||||
:param R: Camera rotation matrix
|
||||
|
||||
:param xmap: Projection map for the x axis
|
||||
|
||||
:param ymap: Projection map for the y axis
|
||||
|
||||
:return: Projected image minimum bounding box
|
||||
|
||||
detail::RotationWarper::warp
|
||||
----------------------------
|
||||
|
||||
Projects the image.
|
||||
|
||||
.. ocv:function:: Point detail::RotationWarper::warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, OutputArray dst)
|
||||
|
||||
:param src: Source image
|
||||
|
||||
:param K: Camera intrinsic parameters
|
||||
|
||||
:param R: Camera rotation matrix
|
||||
|
||||
:param interp_mode: Interpolation mode
|
||||
|
||||
:param border_mode: Border extrapolation mode
|
||||
|
||||
:param dst: Projected image
|
||||
|
||||
:return: Project image top-left corner
|
||||
|
||||
detail::RotationWarper::warpBackward
|
||||
------------------------------------
|
||||
|
||||
Projects the image backward.
|
||||
|
||||
.. ocv:function:: void detail::RotationWarper::warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, Size dst_size, OutputArray dst)
|
||||
|
||||
:param src: Projected image
|
||||
|
||||
:param K: Camera intrinsic parameters
|
||||
|
||||
:param R: Camera rotation matrix
|
||||
|
||||
:param interp_mode: Interpolation mode
|
||||
|
||||
:param border_mode: Border extrapolation mode
|
||||
|
||||
:param dst_size: Backward-projected image size
|
||||
|
||||
:param dst: Backward-projected image
|
||||
|
||||
detail::RotationWarper::warpRoi
|
||||
-------------------------------
|
||||
|
||||
.. ocv:function:: Rect detail::RotationWarper::warpRoi(Size src_size, InputArray K, InputArray R)
|
||||
|
||||
:param src_size: Source image bounding box
|
||||
|
||||
:param K: Camera intrinsic parameters
|
||||
|
||||
:param R: Camera rotation matrix
|
||||
|
||||
:return: Projected image minimum bounding box
|
||||
|
||||
detail::ProjectorBase
|
||||
---------------------
|
||||
.. ocv:struct:: detail::ProjectorBase
|
||||
|
||||
Base class for warping logic implementation. ::
|
||||
|
||||
struct CV_EXPORTS ProjectorBase
|
||||
{
|
||||
void setCameraParams(InputArray K = Mat::eye(3, 3, CV_32F),
|
||||
InputArray R = Mat::eye(3, 3, CV_32F),
|
||||
InputArray T = Mat::zeros(3, 1, CV_32F));
|
||||
|
||||
float scale;
|
||||
float k[9];
|
||||
float rinv[9];
|
||||
float r_kinv[9];
|
||||
float k_rinv[9];
|
||||
float t[3];
|
||||
};
|
||||
|
||||
detail::RotationWarperBase
|
||||
--------------------------
|
||||
.. ocv:class:: detail::RotationWarperBase
|
||||
|
||||
Base class for rotation-based warper using a `detail::ProjectorBase`_ derived class. ::
|
||||
|
||||
template <class P>
|
||||
class CV_EXPORTS RotationWarperBase : public RotationWarper
|
||||
{
|
||||
public:
|
||||
Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R);
|
||||
|
||||
Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap);
|
||||
|
||||
Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,
|
||||
OutputArray dst);
|
||||
|
||||
void warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,
|
||||
Size dst_size, OutputArray dst);
|
||||
|
||||
Rect warpRoi(Size src_size, InputArray K, InputArray R);
|
||||
|
||||
protected:
|
||||
|
||||
// Detects ROI of the destination image. It's correct for any projection.
|
||||
virtual void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br);
|
||||
|
||||
// Detects ROI of the destination image by walking over image border.
|
||||
// Correctness for any projection isn't guaranteed.
|
||||
void detectResultRoiByBorder(Size src_size, Point &dst_tl, Point &dst_br);
|
||||
|
||||
P projector_;
|
||||
};
|
||||
|
||||
detail::PlaneWarper
|
||||
-------------------
|
||||
.. ocv:class:: detail::PlaneWarper : public detail::RotationWarperBase<PlaneProjector>
|
||||
|
||||
Warper that maps an image onto the z = 1 plane. ::
|
||||
|
||||
class CV_EXPORTS PlaneWarper : public RotationWarperBase<PlaneProjector>
|
||||
{
|
||||
public:
|
||||
PlaneWarper(float scale = 1.f) { projector_.scale = scale; }
|
||||
|
||||
void setScale(float scale) { projector_.scale = scale; }
|
||||
|
||||
Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R, InputArray T);
|
||||
|
||||
Rect buildMaps(Size src_size, InputArray K, InputArray R, InputArray T, OutputArray xmap, OutputArray ymap);
|
||||
|
||||
Point warp(InputArray src, InputArray K, InputArray R, InputArray T, int interp_mode, int border_mode,
|
||||
OutputArray dst);
|
||||
|
||||
Rect warpRoi(Size src_size, InputArray K, InputArray R, InputArray T);
|
||||
|
||||
protected:
|
||||
void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br);
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::RotationWarper`
|
||||
|
||||
detail::PlaneWarper::PlaneWarper
|
||||
--------------------------------
|
||||
|
||||
Construct an instance of the plane warper class.
|
||||
|
||||
.. ocv:function:: void detail::PlaneWarper::PlaneWarper(float scale = 1.f)
|
||||
|
||||
:param scale: Projected image scale multiplier
|
||||
|
||||
detail::SphericalWarper
|
||||
-----------------------
|
||||
.. ocv:class:: detail::SphericalWarper : public detail::RotationWarperBase<SphericalProjector>
|
||||
|
||||
Warper that maps an image onto the unit sphere located at the origin. ::
|
||||
|
||||
class CV_EXPORTS SphericalWarper : public RotationWarperBase<SphericalProjector>
|
||||
{
|
||||
public:
|
||||
SphericalWarper(float scale) { projector_.scale = scale; }
|
||||
|
||||
protected:
|
||||
void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br);
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::RotationWarper`
|
||||
|
||||
detail::SphericalWarper::SphericalWarper
|
||||
----------------------------------------
|
||||
|
||||
Construct an instance of the spherical warper class.
|
||||
|
||||
.. ocv:function:: void detail::SphericalWarper::SphericalWarper(float scale)
|
||||
|
||||
:param scale: Projected image scale multiplier
|
||||
|
||||
detail::CylindricalWarper
|
||||
-------------------------
|
||||
.. ocv:class:: detail::CylindricalWarper : public detail::RotationWarperBase<CylindricalProjector>
|
||||
|
||||
Warper that maps an image onto the x*x + z*z = 1 cylinder. ::
|
||||
|
||||
class CV_EXPORTS CylindricalWarper : public RotationWarperBase<CylindricalProjector>
|
||||
{
|
||||
public:
|
||||
CylindricalWarper(float scale) { projector_.scale = scale; }
|
||||
|
||||
protected:
|
||||
void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br)
|
||||
{
|
||||
RotationWarperBase<CylindricalProjector>::detectResultRoiByBorder(src_size, dst_tl, dst_br);
|
||||
}
|
||||
};
|
||||
|
||||
.. seealso:: :ocv:class:`detail::RotationWarper`
|
||||
|
||||
detail::CylindricalWarper::CylindricalWarper
|
||||
--------------------------------------------
|
||||
|
||||
Construct an instance of the cylindrical warper class.
|
||||
|
||||
.. ocv:function:: void detail::CylindricalWarper::CylindricalWarper(float scale)
|
||||
|
||||
:param scale: Projected image scale multiplier
|
Reference in New Issue
Block a user