shape: force column-based vector
This commit is contained in:
@@ -138,6 +138,13 @@ float HausdorffDistanceExtractorImpl::computeDistance(InputArray contour1, Input
|
||||
set2.convertTo(set2, CV_32F);
|
||||
CV_Assert((set1.channels()==2) && (set1.cols>0));
|
||||
CV_Assert((set2.channels()==2) && (set2.cols>0));
|
||||
|
||||
// Force vectors column-based
|
||||
if (set1.dims > 1)
|
||||
set1 = set1.reshape(2, 1);
|
||||
if (set2.dims > 1)
|
||||
set2 = set2.reshape(2, 1);
|
||||
|
||||
return std::max( _apply(set1, set2, distanceFlag, rankProportion),
|
||||
_apply(set2, set1, distanceFlag, rankProportion) );
|
||||
}
|
||||
|
||||
@@ -202,6 +202,13 @@ float ShapeContextDistanceExtractorImpl::computeDistance(InputArray contour1, In
|
||||
|
||||
CV_Assert((set1.channels()==2) && (set1.cols>0));
|
||||
CV_Assert((set2.channels()==2) && (set2.cols>0));
|
||||
|
||||
// Force vectors column-based
|
||||
if (set1.dims > 1)
|
||||
set1 = set1.reshape(2, 1);
|
||||
if (set2.dims > 1)
|
||||
set2 = set2.reshape(2, 1);
|
||||
|
||||
if (imageAppearanceWeight!=0)
|
||||
{
|
||||
CV_Assert((!image1.empty()) && (!image2.empty()));
|
||||
|
||||
Reference in New Issue
Block a user