cv :: perspectiveTransform断言失败

时间:2015-06-07 21:50:53

标签: c++ opencv

我正在尝试使用opencv 3.0运行rgbdodometry示例。

https://github.com/kipr/opencv/blob/master/samples/cpp/rgbdodometry.cpp

我在这里收到异常错误:(第46行)

static void warpImage(const Mat& image, const Mat& depth, const Mat& Rt, const Mat& cameraMatrix, const Mat& distCoeff, Mat& warpedImage)

perspectiveTransform(cloud, transformedCloud, Rt);

Assertion failed <scn +="" 1="=" m.cols=""> in cv::perspectiveTransform. file matmul.cpp, line 2125

似乎Rt Mat保持为空,其中perspectiveTransform需要3 x 3.我使用示例中的代码和示例文件夹中的图像。

这里发生了什么?我怎么能解决它?

1 个答案:

答案 0 :(得分:0)

这是因为Mat Rt没有填满。由于这行在opencv 3中失败。

bool isFound = cv::RGBDOdometry(Rt, Mat(),
        grayImage0, depthFlt0, Mat(),
        grayImage1, depthFlt1, Mat(),
        cameraMatrix, minDepth, maxDepth, maxDepthDiff,
        iterCounts, minGradMagnitudes, transformationType);

它需要添加rgbd :: RGBDOdometry命名空间,但是当我添加它时,它不会编译。我已经回到了2.4并且运行得很好。