提交 7ca38d63 编写于 作者: V Vadim Pisarevsky

fixed failure of the C++ test for estimateAffine3D

上级 79e278c0
......@@ -467,10 +467,8 @@ int cv::estimateAffine3D(InputArray _from, InputArray _to,
_out.create(3, 4, CV_64F);
Mat out = _out.getMat();
_inliers.create(count, 1, CV_8U);
Mat inliers = _inliers.getMat();
Mat inliers(1, count, CV_8U);
inliers = Scalar::all(1);
transpose(inliers, inliers);
Mat dFrom, dTo;
from.convertTo(dFrom, CV_64F);
......@@ -487,5 +485,9 @@ int cv::estimateAffine3D(InputArray _from, InputArray _to,
param1 = param1 <= 0 ? 3 : param1;
param2 = (param2 < epsilon) ? 0.99 : (param2 > 1 - epsilon) ? 0.99 : param2;
return Affine3DEstimator().runRANSAC(&m1, &m2, &F3x4, &mask, param1, param2 );
int ok = Affine3DEstimator().runRANSAC(&m1, &m2, &F3x4, &mask, param1, param2 );
if( _inliers.needed() )
transpose(inliers, _inliers);
return ok;
}
......@@ -1927,6 +1927,14 @@ void cv::transpose( InputArray _src, OutputArray _dst )
_dst.create(src.cols, src.rows, src.type());
Mat dst = _dst.getMat();
// handle the case of single-column/single-row matrices, stored in STL vectors.
if( src.rows != dst.cols || src.cols != dst.rows )
{
CV_Assert( src.cols == 1 || src.rows == 1 );
src.copyTo(dst);
return;
}
if( dst.data == src.data )
{
TransposeInplaceFunc func = transposeInplaceTab[esz];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册