@@ -65,11 +65,13 @@ class CV_EXPORTS RotationWarper
6565 virtual Point warp (const Mat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,
6666 Mat &dst) = 0;
6767
68- // TODO add other backward functions for consistency or move this into a separated interface
6968 virtual void warpBackward (const Mat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,
7069 Size dst_size, Mat &dst) = 0;
7170
7271 virtual Rect warpRoi (Size src_size, const Mat &K, const Mat &R) = 0;
72+
73+ virtual float getScale () const { return 1 .f ; }
74+ virtual void setScale (float ) {}
7375};
7476
7577
@@ -104,6 +106,9 @@ class CV_EXPORTS RotationWarperBase : public RotationWarper
104106
105107 Rect warpRoi (Size src_size, const Mat &K, const Mat &R);
106108
109+ float getScale () const { return projector_.scale ; }
110+ void setScale (float val) { projector_.scale = val; }
111+
107112protected:
108113
109114 // Detects ROI of the destination image. It's correct for any projection.
@@ -129,8 +134,6 @@ class CV_EXPORTS PlaneWarper : public RotationWarperBase<PlaneProjector>
129134public:
130135 PlaneWarper (float scale = 1 .f) { projector_.scale = scale; }
131136
132- void setScale (float scale) { projector_.scale = scale; }
133-
134137 Point2f warpPoint (const Point2f &pt, const Mat &K, const Mat &R, const Mat &T);
135138
136139 Rect buildMaps (Size src_size, const Mat &K, const Mat &R, const Mat &T, Mat &xmap, Mat &ymap);
@@ -225,12 +228,12 @@ struct CV_EXPORTS CompressedRectilinearProjector : ProjectorBase
225228class CV_EXPORTS CompressedRectilinearWarper : public RotationWarperBase<CompressedRectilinearProjector>
226229{
227230public:
228- CompressedRectilinearWarper (float scale, float A = 1 , float B = 1 )
229- {
230- projector_.a = A;
231- projector_.b = B;
232- projector_.scale = scale;
233- }
231+ CompressedRectilinearWarper (float scale, float A = 1 , float B = 1 )
232+ {
233+ projector_.a = A;
234+ projector_.b = B;
235+ projector_.scale = scale;
236+ }
234237};
235238
236239
@@ -250,7 +253,7 @@ class CV_EXPORTS CompressedRectilinearPortraitWarper : public RotationWarperBase
250253 {
251254 projector_.a = A;
252255 projector_.b = B;
253- projector_.scale = scale;
256+ projector_.scale = scale;
254257 }
255258};
256259
@@ -271,7 +274,7 @@ class CV_EXPORTS PaniniWarper : public RotationWarperBase<PaniniProjector>
271274 {
272275 projector_.a = A;
273276 projector_.b = B;
274- projector_.scale = scale;
277+ projector_.scale = scale;
275278 }
276279};
277280
@@ -292,7 +295,7 @@ class CV_EXPORTS PaniniPortraitWarper : public RotationWarperBase<PaniniPortrait
292295 {
293296 projector_.a = A;
294297 projector_.b = B;
295- projector_.scale = scale;
298+ projector_.scale = scale;
296299 }
297300
298301};
0 commit comments