openCV library for Renesas RZ/A

Dependents:   RZ_A2M_Mbed_samples

Committer:
RyoheiHagimoto
Date:
Fri Jan 29 04:53:38 2021 +0000
Revision:
0:0e0631af0305
copied from https://github.com/d-kato/opencv-lib.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RyoheiHagimoto 0:0e0631af0305 1 /*M///////////////////////////////////////////////////////////////////////////////////////
RyoheiHagimoto 0:0e0631af0305 2 //
RyoheiHagimoto 0:0e0631af0305 3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
RyoheiHagimoto 0:0e0631af0305 4 //
RyoheiHagimoto 0:0e0631af0305 5 // By downloading, copying, installing or using the software you agree to this license.
RyoheiHagimoto 0:0e0631af0305 6 // If you do not agree to this license, do not download, install,
RyoheiHagimoto 0:0e0631af0305 7 // copy or use the software.
RyoheiHagimoto 0:0e0631af0305 8 //
RyoheiHagimoto 0:0e0631af0305 9 //
RyoheiHagimoto 0:0e0631af0305 10 // License Agreement
RyoheiHagimoto 0:0e0631af0305 11 // For Open Source Computer Vision Library
RyoheiHagimoto 0:0e0631af0305 12 //
RyoheiHagimoto 0:0e0631af0305 13 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
RyoheiHagimoto 0:0e0631af0305 14 // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
RyoheiHagimoto 0:0e0631af0305 15 // Third party copyrights are property of their respective owners.
RyoheiHagimoto 0:0e0631af0305 16 //
RyoheiHagimoto 0:0e0631af0305 17 // Redistribution and use in source and binary forms, with or without modification,
RyoheiHagimoto 0:0e0631af0305 18 // are permitted provided that the following conditions are met:
RyoheiHagimoto 0:0e0631af0305 19 //
RyoheiHagimoto 0:0e0631af0305 20 // * Redistribution's of source code must retain the above copyright notice,
RyoheiHagimoto 0:0e0631af0305 21 // this list of conditions and the following disclaimer.
RyoheiHagimoto 0:0e0631af0305 22 //
RyoheiHagimoto 0:0e0631af0305 23 // * Redistribution's in binary form must reproduce the above copyright notice,
RyoheiHagimoto 0:0e0631af0305 24 // this list of conditions and the following disclaimer in the documentation
RyoheiHagimoto 0:0e0631af0305 25 // and/or other materials provided with the distribution.
RyoheiHagimoto 0:0e0631af0305 26 //
RyoheiHagimoto 0:0e0631af0305 27 // * The name of the copyright holders may not be used to endorse or promote products
RyoheiHagimoto 0:0e0631af0305 28 // derived from this software without specific prior written permission.
RyoheiHagimoto 0:0e0631af0305 29 //
RyoheiHagimoto 0:0e0631af0305 30 // This software is provided by the copyright holders and contributors "as is" and
RyoheiHagimoto 0:0e0631af0305 31 // any express or implied warranties, including, but not limited to, the implied
RyoheiHagimoto 0:0e0631af0305 32 // warranties of merchantability and fitness for a particular purpose are disclaimed.
RyoheiHagimoto 0:0e0631af0305 33 // In no event shall the Intel Corporation or contributors be liable for any direct,
RyoheiHagimoto 0:0e0631af0305 34 // indirect, incidental, special, exemplary, or consequential damages
RyoheiHagimoto 0:0e0631af0305 35 // (including, but not limited to, procurement of substitute goods or services;
RyoheiHagimoto 0:0e0631af0305 36 // loss of use, data, or profits; or business interruption) however caused
RyoheiHagimoto 0:0e0631af0305 37 // and on any theory of liability, whether in contract, strict liability,
RyoheiHagimoto 0:0e0631af0305 38 // or tort (including negligence or otherwise) arising in any way out of
RyoheiHagimoto 0:0e0631af0305 39 // the use of this software, even if advised of the possibility of such damage.
RyoheiHagimoto 0:0e0631af0305 40 //
RyoheiHagimoto 0:0e0631af0305 41 //M*/
RyoheiHagimoto 0:0e0631af0305 42
RyoheiHagimoto 0:0e0631af0305 43 #ifndef OPENCV_STITCHING_STITCHER_HPP
RyoheiHagimoto 0:0e0631af0305 44 #define OPENCV_STITCHING_STITCHER_HPP
RyoheiHagimoto 0:0e0631af0305 45
RyoheiHagimoto 0:0e0631af0305 46 #include "opencv2/core.hpp"
RyoheiHagimoto 0:0e0631af0305 47 #include "opencv2/features2d.hpp"
RyoheiHagimoto 0:0e0631af0305 48 #include "opencv2/stitching/warpers.hpp"
RyoheiHagimoto 0:0e0631af0305 49 #include "opencv2/stitching/detail/matchers.hpp"
RyoheiHagimoto 0:0e0631af0305 50 #include "opencv2/stitching/detail/motion_estimators.hpp"
RyoheiHagimoto 0:0e0631af0305 51 #include "opencv2/stitching/detail/exposure_compensate.hpp"
RyoheiHagimoto 0:0e0631af0305 52 #include "opencv2/stitching/detail/seam_finders.hpp"
RyoheiHagimoto 0:0e0631af0305 53 #include "opencv2/stitching/detail/blenders.hpp"
RyoheiHagimoto 0:0e0631af0305 54 #include "opencv2/stitching/detail/camera.hpp"
RyoheiHagimoto 0:0e0631af0305 55
RyoheiHagimoto 0:0e0631af0305 56
RyoheiHagimoto 0:0e0631af0305 57 #if defined(Status)
RyoheiHagimoto 0:0e0631af0305 58 # warning Detected X11 'Status' macro definition, it can cause build conflicts. Please, include this header before any X11 headers.
RyoheiHagimoto 0:0e0631af0305 59 #endif
RyoheiHagimoto 0:0e0631af0305 60
RyoheiHagimoto 0:0e0631af0305 61
RyoheiHagimoto 0:0e0631af0305 62 /**
RyoheiHagimoto 0:0e0631af0305 63 @defgroup stitching Images stitching
RyoheiHagimoto 0:0e0631af0305 64
RyoheiHagimoto 0:0e0631af0305 65 This figure illustrates the stitching module pipeline implemented in the Stitcher class. Using that
RyoheiHagimoto 0:0e0631af0305 66 class it's possible to configure/remove some steps, i.e. adjust the stitching pipeline according to
RyoheiHagimoto 0:0e0631af0305 67 the particular needs. All building blocks from the pipeline are available in the detail namespace,
RyoheiHagimoto 0:0e0631af0305 68 one can combine and use them separately.
RyoheiHagimoto 0:0e0631af0305 69
RyoheiHagimoto 0:0e0631af0305 70 The implemented stitching pipeline is very similar to the one proposed in @cite BL07 .
RyoheiHagimoto 0:0e0631af0305 71
RyoheiHagimoto 0:0e0631af0305 72 ![stitching pipeline](StitchingPipeline.jpg)
RyoheiHagimoto 0:0e0631af0305 73
RyoheiHagimoto 0:0e0631af0305 74 Camera models
RyoheiHagimoto 0:0e0631af0305 75 -------------
RyoheiHagimoto 0:0e0631af0305 76
RyoheiHagimoto 0:0e0631af0305 77 There are currently 2 camera models implemented in stitching pipeline.
RyoheiHagimoto 0:0e0631af0305 78
RyoheiHagimoto 0:0e0631af0305 79 - _Homography model_ expecting perspective transformations between images
RyoheiHagimoto 0:0e0631af0305 80 implemented in @ref cv::detail::BestOf2NearestMatcher cv::detail::HomographyBasedEstimator
RyoheiHagimoto 0:0e0631af0305 81 cv::detail::BundleAdjusterReproj cv::detail::BundleAdjusterRay
RyoheiHagimoto 0:0e0631af0305 82 - _Affine model_ expecting affine transformation with 6 DOF or 4 DOF implemented in
RyoheiHagimoto 0:0e0631af0305 83 @ref cv::detail::AffineBestOf2NearestMatcher cv::detail::AffineBasedEstimator
RyoheiHagimoto 0:0e0631af0305 84 cv::detail::BundleAdjusterAffine cv::detail::BundleAdjusterAffinePartial cv::AffineWarper
RyoheiHagimoto 0:0e0631af0305 85
RyoheiHagimoto 0:0e0631af0305 86 Homography model is useful for creating photo panoramas captured by camera,
RyoheiHagimoto 0:0e0631af0305 87 while affine-based model can be used to stitch scans and object captured by
RyoheiHagimoto 0:0e0631af0305 88 specialized devices. Use @ref cv::Stitcher::create to get preconfigured pipeline for one
RyoheiHagimoto 0:0e0631af0305 89 of those models.
RyoheiHagimoto 0:0e0631af0305 90
RyoheiHagimoto 0:0e0631af0305 91 @note
RyoheiHagimoto 0:0e0631af0305 92 Certain detailed settings of @ref cv::Stitcher might not make sense. Especially
RyoheiHagimoto 0:0e0631af0305 93 you should not mix classes implementing affine model and classes implementing
RyoheiHagimoto 0:0e0631af0305 94 Homography model, as they work with different transformations.
RyoheiHagimoto 0:0e0631af0305 95
RyoheiHagimoto 0:0e0631af0305 96 @{
RyoheiHagimoto 0:0e0631af0305 97 @defgroup stitching_match Features Finding and Images Matching
RyoheiHagimoto 0:0e0631af0305 98 @defgroup stitching_rotation Rotation Estimation
RyoheiHagimoto 0:0e0631af0305 99 @defgroup stitching_autocalib Autocalibration
RyoheiHagimoto 0:0e0631af0305 100 @defgroup stitching_warp Images Warping
RyoheiHagimoto 0:0e0631af0305 101 @defgroup stitching_seam Seam Estimation
RyoheiHagimoto 0:0e0631af0305 102 @defgroup stitching_exposure Exposure Compensation
RyoheiHagimoto 0:0e0631af0305 103 @defgroup stitching_blend Image Blenders
RyoheiHagimoto 0:0e0631af0305 104 @}
RyoheiHagimoto 0:0e0631af0305 105 */
RyoheiHagimoto 0:0e0631af0305 106
RyoheiHagimoto 0:0e0631af0305 107 namespace cv {
RyoheiHagimoto 0:0e0631af0305 108
RyoheiHagimoto 0:0e0631af0305 109 //! @addtogroup stitching
RyoheiHagimoto 0:0e0631af0305 110 //! @{
RyoheiHagimoto 0:0e0631af0305 111
RyoheiHagimoto 0:0e0631af0305 112 /** @brief High level image stitcher.
RyoheiHagimoto 0:0e0631af0305 113
RyoheiHagimoto 0:0e0631af0305 114 It's possible to use this class without being aware of the entire stitching pipeline. However, to
RyoheiHagimoto 0:0e0631af0305 115 be able to achieve higher stitching stability and quality of the final images at least being
RyoheiHagimoto 0:0e0631af0305 116 familiar with the theory is recommended.
RyoheiHagimoto 0:0e0631af0305 117
RyoheiHagimoto 0:0e0631af0305 118 @note
RyoheiHagimoto 0:0e0631af0305 119 - A basic example on image stitching can be found at
RyoheiHagimoto 0:0e0631af0305 120 opencv_source_code/samples/cpp/stitching.cpp
RyoheiHagimoto 0:0e0631af0305 121 - A detailed example on image stitching can be found at
RyoheiHagimoto 0:0e0631af0305 122 opencv_source_code/samples/cpp/stitching_detailed.cpp
RyoheiHagimoto 0:0e0631af0305 123 */
RyoheiHagimoto 0:0e0631af0305 124 class CV_EXPORTS_W Stitcher
RyoheiHagimoto 0:0e0631af0305 125 {
RyoheiHagimoto 0:0e0631af0305 126 public:
RyoheiHagimoto 0:0e0631af0305 127 enum { ORIG_RESOL = -1 };
RyoheiHagimoto 0:0e0631af0305 128 enum Status
RyoheiHagimoto 0:0e0631af0305 129 {
RyoheiHagimoto 0:0e0631af0305 130 OK = 0,
RyoheiHagimoto 0:0e0631af0305 131 ERR_NEED_MORE_IMGS = 1,
RyoheiHagimoto 0:0e0631af0305 132 ERR_HOMOGRAPHY_EST_FAIL = 2,
RyoheiHagimoto 0:0e0631af0305 133 ERR_CAMERA_PARAMS_ADJUST_FAIL = 3
RyoheiHagimoto 0:0e0631af0305 134 };
RyoheiHagimoto 0:0e0631af0305 135 enum Mode
RyoheiHagimoto 0:0e0631af0305 136 {
RyoheiHagimoto 0:0e0631af0305 137 /** Mode for creating photo panoramas. Expects images under perspective
RyoheiHagimoto 0:0e0631af0305 138 transformation and projects resulting pano to sphere.
RyoheiHagimoto 0:0e0631af0305 139
RyoheiHagimoto 0:0e0631af0305 140 @sa detail::BestOf2NearestMatcher SphericalWarper
RyoheiHagimoto 0:0e0631af0305 141 */
RyoheiHagimoto 0:0e0631af0305 142 PANORAMA = 0,
RyoheiHagimoto 0:0e0631af0305 143 /** Mode for composing scans. Expects images under affine transformation does
RyoheiHagimoto 0:0e0631af0305 144 not compensate exposure by default.
RyoheiHagimoto 0:0e0631af0305 145
RyoheiHagimoto 0:0e0631af0305 146 @sa detail::AffineBestOf2NearestMatcher AffineWarper
RyoheiHagimoto 0:0e0631af0305 147 */
RyoheiHagimoto 0:0e0631af0305 148 SCANS = 1,
RyoheiHagimoto 0:0e0631af0305 149
RyoheiHagimoto 0:0e0631af0305 150 };
RyoheiHagimoto 0:0e0631af0305 151
RyoheiHagimoto 0:0e0631af0305 152 // Stitcher() {}
RyoheiHagimoto 0:0e0631af0305 153 /** @brief Creates a stitcher with the default parameters.
RyoheiHagimoto 0:0e0631af0305 154
RyoheiHagimoto 0:0e0631af0305 155 @param try_use_gpu Flag indicating whether GPU should be used whenever it's possible.
RyoheiHagimoto 0:0e0631af0305 156 @return Stitcher class instance.
RyoheiHagimoto 0:0e0631af0305 157 */
RyoheiHagimoto 0:0e0631af0305 158 static Stitcher createDefault(bool try_use_gpu = false);
RyoheiHagimoto 0:0e0631af0305 159 /** @brief Creates a Stitcher configured in one of the stitching modes.
RyoheiHagimoto 0:0e0631af0305 160
RyoheiHagimoto 0:0e0631af0305 161 @param mode Scenario for stitcher operation. This is usually determined by source of images
RyoheiHagimoto 0:0e0631af0305 162 to stitch and their transformation. Default parameters will be chosen for operation in given
RyoheiHagimoto 0:0e0631af0305 163 scenario.
RyoheiHagimoto 0:0e0631af0305 164 @param try_use_gpu Flag indicating whether GPU should be used whenever it's possible.
RyoheiHagimoto 0:0e0631af0305 165 @return Stitcher class instance.
RyoheiHagimoto 0:0e0631af0305 166 */
RyoheiHagimoto 0:0e0631af0305 167 static Ptr<Stitcher> create(Mode mode = PANORAMA, bool try_use_gpu = false);
RyoheiHagimoto 0:0e0631af0305 168
RyoheiHagimoto 0:0e0631af0305 169 CV_WRAP double registrationResol() const { return registr_resol_; }
RyoheiHagimoto 0:0e0631af0305 170 CV_WRAP void setRegistrationResol(double resol_mpx) { registr_resol_ = resol_mpx; }
RyoheiHagimoto 0:0e0631af0305 171
RyoheiHagimoto 0:0e0631af0305 172 CV_WRAP double seamEstimationResol() const { return seam_est_resol_; }
RyoheiHagimoto 0:0e0631af0305 173 CV_WRAP void setSeamEstimationResol(double resol_mpx) { seam_est_resol_ = resol_mpx; }
RyoheiHagimoto 0:0e0631af0305 174
RyoheiHagimoto 0:0e0631af0305 175 CV_WRAP double compositingResol() const { return compose_resol_; }
RyoheiHagimoto 0:0e0631af0305 176 CV_WRAP void setCompositingResol(double resol_mpx) { compose_resol_ = resol_mpx; }
RyoheiHagimoto 0:0e0631af0305 177
RyoheiHagimoto 0:0e0631af0305 178 CV_WRAP double panoConfidenceThresh() const { return conf_thresh_; }
RyoheiHagimoto 0:0e0631af0305 179 CV_WRAP void setPanoConfidenceThresh(double conf_thresh) { conf_thresh_ = conf_thresh; }
RyoheiHagimoto 0:0e0631af0305 180
RyoheiHagimoto 0:0e0631af0305 181 CV_WRAP bool waveCorrection() const { return do_wave_correct_; }
RyoheiHagimoto 0:0e0631af0305 182 CV_WRAP void setWaveCorrection(bool flag) { do_wave_correct_ = flag; }
RyoheiHagimoto 0:0e0631af0305 183
RyoheiHagimoto 0:0e0631af0305 184 detail::WaveCorrectKind waveCorrectKind() const { return wave_correct_kind_; }
RyoheiHagimoto 0:0e0631af0305 185 void setWaveCorrectKind(detail::WaveCorrectKind kind) { wave_correct_kind_ = kind; }
RyoheiHagimoto 0:0e0631af0305 186
RyoheiHagimoto 0:0e0631af0305 187 Ptr<detail::FeaturesFinder> featuresFinder() { return features_finder_; }
RyoheiHagimoto 0:0e0631af0305 188 const Ptr<detail::FeaturesFinder> featuresFinder() const { return features_finder_; }
RyoheiHagimoto 0:0e0631af0305 189 void setFeaturesFinder(Ptr<detail::FeaturesFinder> features_finder)
RyoheiHagimoto 0:0e0631af0305 190 { features_finder_ = features_finder; }
RyoheiHagimoto 0:0e0631af0305 191
RyoheiHagimoto 0:0e0631af0305 192 Ptr<detail::FeaturesMatcher> featuresMatcher() { return features_matcher_; }
RyoheiHagimoto 0:0e0631af0305 193 const Ptr<detail::FeaturesMatcher> featuresMatcher() const { return features_matcher_; }
RyoheiHagimoto 0:0e0631af0305 194 void setFeaturesMatcher(Ptr<detail::FeaturesMatcher> features_matcher)
RyoheiHagimoto 0:0e0631af0305 195 { features_matcher_ = features_matcher; }
RyoheiHagimoto 0:0e0631af0305 196
RyoheiHagimoto 0:0e0631af0305 197 const cv::UMat& matchingMask() const { return matching_mask_; }
RyoheiHagimoto 0:0e0631af0305 198 void setMatchingMask(const cv::UMat &mask)
RyoheiHagimoto 0:0e0631af0305 199 {
RyoheiHagimoto 0:0e0631af0305 200 CV_Assert(mask.type() == CV_8U && mask.cols == mask.rows);
RyoheiHagimoto 0:0e0631af0305 201 matching_mask_ = mask.clone();
RyoheiHagimoto 0:0e0631af0305 202 }
RyoheiHagimoto 0:0e0631af0305 203
RyoheiHagimoto 0:0e0631af0305 204 Ptr<detail::BundleAdjusterBase> bundleAdjuster() { return bundle_adjuster_; }
RyoheiHagimoto 0:0e0631af0305 205 const Ptr<detail::BundleAdjusterBase> bundleAdjuster() const { return bundle_adjuster_; }
RyoheiHagimoto 0:0e0631af0305 206 void setBundleAdjuster(Ptr<detail::BundleAdjusterBase> bundle_adjuster)
RyoheiHagimoto 0:0e0631af0305 207 { bundle_adjuster_ = bundle_adjuster; }
RyoheiHagimoto 0:0e0631af0305 208
RyoheiHagimoto 0:0e0631af0305 209 /* TODO OpenCV ABI 4.x
RyoheiHagimoto 0:0e0631af0305 210 Ptr<detail::Estimator> estimator() { return estimator_; }
RyoheiHagimoto 0:0e0631af0305 211 const Ptr<detail::Estimator> estimator() const { return estimator_; }
RyoheiHagimoto 0:0e0631af0305 212 void setEstimator(Ptr<detail::Estimator> estimator)
RyoheiHagimoto 0:0e0631af0305 213 { estimator_ = estimator; }
RyoheiHagimoto 0:0e0631af0305 214 */
RyoheiHagimoto 0:0e0631af0305 215
RyoheiHagimoto 0:0e0631af0305 216 Ptr<WarperCreator> warper() { return warper_; }
RyoheiHagimoto 0:0e0631af0305 217 const Ptr<WarperCreator> warper() const { return warper_; }
RyoheiHagimoto 0:0e0631af0305 218 void setWarper(Ptr<WarperCreator> creator) { warper_ = creator; }
RyoheiHagimoto 0:0e0631af0305 219
RyoheiHagimoto 0:0e0631af0305 220 Ptr<detail::ExposureCompensator> exposureCompensator() { return exposure_comp_; }
RyoheiHagimoto 0:0e0631af0305 221 const Ptr<detail::ExposureCompensator> exposureCompensator() const { return exposure_comp_; }
RyoheiHagimoto 0:0e0631af0305 222 void setExposureCompensator(Ptr<detail::ExposureCompensator> exposure_comp)
RyoheiHagimoto 0:0e0631af0305 223 { exposure_comp_ = exposure_comp; }
RyoheiHagimoto 0:0e0631af0305 224
RyoheiHagimoto 0:0e0631af0305 225 Ptr<detail::SeamFinder> seamFinder() { return seam_finder_; }
RyoheiHagimoto 0:0e0631af0305 226 const Ptr<detail::SeamFinder> seamFinder() const { return seam_finder_; }
RyoheiHagimoto 0:0e0631af0305 227 void setSeamFinder(Ptr<detail::SeamFinder> seam_finder) { seam_finder_ = seam_finder; }
RyoheiHagimoto 0:0e0631af0305 228
RyoheiHagimoto 0:0e0631af0305 229 Ptr<detail::Blender> blender() { return blender_; }
RyoheiHagimoto 0:0e0631af0305 230 const Ptr<detail::Blender> blender() const { return blender_; }
RyoheiHagimoto 0:0e0631af0305 231 void setBlender(Ptr<detail::Blender> b) { blender_ = b; }
RyoheiHagimoto 0:0e0631af0305 232
RyoheiHagimoto 0:0e0631af0305 233 /** @overload */
RyoheiHagimoto 0:0e0631af0305 234 CV_WRAP Status estimateTransform(InputArrayOfArrays images);
RyoheiHagimoto 0:0e0631af0305 235 /** @brief These functions try to match the given images and to estimate rotations of each camera.
RyoheiHagimoto 0:0e0631af0305 236
RyoheiHagimoto 0:0e0631af0305 237 @note Use the functions only if you're aware of the stitching pipeline, otherwise use
RyoheiHagimoto 0:0e0631af0305 238 Stitcher::stitch.
RyoheiHagimoto 0:0e0631af0305 239
RyoheiHagimoto 0:0e0631af0305 240 @param images Input images.
RyoheiHagimoto 0:0e0631af0305 241 @param rois Region of interest rectangles.
RyoheiHagimoto 0:0e0631af0305 242 @return Status code.
RyoheiHagimoto 0:0e0631af0305 243 */
RyoheiHagimoto 0:0e0631af0305 244 Status estimateTransform(InputArrayOfArrays images, const std::vector<std::vector<Rect> > &rois);
RyoheiHagimoto 0:0e0631af0305 245
RyoheiHagimoto 0:0e0631af0305 246 /** @overload */
RyoheiHagimoto 0:0e0631af0305 247 CV_WRAP Status composePanorama(OutputArray pano);
RyoheiHagimoto 0:0e0631af0305 248 /** @brief These functions try to compose the given images (or images stored internally from the other function
RyoheiHagimoto 0:0e0631af0305 249 calls) into the final pano under the assumption that the image transformations were estimated
RyoheiHagimoto 0:0e0631af0305 250 before.
RyoheiHagimoto 0:0e0631af0305 251
RyoheiHagimoto 0:0e0631af0305 252 @note Use the functions only if you're aware of the stitching pipeline, otherwise use
RyoheiHagimoto 0:0e0631af0305 253 Stitcher::stitch.
RyoheiHagimoto 0:0e0631af0305 254
RyoheiHagimoto 0:0e0631af0305 255 @param images Input images.
RyoheiHagimoto 0:0e0631af0305 256 @param pano Final pano.
RyoheiHagimoto 0:0e0631af0305 257 @return Status code.
RyoheiHagimoto 0:0e0631af0305 258 */
RyoheiHagimoto 0:0e0631af0305 259 Status composePanorama(InputArrayOfArrays images, OutputArray pano);
RyoheiHagimoto 0:0e0631af0305 260
RyoheiHagimoto 0:0e0631af0305 261 /** @overload */
RyoheiHagimoto 0:0e0631af0305 262 CV_WRAP Status stitch(InputArrayOfArrays images, OutputArray pano);
RyoheiHagimoto 0:0e0631af0305 263 /** @brief These functions try to stitch the given images.
RyoheiHagimoto 0:0e0631af0305 264
RyoheiHagimoto 0:0e0631af0305 265 @param images Input images.
RyoheiHagimoto 0:0e0631af0305 266 @param rois Region of interest rectangles.
RyoheiHagimoto 0:0e0631af0305 267 @param pano Final pano.
RyoheiHagimoto 0:0e0631af0305 268 @return Status code.
RyoheiHagimoto 0:0e0631af0305 269 */
RyoheiHagimoto 0:0e0631af0305 270 Status stitch(InputArrayOfArrays images, const std::vector<std::vector<Rect> > &rois, OutputArray pano);
RyoheiHagimoto 0:0e0631af0305 271
RyoheiHagimoto 0:0e0631af0305 272 std::vector<int> component() const { return indices_; }
RyoheiHagimoto 0:0e0631af0305 273 std::vector<detail::CameraParams> cameras() const { return cameras_; }
RyoheiHagimoto 0:0e0631af0305 274 CV_WRAP double workScale() const { return work_scale_; }
RyoheiHagimoto 0:0e0631af0305 275
RyoheiHagimoto 0:0e0631af0305 276 private:
RyoheiHagimoto 0:0e0631af0305 277 //Stitcher() {}
RyoheiHagimoto 0:0e0631af0305 278
RyoheiHagimoto 0:0e0631af0305 279 Status matchImages();
RyoheiHagimoto 0:0e0631af0305 280 Status estimateCameraParams();
RyoheiHagimoto 0:0e0631af0305 281
RyoheiHagimoto 0:0e0631af0305 282 double registr_resol_;
RyoheiHagimoto 0:0e0631af0305 283 double seam_est_resol_;
RyoheiHagimoto 0:0e0631af0305 284 double compose_resol_;
RyoheiHagimoto 0:0e0631af0305 285 double conf_thresh_;
RyoheiHagimoto 0:0e0631af0305 286 Ptr<detail::FeaturesFinder> features_finder_;
RyoheiHagimoto 0:0e0631af0305 287 Ptr<detail::FeaturesMatcher> features_matcher_;
RyoheiHagimoto 0:0e0631af0305 288 cv::UMat matching_mask_;
RyoheiHagimoto 0:0e0631af0305 289 Ptr<detail::BundleAdjusterBase> bundle_adjuster_;
RyoheiHagimoto 0:0e0631af0305 290 /* TODO OpenCV ABI 4.x
RyoheiHagimoto 0:0e0631af0305 291 Ptr<detail::Estimator> estimator_;
RyoheiHagimoto 0:0e0631af0305 292 */
RyoheiHagimoto 0:0e0631af0305 293 bool do_wave_correct_;
RyoheiHagimoto 0:0e0631af0305 294 detail::WaveCorrectKind wave_correct_kind_;
RyoheiHagimoto 0:0e0631af0305 295 Ptr<WarperCreator> warper_;
RyoheiHagimoto 0:0e0631af0305 296 Ptr<detail::ExposureCompensator> exposure_comp_;
RyoheiHagimoto 0:0e0631af0305 297 Ptr<detail::SeamFinder> seam_finder_;
RyoheiHagimoto 0:0e0631af0305 298 Ptr<detail::Blender> blender_;
RyoheiHagimoto 0:0e0631af0305 299
RyoheiHagimoto 0:0e0631af0305 300 std::vector<cv::UMat> imgs_;
RyoheiHagimoto 0:0e0631af0305 301 std::vector<std::vector<cv::Rect> > rois_;
RyoheiHagimoto 0:0e0631af0305 302 std::vector<cv::Size> full_img_sizes_;
RyoheiHagimoto 0:0e0631af0305 303 std::vector<detail::ImageFeatures> features_;
RyoheiHagimoto 0:0e0631af0305 304 std::vector<detail::MatchesInfo> pairwise_matches_;
RyoheiHagimoto 0:0e0631af0305 305 std::vector<cv::UMat> seam_est_imgs_;
RyoheiHagimoto 0:0e0631af0305 306 std::vector<int> indices_;
RyoheiHagimoto 0:0e0631af0305 307 std::vector<detail::CameraParams> cameras_;
RyoheiHagimoto 0:0e0631af0305 308 double work_scale_;
RyoheiHagimoto 0:0e0631af0305 309 double seam_scale_;
RyoheiHagimoto 0:0e0631af0305 310 double seam_work_aspect_;
RyoheiHagimoto 0:0e0631af0305 311 double warped_image_scale_;
RyoheiHagimoto 0:0e0631af0305 312 };
RyoheiHagimoto 0:0e0631af0305 313
RyoheiHagimoto 0:0e0631af0305 314 CV_EXPORTS_W Ptr<Stitcher> createStitcher(bool try_use_gpu = false);
RyoheiHagimoto 0:0e0631af0305 315
RyoheiHagimoto 0:0e0631af0305 316 //! @} stitching
RyoheiHagimoto 0:0e0631af0305 317
RyoheiHagimoto 0:0e0631af0305 318 } // namespace cv
RyoheiHagimoto 0:0e0631af0305 319
RyoheiHagimoto 0:0e0631af0305 320 #endif // OPENCV_STITCHING_STITCHER_HPP