提交 9408a5ef 编写于 作者: J Jiri Horner

fix conversion bug in estimateAffine2D* functions

functions support points to have other datatypes than floats.

* fix bug in coversion that overwrites src points with dst points
上级 383559c2
......@@ -802,11 +802,11 @@ Mat estimateAffine2D(InputArray _from, InputArray _to, OutputArray _inliers,
if (from.type() != CV_32FC2 || to.type() != CV_32FC2)
{
Mat tmp;
from.convertTo(tmp, CV_32FC2);
from = tmp;
to.convertTo(tmp, CV_32FC2);
to = tmp;
Mat tmp1, tmp2;
from.convertTo(tmp1, CV_32FC2);
from = tmp1;
to.convertTo(tmp2, CV_32FC2);
to = tmp2;
}
// convert to N x 1 vectors
from = from.reshape(2, count);
......@@ -869,11 +869,11 @@ Mat estimateAffinePartial2D(InputArray _from, InputArray _to, OutputArray _inlie
if (from.type() != CV_32FC2 || to.type() != CV_32FC2)
{
Mat tmp;
from.convertTo(tmp, CV_32FC2);
from = tmp;
to.convertTo(tmp, CV_32FC2);
to = tmp;
Mat tmp1, tmp2;
from.convertTo(tmp1, CV_32FC2);
from = tmp1;
to.convertTo(tmp2, CV_32FC2);
to = tmp2;
}
// convert to N x 1 vectors
from = from.reshape(2, count);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册