Joe Verbout / Mbed 2 deprecated main

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers warpers.hpp Source File

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 Cylindrical warper factory class.
00072 @sa detail::CylindricalWarper
00073 */
00074 class CylindricalWarper: public WarperCreator
00075 {
00076 public:
00077     Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::CylindricalWarper>(scale); }
00078 };
00079 
00080 /** @brief Spherical warper factory class */
00081 class SphericalWarper: public WarperCreator
00082 {
00083 public:
00084     Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::SphericalWarper>(scale); }
00085 };
00086 
00087 class FisheyeWarper : public WarperCreator
00088 {
00089 public:
00090     Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::FisheyeWarper>(scale); }
00091 };
00092 
00093 class StereographicWarper: public WarperCreator
00094 {
00095 public:
00096     Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::StereographicWarper>(scale); }
00097 };
00098 
00099 class CompressedRectilinearWarper: public WarperCreator
00100 {
00101     float a, b;
00102 public:
00103     CompressedRectilinearWarper(float A = 1, float B = 1)
00104     {
00105         a = A; b = B;
00106     }
00107     Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::CompressedRectilinearWarper>(scale, a, b); }
00108 };
00109 
00110 class CompressedRectilinearPortraitWarper: public WarperCreator
00111 {
00112     float a, b;
00113 public:
00114     CompressedRectilinearPortraitWarper(float A = 1, float B = 1)
00115     {
00116         a = A; b = B;
00117     }
00118     Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::CompressedRectilinearPortraitWarper>(scale, a, b); }
00119 };
00120 
00121 class PaniniWarper: public WarperCreator
00122 {
00123     float a, b;
00124 public:
00125     PaniniWarper(float A = 1, float B = 1)
00126     {
00127         a = A; b = B;
00128     }
00129     Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::PaniniWarper>(scale, a, b); }
00130 };
00131 
00132 class PaniniPortraitWarper: public WarperCreator
00133 {
00134     float a, b;
00135 public:
00136     PaniniPortraitWarper(float A = 1, float B = 1)
00137     {
00138         a = A; b = B;
00139     }
00140     Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::PaniniPortraitWarper>(scale, a, b); }
00141 };
00142 
00143 class MercatorWarper: public WarperCreator
00144 {
00145 public:
00146     Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::MercatorWarper>(scale); }
00147 };
00148 
00149 class TransverseMercatorWarper: public WarperCreator
00150 {
00151 public:
00152     Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::TransverseMercatorWarper>(scale); }
00153 };
00154 
00155 
00156 
00157 #ifdef HAVE_OPENCV_CUDAWARPING
00158 class PlaneWarperGpu: public WarperCreator
00159 {
00160 public:
00161     Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::PlaneWarperGpu>(scale); }
00162 };
00163 
00164 
00165 class CylindricalWarperGpu: public WarperCreator
00166 {
00167 public:
00168     Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::CylindricalWarperGpu>(scale); }
00169 };
00170 
00171 
00172 class SphericalWarperGpu: public WarperCreator
00173 {
00174 public:
00175     Ptr<detail::RotationWarper> create(float scale) const { return makePtr<detail::SphericalWarperGpu>(scale); }
00176 };
00177 #endif
00178 
00179 //! @} stitching_warp
00180 
00181 } // namespace cv
00182 
00183 #endif // __OPENCV_STITCHING_WARPER_CREATORS_HPP__
00184