简体   繁体   中英

How to export a pointcloud to be view in matlab

I use the OpenCV function

pointCloud = cv2.reprojectImageTo3D(filteredImg,disparityToDepthMap) / 420

to get an pointcloud of my stereo images.

I want to show it into matlab, I tried to load the data into matlab but i failed.

In order to save variables to be read later in Matlab, I recommend to store them as .mat documents executing the following line in python:

import scipy.io as spio

spio.savemat(r'C:\DirectoryNameofMatlabProject' , mdict={'namedata': namedata})

Once stored the .mat containing the desired data, in your case "pointCloud", you will need to open the .mat in Matlab. For this, just click in "Import Data".

Finally, in order to transform this data into a pointCloud object in Matlab, execute the following code:

ptCloud=pointCloud(namedata);

pcshow(namedata)

I hope you find it helpful.

Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM