-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Description
Hi,
I'm trying to use RgbdPlane on a depth image located in object_recognition_transparent_objects/sample/depth.xml.gz but I get a segmentation fault when calling RgbdPlane::operator(..). I use ecto_opencv from the commit c2eda93 and here is my code:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/rgbd/rgbd.hpp>
using namespace cv;
int main()
{
const string depthFilename = "depth.xml.gz";
//read depth image
Mat depth;
FileStorage fs(depthFilename, FileStorage::READ);
CV_Assert(fs.isOpened());
fs["depth_image"] >> depth;
fs.release();
CV_Assert(!depth.empty());
imshow("depth", depth);
waitKey(3000);
Mat cameraMatrix = (Mat_<double>(3, 3) << 525., 0., 3.1950000000000000e+02,
0., 525., 2.3950000000000000e+02,
0., 0., 1.);
Mat points3d;
depthTo3d(depth, cameraMatrix, points3d);
RgbdNormals normalsEstimator(depth.rows, depth.cols, depth.depth(), cameraMatrix);
Mat normals = normalsEstimator(points3d);
RgbdPlane planeEstimator;
Mat planesMask;
vector<Vec4f> planeCoefficients;
//planeEstimator(depth, planesMask, planeCoefficients);
planeEstimator(depth, normals, planesMask, planeCoefficients);
return 0;
}Also I get a segmentation fault if I call the plane estimator this way: planeEstimator(depth, planesMask, planeCoefficients). Am I missing something?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels