0

我很难编译这段代码:

UMat dx, dy;
Sobel(GREY_IMAGE, dx, GREY_IMAGE.depth(), 1, 0, 3);
Sobel(GREY_IMAGE, dy, GREY_IMAGE.depth(), 0, 1, 3);
resize(dx, dx, Size(dx.rows, dx.rows), 0, 0, CV_INTER_AREA);
resize(dy, dy, Size(dx.rows, dx.rows), 0, 0, CV_INTER_AREA);
UMat mag(dx.size(), dx.type());
magnitude(dx, dy, mag);

每当我尝试它时,都会得到回应:

{msg="OpenCV(4.0.0-dev) E:\opencv-master\modules\core\src\mathfuncs.cpp:151: 错误: (-215: 断言失败) src1.size() == src2.size () && type == src2.type() && (depth == CV_32F || depth == CV_64F) in 函数... ...}

我不知道上面的代码有什么问题。尺寸没问题,所有三个矩阵都是二次的。我该怎么办?

4

0 回答 0