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

Fix GpuMat to correctly calculate dataend when using GpuMat::create().

Add output to createMat() to be used by locateROI test cases.
This commit is contained in:
cudawarped
2022-02-02 14:25:46 +00:00
parent 415a42f327
commit f66a2ffa1e
3 changed files with 13 additions and 8 deletions
+11 -4
View File
@@ -91,7 +91,13 @@ namespace cvtest
GpuMat createMat(Size size, int type, bool useRoi)
{
Size size0 = size;
Size size0; Point ofs;
return createMat(size, type, size0, ofs, useRoi);
}
GpuMat createMat(Size size, int type, Size& size0, Point& ofs, bool useRoi)
{
size0 = size;
if (useRoi)
{
@@ -100,9 +106,10 @@ namespace cvtest
}
GpuMat d_m(size0, type);
if (size0 != size)
d_m = d_m(Rect((size0.width - size.width) / 2, (size0.height - size.height) / 2, size.width, size.height));
if (size0 != size) {
ofs = Point((size0.width - size.width) / 2, (size0.height - size.height) / 2);
d_m = d_m(Rect(ofs, size));
}
return d_m;
}