ai4ce / peac

[ICRA2014] Fast Plane Extraction Using Agglomerative Hierarchical Clustering (AHC)
134 stars 34 forks source link

Implementation with ZED Camera #1

Closed Harrypys closed 4 years ago

Harrypys commented 4 years ago

Hello,

I was trying to use ZED camera to acquire the depth information but I don't know which cpp files (or which part) I should modify.

Someone suggested the methods to modify the format of input: https://answers.ros.org/question/133791/format-of-depth-value-openni2_camera/

And I found this ROS wrapper on ZED documentation to access the data https://www.stereolabs.com/docs/ros/depth_sensing/

Not sure which type of implementation is better and if there is a better choice

Thank you for any information!

simbaforrest commented 4 years ago

Hi, You should first figure out how to get the depth image from ZED, and then how to convert the depth image into an organized point cloud which should be organized as a 3xHxW sized tensor (or HxWx3). Then you can save the organized point cloud as a *.pcd file. And then you can use https://github.com/ai4ce/peac/blob/master/cpp/plane_fitter_pcd.cpp to process your pcd file to extract planes.

Harrypys commented 4 years ago

Thank you for your response. However, when I ran the pcd file I saved from the camera, it said it failed to load the file. Do I need to save it as .xyz file and then convert it into pcd file or change any of the parameters?

mmvc@mmvc-Alienware-13-R3:~/peac/cpp/build$ ./plane_fitter_pcd [iniLoad] list=>/home/mmvc/peac/cpp/build/data/test.pcd [iniLoad] ignore line: [iniLoad] outputDir=>/home/mmvc/peac/cpp/build/data/output [iniLoad] loop=>1 [iniLoad] debug=>0 [iniLoad] ignore line: [iniLoad] unitScaleFactor=>1000 [iniLoad] ignore line: [iniLoad] showWindow=>1 [iniLoad] ignore line: [iniLoad] stdTol_merge=>8 [iniLoad] stdTol_init=>5 [iniLoad] depthSigma=>1.6e-6 [iniLoad] ignore line: [iniLoad] z_near=>500 [iniLoad] z_far=>4000 [iniLoad] angleDegree_near=>15 [iniLoad] angleDegree_far=>90 [iniLoad] similarityDegreeTh_merge=>60 [iniLoad] similarityDegreeTh_refine=>30 [iniLoad] ignore line: [iniLoad] depthAlpha=>0.04 [iniLoad] depthChangeTol=>0.02 [iniLoad] ignore line: [iniLoad] initType=>1 [iniLoad] ignore line: [iniLoad] minSupport=>3000 [iniLoad] ignore line: [iniLoad] windowWidth=>10 [iniLoad] windowHeight=>10 [iniLoad] ignore line: [iniLoad] doRefine=>1 create:/home/mmvc/peac/cpp/build/data/output '.cl::PCDReader::readHeader] Could not find file '/home/mmvc/peac/cpp/build/data/test.pcd fail to load: /home/mmvc/peac/cpp/build/data/test.pcd '.cl::PCDReader::readHeader] Could not find file '/home/mmvc/peac/cpp/build/data/test.pcd fail to load: /home/mmvc/peac/cpp/build/data/test.pcd

Harrypys commented 4 years ago

Also if I want to extract the planes in real time, do I use plane_fitter.cpp? Thanks!