Skip to content

Commit 97dab3b

Browse files
committed
reg: enable wrapping of Map::compose()
1 parent 79edb0f commit 97dab3b

14 files changed

+21
-21
lines changed

modules/reg/include/opencv2/reg/map.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class CV_EXPORTS_W Map
158158
* The order is first the current transformation, then the input argument.
159159
* \param[in] map Transformation to compose with.
160160
*/
161-
virtual void compose(const Map& map) = 0;
161+
CV_WRAP virtual void compose(cv::Ptr<Map> map) = 0;
162162

163163
/*!
164164
* Scales the map by a given factor as if the coordinates system is expanded/compressed

modules/reg/include/opencv2/reg/mapaffine.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class CV_EXPORTS_W MapAffine : public Map
7373

7474
CV_WRAP cv::Ptr<Map> inverseMap() const;
7575

76-
void compose(const Map& map);
76+
CV_WRAP void compose(cv::Ptr<Map> map);
7777

7878
CV_WRAP void scale(double factor);
7979

modules/reg/include/opencv2/reg/mapprojec.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class CV_EXPORTS_W MapProjec : public Map
7373

7474
CV_WRAP cv::Ptr<Map> inverseMap() const;
7575

76-
void compose(const Map& map);
76+
CV_WRAP void compose(cv::Ptr<Map> map);
7777

7878
CV_WRAP void scale(double factor);
7979

modules/reg/include/opencv2/reg/mapshift.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class CV_EXPORTS_W MapShift : public Map
7373

7474
CV_WRAP cv::Ptr<Map> inverseMap() const;
7575

76-
void compose(const Map& map);
76+
CV_WRAP void compose(cv::Ptr<Map> map);
7777

7878
CV_WRAP void scale(double factor);
7979

modules/reg/src/mapaffine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ Ptr<Map> MapAffine::inverseMap(void) const
9494
}
9595

9696
////////////////////////////////////////////////////////////////////////////////////////////////////
97-
void MapAffine::compose(const Map& map)
97+
void MapAffine::compose(cv::Ptr<Map> map)
9898
{
9999
// Composition of affine transformations T and T' is (T o T') = A'Ax + A'b + b'
100-
const MapAffine& mapAff = static_cast<const MapAffine&>(map);
100+
const MapAffine& mapAff = static_cast<const MapAffine&>(*map);
101101
Matx<double, 2, 2> compMat = mapAff.getLinTr()*linTr_;
102102
Vec<double, 2> compShift = mapAff.getLinTr()*shift_ + mapAff.getShift();
103103
linTr_ = compMat;

modules/reg/src/mappergradaffine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void MapperGradAffine::calculate(InputArray _img1, InputArray image2, cv::Ptr<Ma
148148
if(res.empty()) {
149149
res = Ptr<Map>(new MapAffine(linTr, shift));
150150
} else {
151-
MapAffine newTr(linTr, shift);
151+
Ptr<MapAffine> newTr(new MapAffine(linTr, shift));
152152
res->compose(newTr);
153153
}
154154
}

modules/reg/src/mappergradeuclid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void MapperGradEuclid::calculate(
115115
if(res.empty()) {
116116
res = Ptr<Map>(new MapAffine(linTr, shift));
117117
} else {
118-
MapAffine newTr(linTr, shift);
118+
Ptr<MapAffine> newTr(new MapAffine(linTr, shift));
119119
res->compose(newTr);
120120
}
121121
}

modules/reg/src/mappergradproj.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ void MapperGradProj::calculate(
199199
if(res.empty()) {
200200
res = Ptr<Map>(new MapProjec(H));
201201
} else {
202-
MapProjec newTr(H);
202+
Ptr<MapProjec> newTr(new MapProjec(H));
203203
res->compose(newTr);
204204
}
205205
}

modules/reg/src/mappergradshift.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void MapperGradShift::calculate(
9696
if(res.empty()) {
9797
res = Ptr<Map>(new MapShift(shift));
9898
} else {
99-
MapShift newTr(shift);
99+
Ptr<MapShift> newTr(new MapShift(shift));
100100
res->compose(newTr);
101101
}
102102
}

modules/reg/src/mappergradsimilar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void MapperGradSimilar::calculate(
130130
if(res.empty()) {
131131
res = Ptr<Map>(new MapAffine(linTr, shift));
132132
} else {
133-
MapAffine newTr(linTr, shift);
133+
Ptr<MapAffine> newTr(new MapAffine(linTr, shift));
134134
res->compose(newTr);
135135
}
136136
}

0 commit comments

Comments
 (0)