Commit 51464723 authored by Vladislav Sovrasov's avatar Vladislav Sovrasov

reg: enable wrapping for all significant methods

parent 97dab3b5
...@@ -85,6 +85,10 @@ public: ...@@ -85,6 +85,10 @@ public:
return linTr_; return linTr_;
} }
CV_WRAP void getLinTr(OutputArray linTr) const {
Mat(linTr_).copyTo(linTr);
}
/*! /*!
* Return displacement part of the affine transformation * Return displacement part of the affine transformation
* \return Displacement part of the affine transformation * \return Displacement part of the affine transformation
...@@ -93,6 +97,10 @@ public: ...@@ -93,6 +97,10 @@ public:
return shift_; return shift_;
} }
CV_WRAP void getShift(OutputArray shift) const {
Mat(shift_).copyTo(shift);
}
private: private:
cv::Matx<double, 2, 2> linTr_; cv::Matx<double, 2, 2> linTr_;
cv::Vec<double, 2> shift_; cv::Vec<double, 2> shift_;
......
...@@ -63,7 +63,7 @@ public: ...@@ -63,7 +63,7 @@ public:
* \param[in,out] res Map from img1 to img2, stored in a smart pointer. If present as input, * \param[in,out] res Map from img1 to img2, stored in a smart pointer. If present as input,
* it is an initial rough estimation that the mapper will try to refine. * it is an initial rough estimation that the mapper will try to refine.
*/ */
virtual void calculate(InputArray img1, InputArray img2, cv::Ptr<Map>& res) const = 0; CV_WRAP virtual cv::Ptr<Map> calculate(InputArray img1, InputArray img2, cv::Ptr<Map> init = cv::Ptr<Map>()) const = 0;
/* /*
* Returns a map compatible with the Mapper class * Returns a map compatible with the Mapper class
......
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
CV_WRAP MapperGradAffine(); CV_WRAP MapperGradAffine();
~MapperGradAffine(void); ~MapperGradAffine(void);
virtual void calculate(InputArray img1, InputArray img2, cv::Ptr<Map>& res) const; CV_WRAP virtual cv::Ptr<Map> calculate(InputArray img1, InputArray img2, cv::Ptr<Map> init = cv::Ptr<Map>()) const;
CV_WRAP cv::Ptr<Map> getMap() const; CV_WRAP cv::Ptr<Map> getMap() const;
}; };
......
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
CV_WRAP MapperGradEuclid(); CV_WRAP MapperGradEuclid();
~MapperGradEuclid(); ~MapperGradEuclid();
virtual void calculate(InputArray img1, InputArray img2, cv::Ptr<Map>& res) const; CV_WRAP virtual cv::Ptr<Map> calculate(InputArray img1, InputArray img2, cv::Ptr<Map> init = cv::Ptr<Map>()) const;
CV_WRAP cv::Ptr<Map> getMap() const; CV_WRAP cv::Ptr<Map> getMap() const;
}; };
......
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
CV_WRAP MapperGradProj(); CV_WRAP MapperGradProj();
~MapperGradProj(); ~MapperGradProj();
virtual void calculate(InputArray img1, InputArray img2, cv::Ptr<Map>& res) const; CV_WRAP virtual cv::Ptr<Map> calculate(InputArray img1, InputArray img2, cv::Ptr<Map> init = cv::Ptr<Map>()) const;
CV_WRAP cv::Ptr<Map> getMap() const; CV_WRAP cv::Ptr<Map> getMap() const;
}; };
......
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
CV_WRAP MapperGradShift(); CV_WRAP MapperGradShift();
virtual ~MapperGradShift(); virtual ~MapperGradShift();
virtual void calculate(InputArray img1, InputArray img2, cv::Ptr<Map>& res) const; CV_WRAP virtual cv::Ptr<Map> calculate(InputArray img1, InputArray img2, cv::Ptr<Map> init = cv::Ptr<Map>()) const;
CV_WRAP cv::Ptr<Map> getMap() const; CV_WRAP cv::Ptr<Map> getMap() const;
}; };
......
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
CV_WRAP MapperGradSimilar(); CV_WRAP MapperGradSimilar();
~MapperGradSimilar(); ~MapperGradSimilar();
virtual void calculate(InputArray img1, InputArray img2, cv::Ptr<Map>& res) const; CV_WRAP virtual cv::Ptr<Map> calculate(InputArray img1, InputArray img2, cv::Ptr<Map> init = cv::Ptr<Map>()) const;
CV_WRAP cv::Ptr<Map> getMap() const; CV_WRAP cv::Ptr<Map> getMap() const;
}; };
......
...@@ -57,9 +57,9 @@ public: ...@@ -57,9 +57,9 @@ public:
* Constructor * Constructor
* \param[in] baseMapper Base mapper used for the refinements * \param[in] baseMapper Base mapper used for the refinements
*/ */
MapperPyramid(const Mapper& baseMapper); CV_WRAP MapperPyramid(Ptr<Mapper> baseMapper);
void calculate(InputArray img1, InputArray img2, cv::Ptr<Map>& res) const; CV_WRAP virtual cv::Ptr<Map> calculate(InputArray img1, InputArray img2, cv::Ptr<Map> init = cv::Ptr<Map>()) const;
CV_WRAP cv::Ptr<Map> getMap() const; CV_WRAP cv::Ptr<Map> getMap() const;
......
...@@ -85,10 +85,14 @@ public: ...@@ -85,10 +85,14 @@ public:
return projTr_; return projTr_;
} }
CV_WRAP void getProjTr(OutputArray projTr) const {
Mat(projTr_).copyTo(projTr);
}
/*! /*!
* Normalizes object's homography * Normalizes object's homography
*/ */
void normalize(void) { CV_WRAP void normalize() {
double z = 1./projTr_(2, 2); double z = 1./projTr_(2, 2);
for(size_t v_i = 0; v_i < sizeof(projTr_.val)/sizeof(projTr_.val[0]); ++v_i) for(size_t v_i = 0; v_i < sizeof(projTr_.val)/sizeof(projTr_.val[0]); ++v_i)
projTr_.val[v_i] *= z; projTr_.val[v_i] *= z;
......
...@@ -85,6 +85,10 @@ public: ...@@ -85,6 +85,10 @@ public:
return shift_; return shift_;
} }
CV_WRAP void getShift(OutputArray shift) const {
Mat(shift_).copyTo(shift);
}
private: private:
cv::Vec<double, 2> shift_; /*< Displacement */ cv::Vec<double, 2> shift_; /*< Displacement */
}; };
......
...@@ -56,7 +56,7 @@ MapperGradAffine::~MapperGradAffine() ...@@ -56,7 +56,7 @@ MapperGradAffine::~MapperGradAffine()
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
void MapperGradAffine::calculate(InputArray _img1, InputArray image2, cv::Ptr<Map>& res) const cv::Ptr<Map> MapperGradAffine::calculate(InputArray _img1, InputArray image2, cv::Ptr<Map> init) const
{ {
Mat img1 = _img1.getMat(); Mat img1 = _img1.getMat();
Mat gradx, grady, imgDiff; Mat gradx, grady, imgDiff;
...@@ -66,9 +66,9 @@ void MapperGradAffine::calculate(InputArray _img1, InputArray image2, cv::Ptr<Ma ...@@ -66,9 +66,9 @@ void MapperGradAffine::calculate(InputArray _img1, InputArray image2, cv::Ptr<Ma
CV_DbgAssert(img1.channels() == image2.channels()); CV_DbgAssert(img1.channels() == image2.channels());
CV_DbgAssert(img1.channels() == 1 || img1.channels() == 3); CV_DbgAssert(img1.channels() == 1 || img1.channels() == 3);
if(!res.empty()) { if(!init.empty()) {
// We have initial values for the registration: we move img2 to that initial reference // We have initial values for the registration: we move img2 to that initial reference
res->inverseWarp(image2, img2); init->inverseWarp(image2, img2);
} else { } else {
img2 = image2.getMat(); img2 = image2.getMat();
} }
...@@ -145,11 +145,14 @@ void MapperGradAffine::calculate(InputArray _img1, InputArray image2, cv::Ptr<Ma ...@@ -145,11 +145,14 @@ void MapperGradAffine::calculate(InputArray _img1, InputArray image2, cv::Ptr<Ma
Matx<double, 2, 2> linTr(k(0) + 1., k(1), k(3), k(4) + 1.); Matx<double, 2, 2> linTr(k(0) + 1., k(1), k(3), k(4) + 1.);
Vec<double, 2> shift(k(2), k(5)); Vec<double, 2> shift(k(2), k(5));
if(res.empty()) { if(init.empty()) {
res = Ptr<Map>(new MapAffine(linTr, shift)); return Ptr<Map>(new MapAffine(linTr, shift));
} else { } else {
Ptr<MapAffine> newTr(new MapAffine(linTr, shift)); Ptr<MapAffine> newTr(new MapAffine(linTr, shift));
res->compose(newTr); MapAffine* initPtr = dynamic_cast<MapAffine*>(init.get());
Ptr<MapAffine> oldTr(new MapAffine(initPtr->getLinTr(), initPtr->getShift()));
oldTr->compose(newTr);
return oldTr;
} }
} }
......
...@@ -56,8 +56,8 @@ MapperGradEuclid::~MapperGradEuclid() ...@@ -56,8 +56,8 @@ MapperGradEuclid::~MapperGradEuclid()
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
void MapperGradEuclid::calculate( cv::Ptr<Map> MapperGradEuclid::calculate(
InputArray _img1, InputArray image2, cv::Ptr<Map>& res) const InputArray _img1, InputArray image2, cv::Ptr<Map> init) const
{ {
Mat img1 = _img1.getMat(); Mat img1 = _img1.getMat();
Mat gradx, grady, imgDiff; Mat gradx, grady, imgDiff;
...@@ -67,9 +67,9 @@ void MapperGradEuclid::calculate( ...@@ -67,9 +67,9 @@ void MapperGradEuclid::calculate(
CV_DbgAssert(img1.channels() == image2.channels()); CV_DbgAssert(img1.channels() == image2.channels());
CV_DbgAssert(img1.channels() == 1 || img1.channels() == 3); CV_DbgAssert(img1.channels() == 1 || img1.channels() == 3);
if(!res.empty()) { if(!init.empty()) {
// We have initial values for the registration: we move img2 to that initial reference // We have initial values for the registration: we move img2 to that initial reference
res->inverseWarp(image2, img2); init->inverseWarp(image2, img2);
} else { } else {
img2 = image2.getMat(); img2 = image2.getMat();
} }
...@@ -112,11 +112,14 @@ void MapperGradEuclid::calculate( ...@@ -112,11 +112,14 @@ void MapperGradEuclid::calculate(
Matx<double, 2, 2> linTr(cosT, -sinT, sinT, cosT); Matx<double, 2, 2> linTr(cosT, -sinT, sinT, cosT);
Vec<double, 2> shift(k(0), k(1)); Vec<double, 2> shift(k(0), k(1));
if(res.empty()) { if(init.empty()) {
res = Ptr<Map>(new MapAffine(linTr, shift)); return Ptr<Map>(new MapAffine(linTr, shift));
} else { } else {
Ptr<MapAffine> newTr(new MapAffine(linTr, shift)); Ptr<MapAffine> newTr(new MapAffine(linTr, shift));
res->compose(newTr); MapAffine* initPtr = dynamic_cast<MapAffine*>(init.get());
Ptr<MapAffine> oldTr(new MapAffine(initPtr->getLinTr(), initPtr->getShift()));
oldTr->compose(newTr);
return oldTr;
} }
} }
......
...@@ -56,8 +56,8 @@ MapperGradProj::~MapperGradProj() ...@@ -56,8 +56,8 @@ MapperGradProj::~MapperGradProj()
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
void MapperGradProj::calculate( cv::Ptr<Map> MapperGradProj::calculate(
InputArray _img1, InputArray image2, cv::Ptr<Map>& res) const InputArray _img1, InputArray image2, cv::Ptr<Map> init) const
{ {
Mat img1 = _img1.getMat(); Mat img1 = _img1.getMat();
Mat gradx, grady, imgDiff; Mat gradx, grady, imgDiff;
...@@ -67,9 +67,9 @@ void MapperGradProj::calculate( ...@@ -67,9 +67,9 @@ void MapperGradProj::calculate(
CV_DbgAssert(img1.channels() == image2.channels()); CV_DbgAssert(img1.channels() == image2.channels());
CV_DbgAssert(img1.channels() == 1 || img1.channels() == 3); CV_DbgAssert(img1.channels() == 1 || img1.channels() == 3);
if(!res.empty()) { if(!init.empty()) {
// We have initial values for the registration: we move img2 to that initial reference // We have initial values for the registration: we move img2 to that initial reference
res->inverseWarp(image2, img2); init->inverseWarp(image2, img2);
} else { } else {
img2 = image2.getMat(); img2 = image2.getMat();
} }
...@@ -196,11 +196,14 @@ void MapperGradProj::calculate( ...@@ -196,11 +196,14 @@ void MapperGradProj::calculate(
Vec<double, 8> k = A.inv(DECOMP_CHOLESKY)*b; Vec<double, 8> k = A.inv(DECOMP_CHOLESKY)*b;
Matx<double, 3, 3> H(k(0) + 1., k(1), k(2), k(3), k(4) + 1., k(5), k(6), k(7), 1.); Matx<double, 3, 3> H(k(0) + 1., k(1), k(2), k(3), k(4) + 1., k(5), k(6), k(7), 1.);
if(res.empty()) { if(init.empty()) {
res = Ptr<Map>(new MapProjec(H)); return Ptr<Map>(new MapProjec(H));
} else { } else {
Ptr<MapProjec> newTr(new MapProjec(H)); Ptr<MapProjec> newTr(new MapProjec(H));
res->compose(newTr); MapProjec* initPtr = dynamic_cast<MapProjec*>(init.get());
Ptr<MapProjec> oldTr(new MapProjec(initPtr->getProjTr()));
oldTr->compose(newTr);
return oldTr;
} }
} }
......
...@@ -56,8 +56,8 @@ MapperGradShift::~MapperGradShift() ...@@ -56,8 +56,8 @@ MapperGradShift::~MapperGradShift()
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
void MapperGradShift::calculate( cv::Ptr<Map> MapperGradShift::calculate(
InputArray _img1, InputArray image2, cv::Ptr<Map>& res) const InputArray _img1, InputArray image2, cv::Ptr<Map> init) const
{ {
Mat img1 = _img1.getMat(); Mat img1 = _img1.getMat();
Mat gradx, grady, imgDiff; Mat gradx, grady, imgDiff;
...@@ -65,9 +65,9 @@ void MapperGradShift::calculate( ...@@ -65,9 +65,9 @@ void MapperGradShift::calculate(
CV_DbgAssert(img1.size() == image2.size()); CV_DbgAssert(img1.size() == image2.size());
if(!res.empty()) { if(!init.empty()) {
// We have initial values for the registration: we move img2 to that initial reference // We have initial values for the registration: we move img2 to that initial reference
res->inverseWarp(image2, img2); init->inverseWarp(image2, img2);
} else { } else {
img2 = image2.getMat(); img2 = image2.getMat();
} }
...@@ -93,11 +93,14 @@ void MapperGradShift::calculate( ...@@ -93,11 +93,14 @@ void MapperGradShift::calculate(
// Calculate shift. We use Cholesky decomposition, as A is symmetric. // Calculate shift. We use Cholesky decomposition, as A is symmetric.
Vec<double, 2> shift = A.inv(DECOMP_CHOLESKY)*b; Vec<double, 2> shift = A.inv(DECOMP_CHOLESKY)*b;
if(res.empty()) { if(init.empty()) {
res = Ptr<Map>(new MapShift(shift)); return Ptr<Map>(new MapShift(shift));
} else { } else {
Ptr<MapShift> newTr(new MapShift(shift)); Ptr<MapShift> newTr(new MapShift(shift));
res->compose(newTr); MapShift* initPtr = dynamic_cast<MapShift*>(init.get());
Ptr<MapShift> oldTr(new MapShift(initPtr->getShift()));
oldTr->compose(newTr);
return oldTr;
} }
} }
......
...@@ -56,8 +56,8 @@ MapperGradSimilar::~MapperGradSimilar() ...@@ -56,8 +56,8 @@ MapperGradSimilar::~MapperGradSimilar()
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
void MapperGradSimilar::calculate( cv::Ptr<Map> MapperGradSimilar::calculate(
InputArray _img1, InputArray image2, cv::Ptr<Map>& res) const InputArray _img1, InputArray image2, cv::Ptr<Map> init) const
{ {
Mat img1 = _img1.getMat(); Mat img1 = _img1.getMat();
Mat gradx, grady, imgDiff; Mat gradx, grady, imgDiff;
...@@ -67,9 +67,9 @@ void MapperGradSimilar::calculate( ...@@ -67,9 +67,9 @@ void MapperGradSimilar::calculate(
CV_DbgAssert(img1.channels() == image2.channels()); CV_DbgAssert(img1.channels() == image2.channels());
CV_DbgAssert(img1.channels() == 1 || img1.channels() == 3); CV_DbgAssert(img1.channels() == 1 || img1.channels() == 3);
if(!res.empty()) { if(!init.empty()) {
// We have initial values for the registration: we move img2 to that initial reference // We have initial values for the registration: we move img2 to that initial reference
res->inverseWarp(image2, img2); init->inverseWarp(image2, img2);
} else { } else {
img2 = image2.getMat(); img2 = image2.getMat();
} }
...@@ -127,11 +127,14 @@ void MapperGradSimilar::calculate( ...@@ -127,11 +127,14 @@ void MapperGradSimilar::calculate(
Matx<double, 2, 2> linTr(k(0) + 1., k(1), -k(1), k(0) + 1.); Matx<double, 2, 2> linTr(k(0) + 1., k(1), -k(1), k(0) + 1.);
Vec<double, 2> shift(k(2), k(3)); Vec<double, 2> shift(k(2), k(3));
if(res.empty()) { if(init.empty()) {
res = Ptr<Map>(new MapAffine(linTr, shift)); return Ptr<Map>(new MapAffine(linTr, shift));
} else { } else {
Ptr<MapAffine> newTr(new MapAffine(linTr, shift)); Ptr<MapAffine> newTr(new MapAffine(linTr, shift));
res->compose(newTr); MapAffine* initPtr = dynamic_cast<MapAffine*>(init.get());
Ptr<MapAffine> oldTr(new MapAffine(initPtr->getLinTr(), initPtr->getShift()));
oldTr->compose(newTr);
return oldTr;
} }
} }
......
...@@ -48,22 +48,22 @@ namespace reg { ...@@ -48,22 +48,22 @@ namespace reg {
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
MapperPyramid::MapperPyramid(const Mapper& baseMapper) MapperPyramid::MapperPyramid(Ptr<Mapper> baseMapper)
: numLev_(3), numIterPerScale_(3), baseMapper_(baseMapper) : numLev_(3), numIterPerScale_(3), baseMapper_(*baseMapper)
{ {
} }
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
void MapperPyramid::calculate(InputArray _img1, InputArray image2, Ptr<Map>& res) const Ptr<Map> MapperPyramid::calculate(InputArray _img1, InputArray image2, Ptr<Map> init) const
{ {
Mat img1 = _img1.getMat(); Mat img1 = _img1.getMat();
Mat img2; Mat img2;
if(!res.empty()) { if(!init.empty()) {
// We have initial values for the registration: we move img2 to that initial reference // We have initial values for the registration: we move img2 to that initial reference
res->inverseWarp(image2, img2); init->inverseWarp(image2, img2);
} else { } else {
res = baseMapper_.getMap(); init = baseMapper_.getMap();
img2 = image2.getMat(); img2 = image2.getMat();
} }
...@@ -87,11 +87,12 @@ void MapperPyramid::calculate(InputArray _img1, InputArray image2, Ptr<Map>& res ...@@ -87,11 +87,12 @@ void MapperPyramid::calculate(InputArray _img1, InputArray image2, Ptr<Map>& res
ident->scale(2.); ident->scale(2.);
} }
for(size_t it_i = 0; it_i < numIterPerScale_; ++it_i) { for(size_t it_i = 0; it_i < numIterPerScale_; ++it_i) {
baseMapper_.calculate(currRef, currImg, ident); ident = baseMapper_.calculate(currRef, currImg, ident);
} }
} }
res->compose(ident); init->compose(ident);
return init;
} }
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
......
...@@ -86,10 +86,10 @@ void RegTest::testShift() ...@@ -86,10 +86,10 @@ void RegTest::testShift()
mapTest.warp(img1, img2); mapTest.warp(img1, img2);
// Register // Register
MapperGradShift mapper; Ptr<Mapper> mapper = makePtr<MapperGradShift>();
MapperPyramid mappPyr(mapper); MapperPyramid mappPyr(mapper);
Ptr<Map> mapPtr; Ptr<Map> mapPtr;
mappPyr.calculate(img1, img2, mapPtr); mapPtr = mappPyr.calculate(img1, img2, mapPtr);
// Print result // Print result
MapShift* mapShift = dynamic_cast<MapShift*>(mapPtr.get()); MapShift* mapShift = dynamic_cast<MapShift*>(mapPtr.get());
...@@ -119,10 +119,10 @@ void RegTest::testEuclidean() ...@@ -119,10 +119,10 @@ void RegTest::testEuclidean()
mapTest.warp(img1, img2); mapTest.warp(img1, img2);
// Register // Register
MapperGradEuclid mapper; Ptr<Mapper> mapper = makePtr<MapperGradEuclid>();
MapperPyramid mappPyr(mapper); MapperPyramid mappPyr(mapper);
Ptr<Map> mapPtr; Ptr<Map> mapPtr;
mappPyr.calculate(img1, img2, mapPtr); mapPtr = mappPyr.calculate(img1, img2, mapPtr);
// Print result // Print result
MapAffine* mapAff = dynamic_cast<MapAffine*>(mapPtr.get()); MapAffine* mapAff = dynamic_cast<MapAffine*>(mapPtr.get());
...@@ -158,10 +158,10 @@ void RegTest::testSimilarity() ...@@ -158,10 +158,10 @@ void RegTest::testSimilarity()
mapTest.warp(img1, img2); mapTest.warp(img1, img2);
// Register // Register
MapperGradSimilar mapper; Ptr<Mapper> mapper = makePtr<MapperGradSimilar>();
MapperPyramid mappPyr(mapper); MapperPyramid mappPyr(mapper);
Ptr<Map> mapPtr; Ptr<Map> mapPtr;
mappPyr.calculate(img1, img2, mapPtr); mapPtr = mappPyr.calculate(img1, img2, mapPtr);
// Print result // Print result
MapAffine* mapAff = dynamic_cast<MapAffine*>(mapPtr.get()); MapAffine* mapAff = dynamic_cast<MapAffine*>(mapPtr.get());
...@@ -194,10 +194,10 @@ void RegTest::testAffine() ...@@ -194,10 +194,10 @@ void RegTest::testAffine()
mapTest.warp(img1, img2); mapTest.warp(img1, img2);
// Register // Register
MapperGradAffine mapper; Ptr<Mapper> mapper = makePtr<MapperGradAffine>();
MapperPyramid mappPyr(mapper); MapperPyramid mappPyr(mapper);
Ptr<Map> mapPtr; Ptr<Map> mapPtr;
mappPyr.calculate(img1, img2, mapPtr); mapPtr = mappPyr.calculate(img1, img2, mapPtr);
// Print result // Print result
MapAffine* mapAff = dynamic_cast<MapAffine*>(mapPtr.get()); MapAffine* mapAff = dynamic_cast<MapAffine*>(mapPtr.get());
...@@ -230,10 +230,10 @@ void RegTest::testProjective() ...@@ -230,10 +230,10 @@ void RegTest::testProjective()
mapTest.warp(img1, img2); mapTest.warp(img1, img2);
// Register // Register
MapperGradProj mapper; Ptr<Mapper> mapper = makePtr<MapperGradProj>();
MapperPyramid mappPyr(mapper); MapperPyramid mappPyr(mapper);
Ptr<Map> mapPtr; Ptr<Map> mapPtr;
mappPyr.calculate(img1, img2, mapPtr); mapPtr = mappPyr.calculate(img1, img2, mapPtr);
// Print result // Print result
MapProjec* mapProj = dynamic_cast<MapProjec*>(mapPtr.get()); MapProjec* mapProj = dynamic_cast<MapProjec*>(mapPtr.get());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment