1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #11634 from vpisarev:empty_mat_with_types_2

fixes handling of empty matrices in some functions (#11634)

* a part of PR #11416 by Yuki Takehara

* moved the empty mat check in Mat::copyTo()

* fixed some test failures
This commit is contained in:
Vadim Pisarevsky
2018-05-31 19:36:39 +03:00
committed by Alexander Alekhin
parent da75e463a8
commit 7d19bd6c19
9 changed files with 42 additions and 11 deletions
+4 -4
View File
@@ -803,7 +803,7 @@ static bool ocl_HoughLines(InputArray _src, OutputArray _lines, double rho, doub
int total_points = counters.getMat(ACCESS_READ).at<int>(0, 0);
if (total_points <= 0)
{
_lines.assign(UMat(0,0,CV_32FC2));
_lines.release();
return true;
}
@@ -831,7 +831,7 @@ static bool ocl_HoughLines(InputArray _src, OutputArray _lines, double rho, doub
if (total_lines > 0)
_lines.assign(lines.rowRange(Range(0, total_lines)));
else
_lines.assign(UMat(0,0,CV_32FC2));
_lines.release();
return true;
}
@@ -857,7 +857,7 @@ static bool ocl_HoughLinesP(InputArray _src, OutputArray _lines, double rho, dou
int total_points = counters.getMat(ACCESS_READ).at<int>(0, 0);
if (total_points <= 0)
{
_lines.assign(UMat(0,0,CV_32SC4));
_lines.release();
return true;
}
@@ -885,7 +885,7 @@ static bool ocl_HoughLinesP(InputArray _src, OutputArray _lines, double rho, dou
if (total_lines > 0)
_lines.assign(lines.rowRange(Range(0, total_lines)));
else
_lines.assign(UMat(0,0,CV_32SC4));
_lines.release();
return true;
}