Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: RZ_A2M_Mbed_samples
warpers.hpp
00001 /*M/////////////////////////////////////////////////////////////////////////////////////// 00002 // 00003 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 00004 // 00005 // By downloading, copying, installing or using the software you agree to this license. 00006 // If you do not agree to this license, do not download, install, 00007 // copy or use the software. 00008 // 00009 // 00010 // License Agreement 00011 // For Open Source Computer Vision Library 00012 // 00013 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 00014 // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 00015 // Third party copyrights are property of their respective owners. 00016 // 00017 // Redistribution and use in source and binary forms, with or without modification, 00018 // are permitted provided that the following conditions are met: 00019 // 00020 // * Redistribution's of source code must retain the above copyright notice, 00021 // this list of conditions and the following disclaimer. 00022 // 00023 // * Redistribution's in binary form must reproduce the above copyright notice, 00024 // this list of conditions and the following disclaimer in the documentation 00025 // and/or other materials provided with the distribution. 00026 // 00027 // * The name of the copyright holders may not be used to endorse or promote products 00028 // derived from this software without specific prior written permission. 00029 // 00030 // This software is provided by the copyright holders and contributors "as is" and 00031 // any express or implied warranties, including, but not limited to, the implied 00032 // warranties of merchantability and fitness for a particular purpose are disclaimed. 00033 // In no event shall the Intel Corporation or contributors be liable for any direct, 00034 // indirect, incidental, special, exemplary, or consequential damages 00035 // (including, but not limited to, procurement of substitute goods or services; 00036 // loss of use, data, or profits; or business interruption) however caused 00037 // and on any theory of liability, whether in contract, strict liability, 00038 // or tort (including negligence or otherwise) arising in any way out of 00039 // the use of this software, even if advised of the possibility of such damage. 00040 // 00041 //M*/ 00042 00043 #ifndef OPENCV_STITCHING_WARPER_CREATORS_HPP 00044 #define OPENCV_STITCHING_WARPER_CREATORS_HPP 00045 00046 #include "opencv2/stitching/detail/warpers.hpp" 00047 00048 namespace cv { 00049 00050 //! @addtogroup stitching_warp 00051 //! @{ 00052 00053 /** @brief Image warper factories base class. 00054 */ 00055 class WarperCreator 00056 { 00057 public: 00058 virtual ~WarperCreator() {} 00059 virtual Ptr<detail::RotationWarper> create(float scale) const = 0; 00060 }; 00061 00062 /** @brief Plane warper factory class. 00063 @sa detail::PlaneWarper 00064 */ 00065 class PlaneWarper : public WarperCreator 00066 { 00067 public: 00068 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::PlaneWarper>(scale); } 00069 }; 00070 00071 /** @brief Affine warper factory class. 00072 @sa detail::AffineWarper 00073 */ 00074 class AffineWarper : public WarperCreator 00075 { 00076 public: 00077 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::AffineWarper>(scale); } 00078 }; 00079 00080 /** @brief Cylindrical warper factory class. 00081 @sa detail::CylindricalWarper 00082 */ 00083 class CylindricalWarper: public WarperCreator 00084 { 00085 public: 00086 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::CylindricalWarper>(scale); } 00087 }; 00088 00089 /** @brief Spherical warper factory class */ 00090 class SphericalWarper: public WarperCreator 00091 { 00092 public: 00093 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::SphericalWarper>(scale); } 00094 }; 00095 00096 class FisheyeWarper : public WarperCreator 00097 { 00098 public: 00099 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::FisheyeWarper>(scale); } 00100 }; 00101 00102 class StereographicWarper: public WarperCreator 00103 { 00104 public: 00105 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::StereographicWarper>(scale); } 00106 }; 00107 00108 class CompressedRectilinearWarper: public WarperCreator 00109 { 00110 float a, b; 00111 public: 00112 CompressedRectilinearWarper(float A = 1, float B = 1) 00113 { 00114 a = A; b = B; 00115 } 00116 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::CompressedRectilinearWarper>(scale, a, b); } 00117 }; 00118 00119 class CompressedRectilinearPortraitWarper: public WarperCreator 00120 { 00121 float a, b; 00122 public: 00123 CompressedRectilinearPortraitWarper(float A = 1, float B = 1) 00124 { 00125 a = A; b = B; 00126 } 00127 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::CompressedRectilinearPortraitWarper>(scale, a, b); } 00128 }; 00129 00130 class PaniniWarper: public WarperCreator 00131 { 00132 float a, b; 00133 public: 00134 PaniniWarper(float A = 1, float B = 1) 00135 { 00136 a = A; b = B; 00137 } 00138 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::PaniniWarper>(scale, a, b); } 00139 }; 00140 00141 class PaniniPortraitWarper: public WarperCreator 00142 { 00143 float a, b; 00144 public: 00145 PaniniPortraitWarper(float A = 1, float B = 1) 00146 { 00147 a = A; b = B; 00148 } 00149 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::PaniniPortraitWarper>(scale, a, b); } 00150 }; 00151 00152 class MercatorWarper: public WarperCreator 00153 { 00154 public: 00155 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::MercatorWarper>(scale); } 00156 }; 00157 00158 class TransverseMercatorWarper: public WarperCreator 00159 { 00160 public: 00161 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::TransverseMercatorWarper>(scale); } 00162 }; 00163 00164 00165 00166 #ifdef HAVE_OPENCV_CUDAWARPING 00167 class PlaneWarperGpu: public WarperCreator 00168 { 00169 public: 00170 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::PlaneWarperGpu>(scale); } 00171 }; 00172 00173 00174 class CylindricalWarperGpu: public WarperCreator 00175 { 00176 public: 00177 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::CylindricalWarperGpu>(scale); } 00178 }; 00179 00180 00181 class SphericalWarperGpu: public WarperCreator 00182 { 00183 public: 00184 Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::SphericalWarperGpu>(scale); } 00185 }; 00186 #endif 00187 00188 //! @} stitching_warp 00189 00190 } // namespace cv 00191 00192 #endif // OPENCV_STITCHING_WARPER_CREATORS_HPP
Generated on Tue Jul 12 2022 18:20:20 by
