warpers.hpp 5.23 KB
Newer Older
wester committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
/*M///////////////////////////////////////////////////////////////////////////////////////
//
//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
//  By downloading, copying, installing or using the software you agree to this license.
//  If you do not agree to this license, do not download, install,
//  copy or use the software.
//
//
//                          License Agreement
//                For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
//   * Redistribution's of source code must retain the above copyright notice,
//     this list of conditions and the following disclaimer.
//
//   * Redistribution's in binary form must reproduce the above copyright notice,
//     this list of conditions and the following disclaimer in the documentation
//     and/or other materials provided with the distribution.
//
//   * The name of the copyright holders may not be used to endorse or promote products
//     derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/

a  
Kai Westerkamp committed
43 44
#ifndef __OPENCV_STITCHING_WARPER_CREATORS_HPP__
#define __OPENCV_STITCHING_WARPER_CREATORS_HPP__
wester committed
45 46 47 48 49 50 51 52 53 54 55 56

#include "opencv2/stitching/detail/warpers.hpp"

namespace cv {

class WarperCreator
{
public:
    virtual ~WarperCreator() {}
    virtual Ptr<detail::RotationWarper> create(float scale) const = 0;
};

wester committed
57

wester committed
58 59 60
class PlaneWarper : public WarperCreator
{
public:
wester committed
61
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::PlaneWarper(scale); }
wester committed
62 63
};

wester committed
64

wester committed
65 66 67
class CylindricalWarper: public WarperCreator
{
public:
wester committed
68
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::CylindricalWarper(scale); }
wester committed
69 70
};

wester committed
71

wester committed
72 73 74
class SphericalWarper: public WarperCreator
{
public:
wester committed
75
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::SphericalWarper(scale); }
wester committed
76 77 78 79 80
};

class FisheyeWarper : public WarperCreator
{
public:
wester committed
81
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::FisheyeWarper(scale); }
wester committed
82 83 84 85 86
};

class StereographicWarper: public WarperCreator
{
public:
wester committed
87
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::StereographicWarper(scale); }
wester committed
88 89 90 91 92 93 94 95 96 97
};

class CompressedRectilinearWarper: public WarperCreator
{
    float a, b;
public:
    CompressedRectilinearWarper(float A = 1, float B = 1)
    {
        a = A; b = B;
    }
wester committed
98
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::CompressedRectilinearWarper(scale, a, b); }
wester committed
99 100 101 102 103 104 105 106 107 108
};

class CompressedRectilinearPortraitWarper: public WarperCreator
{
    float a, b;
public:
    CompressedRectilinearPortraitWarper(float A = 1, float B = 1)
    {
        a = A; b = B;
    }
wester committed
109
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::CompressedRectilinearPortraitWarper(scale, a, b); }
wester committed
110 111 112 113 114 115 116 117 118 119
};

class PaniniWarper: public WarperCreator
{
    float a, b;
public:
    PaniniWarper(float A = 1, float B = 1)
    {
        a = A; b = B;
    }
wester committed
120
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::PaniniWarper(scale, a, b); }
wester committed
121 122 123 124 125 126 127 128 129 130
};

class PaniniPortraitWarper: public WarperCreator
{
    float a, b;
public:
    PaniniPortraitWarper(float A = 1, float B = 1)
    {
        a = A; b = B;
    }
wester committed
131
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::PaniniPortraitWarper(scale, a, b); }
wester committed
132 133 134 135 136
};

class MercatorWarper: public WarperCreator
{
public:
wester committed
137
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::MercatorWarper(scale); }
wester committed
138 139 140 141 142
};

class TransverseMercatorWarper: public WarperCreator
{
public:
wester committed
143
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::TransverseMercatorWarper(scale); }
wester committed
144 145 146 147 148 149 150
};



class PlaneWarperGpu: public WarperCreator
{
public:
wester committed
151
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::PlaneWarperGpu(scale); }
wester committed
152 153 154 155 156 157
};


class CylindricalWarperGpu: public WarperCreator
{
public:
wester committed
158
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::CylindricalWarperGpu(scale); }
wester committed
159 160 161 162 163 164
};


class SphericalWarperGpu: public WarperCreator
{
public:
wester committed
165
    Ptr<detail::RotationWarper> create(float scale) const { return new detail::SphericalWarperGpu(scale); }
wester committed
166 167 168 169
};

} // namespace cv

a  
Kai Westerkamp committed
170
#endif // __OPENCV_STITCHING_WARPER_CREATORS_HPP__