1
votes

I am attempting to get the rgbdodometry sample running with opencv 3.0.

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

I am getting an exception error here: (line 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

It seems like the Rt Mat stays empty, where perspectiveTransform expects a 3 x 3. I am using the code from the sample, and the images from the sample folder.

What is going on here? And how could I fix it?

1
I also have the same problem with perspectiveTransform(), did you find the solution or not? Thanks - Bahramdun Adil
I did not. Still looking into it. Please let me know if you figure it out! - anti
I solved my problem that was the third parameter (Mat m) was empty so it throws the exception. So you check your data is OK. - Bahramdun Adil
snap. Same solve here. :) - anti
Me too struck with the same error. Could you let me know what to do please - John

1 Answers

0
votes

This was because the Mat Rt was not filling up. Due to this line failing in opencv 3.

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

It needed the added rgbd::RGBDOdometry namespace, but when I added that, it would not compile. I have moved back to 2.4 and it runs perfectly.