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_WARPER_CREATORS_HPP
RyoheiHagimoto 0:0e0631af0305 44 #define OPENCV_STITCHING_WARPER_CREATORS_HPP
RyoheiHagimoto 0:0e0631af0305 45
RyoheiHagimoto 0:0e0631af0305 46 #include "opencv2/stitching/detail/warpers.hpp"
RyoheiHagimoto 0:0e0631af0305 47
RyoheiHagimoto 0:0e0631af0305 48 namespace cv {
RyoheiHagimoto 0:0e0631af0305 49
RyoheiHagimoto 0:0e0631af0305 50 //! @addtogroup stitching_warp
RyoheiHagimoto 0:0e0631af0305 51 //! @{
RyoheiHagimoto 0:0e0631af0305 52
RyoheiHagimoto 0:0e0631af0305 53 /** @brief Image warper factories base class.
RyoheiHagimoto 0:0e0631af0305 54 */
RyoheiHagimoto 0:0e0631af0305 55 class WarperCreator
RyoheiHagimoto 0:0e0631af0305 56 {
RyoheiHagimoto 0:0e0631af0305 57 public:
RyoheiHagimoto 0:0e0631af0305 58 virtual ~WarperCreator() {}
RyoheiHagimoto 0:0e0631af0305 59 virtual Ptr<detail::RotationWarper> create(float scale) const = 0;
RyoheiHagimoto 0:0e0631af0305 60 };
RyoheiHagimoto 0:0e0631af0305 61
RyoheiHagimoto 0:0e0631af0305 62 /** @brief Plane warper factory class.
RyoheiHagimoto 0:0e0631af0305 63 @sa detail::PlaneWarper
RyoheiHagimoto 0:0e0631af0305 64 */
RyoheiHagimoto 0:0e0631af0305 65 class PlaneWarper : public WarperCreator
RyoheiHagimoto 0:0e0631af0305 66 {
RyoheiHagimoto 0:0e0631af0305 67 public:
RyoheiHagimoto 0:0e0631af0305 68 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::PlaneWarper>(scale); }
RyoheiHagimoto 0:0e0631af0305 69 };
RyoheiHagimoto 0:0e0631af0305 70
RyoheiHagimoto 0:0e0631af0305 71 /** @brief Affine warper factory class.
RyoheiHagimoto 0:0e0631af0305 72 @sa detail::AffineWarper
RyoheiHagimoto 0:0e0631af0305 73 */
RyoheiHagimoto 0:0e0631af0305 74 class AffineWarper : public WarperCreator
RyoheiHagimoto 0:0e0631af0305 75 {
RyoheiHagimoto 0:0e0631af0305 76 public:
RyoheiHagimoto 0:0e0631af0305 77 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::AffineWarper>(scale); }
RyoheiHagimoto 0:0e0631af0305 78 };
RyoheiHagimoto 0:0e0631af0305 79
RyoheiHagimoto 0:0e0631af0305 80 /** @brief Cylindrical warper factory class.
RyoheiHagimoto 0:0e0631af0305 81 @sa detail::CylindricalWarper
RyoheiHagimoto 0:0e0631af0305 82 */
RyoheiHagimoto 0:0e0631af0305 83 class CylindricalWarper: public WarperCreator
RyoheiHagimoto 0:0e0631af0305 84 {
RyoheiHagimoto 0:0e0631af0305 85 public:
RyoheiHagimoto 0:0e0631af0305 86 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::CylindricalWarper>(scale); }
RyoheiHagimoto 0:0e0631af0305 87 };
RyoheiHagimoto 0:0e0631af0305 88
RyoheiHagimoto 0:0e0631af0305 89 /** @brief Spherical warper factory class */
RyoheiHagimoto 0:0e0631af0305 90 class SphericalWarper: public WarperCreator
RyoheiHagimoto 0:0e0631af0305 91 {
RyoheiHagimoto 0:0e0631af0305 92 public:
RyoheiHagimoto 0:0e0631af0305 93 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::SphericalWarper>(scale); }
RyoheiHagimoto 0:0e0631af0305 94 };
RyoheiHagimoto 0:0e0631af0305 95
RyoheiHagimoto 0:0e0631af0305 96 class FisheyeWarper : public WarperCreator
RyoheiHagimoto 0:0e0631af0305 97 {
RyoheiHagimoto 0:0e0631af0305 98 public:
RyoheiHagimoto 0:0e0631af0305 99 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::FisheyeWarper>(scale); }
RyoheiHagimoto 0:0e0631af0305 100 };
RyoheiHagimoto 0:0e0631af0305 101
RyoheiHagimoto 0:0e0631af0305 102 class StereographicWarper: public WarperCreator
RyoheiHagimoto 0:0e0631af0305 103 {
RyoheiHagimoto 0:0e0631af0305 104 public:
RyoheiHagimoto 0:0e0631af0305 105 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::StereographicWarper>(scale); }
RyoheiHagimoto 0:0e0631af0305 106 };
RyoheiHagimoto 0:0e0631af0305 107
RyoheiHagimoto 0:0e0631af0305 108 class CompressedRectilinearWarper: public WarperCreator
RyoheiHagimoto 0:0e0631af0305 109 {
RyoheiHagimoto 0:0e0631af0305 110 float a, b;
RyoheiHagimoto 0:0e0631af0305 111 public:
RyoheiHagimoto 0:0e0631af0305 112 CompressedRectilinearWarper(float A = 1, float B = 1)
RyoheiHagimoto 0:0e0631af0305 113 {
RyoheiHagimoto 0:0e0631af0305 114 a = A; b = B;
RyoheiHagimoto 0:0e0631af0305 115 }
RyoheiHagimoto 0:0e0631af0305 116 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::CompressedRectilinearWarper>(scale, a, b); }
RyoheiHagimoto 0:0e0631af0305 117 };
RyoheiHagimoto 0:0e0631af0305 118
RyoheiHagimoto 0:0e0631af0305 119 class CompressedRectilinearPortraitWarper: public WarperCreator
RyoheiHagimoto 0:0e0631af0305 120 {
RyoheiHagimoto 0:0e0631af0305 121 float a, b;
RyoheiHagimoto 0:0e0631af0305 122 public:
RyoheiHagimoto 0:0e0631af0305 123 CompressedRectilinearPortraitWarper(float A = 1, float B = 1)
RyoheiHagimoto 0:0e0631af0305 124 {
RyoheiHagimoto 0:0e0631af0305 125 a = A; b = B;
RyoheiHagimoto 0:0e0631af0305 126 }
RyoheiHagimoto 0:0e0631af0305 127 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::CompressedRectilinearPortraitWarper>(scale, a, b); }
RyoheiHagimoto 0:0e0631af0305 128 };
RyoheiHagimoto 0:0e0631af0305 129
RyoheiHagimoto 0:0e0631af0305 130 class PaniniWarper: public WarperCreator
RyoheiHagimoto 0:0e0631af0305 131 {
RyoheiHagimoto 0:0e0631af0305 132 float a, b;
RyoheiHagimoto 0:0e0631af0305 133 public:
RyoheiHagimoto 0:0e0631af0305 134 PaniniWarper(float A = 1, float B = 1)
RyoheiHagimoto 0:0e0631af0305 135 {
RyoheiHagimoto 0:0e0631af0305 136 a = A; b = B;
RyoheiHagimoto 0:0e0631af0305 137 }
RyoheiHagimoto 0:0e0631af0305 138 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::PaniniWarper>(scale, a, b); }
RyoheiHagimoto 0:0e0631af0305 139 };
RyoheiHagimoto 0:0e0631af0305 140
RyoheiHagimoto 0:0e0631af0305 141 class PaniniPortraitWarper: public WarperCreator
RyoheiHagimoto 0:0e0631af0305 142 {
RyoheiHagimoto 0:0e0631af0305 143 float a, b;
RyoheiHagimoto 0:0e0631af0305 144 public:
RyoheiHagimoto 0:0e0631af0305 145 PaniniPortraitWarper(float A = 1, float B = 1)
RyoheiHagimoto 0:0e0631af0305 146 {
RyoheiHagimoto 0:0e0631af0305 147 a = A; b = B;
RyoheiHagimoto 0:0e0631af0305 148 }
RyoheiHagimoto 0:0e0631af0305 149 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::PaniniPortraitWarper>(scale, a, b); }
RyoheiHagimoto 0:0e0631af0305 150 };
RyoheiHagimoto 0:0e0631af0305 151
RyoheiHagimoto 0:0e0631af0305 152 class MercatorWarper: public WarperCreator
RyoheiHagimoto 0:0e0631af0305 153 {
RyoheiHagimoto 0:0e0631af0305 154 public:
RyoheiHagimoto 0:0e0631af0305 155 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::MercatorWarper>(scale); }
RyoheiHagimoto 0:0e0631af0305 156 };
RyoheiHagimoto 0:0e0631af0305 157
RyoheiHagimoto 0:0e0631af0305 158 class TransverseMercatorWarper: public WarperCreator
RyoheiHagimoto 0:0e0631af0305 159 {
RyoheiHagimoto 0:0e0631af0305 160 public:
RyoheiHagimoto 0:0e0631af0305 161 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::TransverseMercatorWarper>(scale); }
RyoheiHagimoto 0:0e0631af0305 162 };
RyoheiHagimoto 0:0e0631af0305 163
RyoheiHagimoto 0:0e0631af0305 164
RyoheiHagimoto 0:0e0631af0305 165
RyoheiHagimoto 0:0e0631af0305 166 #ifdef HAVE_OPENCV_CUDAWARPING
RyoheiHagimoto 0:0e0631af0305 167 class PlaneWarperGpu: public WarperCreator
RyoheiHagimoto 0:0e0631af0305 168 {
RyoheiHagimoto 0:0e0631af0305 169 public:
RyoheiHagimoto 0:0e0631af0305 170 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::PlaneWarperGpu>(scale); }
RyoheiHagimoto 0:0e0631af0305 171 };
RyoheiHagimoto 0:0e0631af0305 172
RyoheiHagimoto 0:0e0631af0305 173
RyoheiHagimoto 0:0e0631af0305 174 class CylindricalWarperGpu: public WarperCreator
RyoheiHagimoto 0:0e0631af0305 175 {
RyoheiHagimoto 0:0e0631af0305 176 public:
RyoheiHagimoto 0:0e0631af0305 177 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::CylindricalWarperGpu>(scale); }
RyoheiHagimoto 0:0e0631af0305 178 };
RyoheiHagimoto 0:0e0631af0305 179
RyoheiHagimoto 0:0e0631af0305 180
RyoheiHagimoto 0:0e0631af0305 181 class SphericalWarperGpu: public WarperCreator
RyoheiHagimoto 0:0e0631af0305 182 {
RyoheiHagimoto 0:0e0631af0305 183 public:
RyoheiHagimoto 0:0e0631af0305 184 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::SphericalWarperGpu>(scale); }
RyoheiHagimoto 0:0e0631af0305 185 };
RyoheiHagimoto 0:0e0631af0305 186 #endif
RyoheiHagimoto 0:0e0631af0305 187
RyoheiHagimoto 0:0e0631af0305 188 //! @} stitching_warp
RyoheiHagimoto 0:0e0631af0305 189
RyoheiHagimoto 0:0e0631af0305 190 } // namespace cv
RyoheiHagimoto 0:0e0631af0305 191
RyoheiHagimoto 0:0e0631af0305 192 #endif // OPENCV_STITCHING_WARPER_CREATORS_HPP