include/opencv2/stitching/warpers.hpp
Go to the documentation of this file.
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 class WarperCreator
00051 {
00052 public:
00053     virtual ~WarperCreator() {}
00054     virtual Ptr<detail::RotationWarper> create(float scale) const = 0;
00055 };
00056 
00057 
00058 class PlaneWarper : public WarperCreator
00059 {
00060 public:
00061     Ptr<detail::RotationWarper> create(float scale) const { return new detail::PlaneWarper(scale); }
00062 };
00063 
00064 
00065 class CylindricalWarper: public WarperCreator
00066 {
00067 public:
00068     Ptr<detail::RotationWarper> create(float scale) const { return new detail::CylindricalWarper(scale); }
00069 };
00070 
00071 
00072 class SphericalWarper: public WarperCreator
00073 {
00074 public:
00075     Ptr<detail::RotationWarper> create(float scale) const { return new detail::SphericalWarper(scale); }
00076 };
00077 
00078 class FisheyeWarper : public WarperCreator
00079 {
00080 public:
00081     Ptr<detail::RotationWarper> create(float scale) const { return new detail::FisheyeWarper(scale); }
00082 };
00083 
00084 class StereographicWarper: public WarperCreator
00085 {
00086 public:
00087     Ptr<detail::RotationWarper> create(float scale) const { return new detail::StereographicWarper(scale); }
00088 };
00089 
00090 class CompressedRectilinearWarper: public WarperCreator
00091 {
00092     float a, b;
00093 public:
00094     CompressedRectilinearWarper(float A = 1, float B = 1)
00095     {
00096         a = A; b = B;
00097     }
00098     Ptr<detail::RotationWarper> create(float scale) const { return new detail::CompressedRectilinearWarper(scale, a, b); }
00099 };
00100 
00101 class CompressedRectilinearPortraitWarper: public WarperCreator
00102 {
00103     float a, b;
00104 public:
00105     CompressedRectilinearPortraitWarper(float A = 1, float B = 1)
00106     {
00107         a = A; b = B;
00108     }
00109     Ptr<detail::RotationWarper> create(float scale) const { return new detail::CompressedRectilinearPortraitWarper(scale, a, b); }
00110 };
00111 
00112 class PaniniWarper: public WarperCreator
00113 {
00114     float a, b;
00115 public:
00116     PaniniWarper(float A = 1, float B = 1)
00117     {
00118         a = A; b = B;
00119     }
00120     Ptr<detail::RotationWarper> create(float scale) const { return new detail::PaniniWarper(scale, a, b); }
00121 };
00122 
00123 class PaniniPortraitWarper: public WarperCreator
00124 {
00125     float a, b;
00126 public:
00127     PaniniPortraitWarper(float A = 1, float B = 1)
00128     {
00129         a = A; b = B;
00130     }
00131     Ptr<detail::RotationWarper> create(float scale) const { return new detail::PaniniPortraitWarper(scale, a, b); }
00132 };
00133 
00134 class MercatorWarper: public WarperCreator
00135 {
00136 public:
00137     Ptr<detail::RotationWarper> create(float scale) const { return new detail::MercatorWarper(scale); }
00138 };
00139 
00140 class TransverseMercatorWarper: public WarperCreator
00141 {
00142 public:
00143     Ptr<detail::RotationWarper> create(float scale) const { return new detail::TransverseMercatorWarper(scale); }
00144 };
00145 
00146 
00147 
00148 #ifdef HAVE_OPENCV_GPU
00149 class PlaneWarperGpu: public WarperCreator
00150 {
00151 public:
00152     Ptr<detail::RotationWarper> create(float scale) const { return new detail::PlaneWarperGpu(scale); }
00153 };
00154 
00155 
00156 class CylindricalWarperGpu: public WarperCreator
00157 {
00158 public:
00159     Ptr<detail::RotationWarper> create(float scale) const { return new detail::CylindricalWarperGpu(scale); }
00160 };
00161 
00162 
00163 class SphericalWarperGpu: public WarperCreator
00164 {
00165 public:
00166     Ptr<detail::RotationWarper> create(float scale) const { return new detail::SphericalWarperGpu(scale); }
00167 };
00168 #endif
00169 
00170 } // namespace cv
00171 
00172 #endif // __OPENCV_STITCHING_WARPER_CREATORS_HPP__