Items with no label
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
3338 Discussions

How do you select the ROI in depth frame?

CDuan2
Beginner
3,947 Views

Hi. I am using Realsense D435 and Matlab wrapper to create the point cloud of my target object.

 

I can successfully detect and tracking the object from the streaming if I convert the depth_frame object into a grayscale image. However, even though I can find the exact location of the object in the image, it is hard for me to create the point cloud out of a grayscale image.

 

I found out that the MATLAB wrapper has a class realsense.pointcloud, which can calculate the point cloud out of a depth_frame object. I am wondering if it is possible to directly crop out the ROI from the depth_frame, or create a depth_frame object from a cropped grayscale image using the SDK.

 

If it is not possible, can I crop out a certain part of the point cloud by giving the coordinate?

 

Thank you for the help.

0 Kudos
1 Solution
CDuan2
Beginner
3,127 Views

Hey Eliza,

Thank you for the solution. I somehow didn't figure out how should I create the ​roi_sensor object. However, the problem has been solved. I managed to use get_distance function to find the depth range of the ROI, then the approximate region of the target object's points in the point cloud can be cropped out using select() function.

I am still curious how should I use the roi_sensor. It will be lovely if you can offer me some examples or references.

Thank you again for your kind help and patience.

View solution in original post

0 Kudos
5 Replies
Eliza_D_Intel
Employee
3,127 Views
Hello CDuan2, Thank you for your interest in the Intel RealSense D435 camera. The Matlab Wrapper also contains a function called roi_sensor that can help you set the region of interest. You can integrate it into your application. The code can be found here: https://github.com/IntelRealSense/librealsense/blob/master/wrappers/matlab/roi_sensor.m Thank you and best regards, Eliza
0 Kudos
Eliza_D_Intel
Employee
3,127 Views
Hello CDuan2, Could you please let us know if you have further questions on this topic? Thank you and best regards, Eliza
0 Kudos
CDuan2
Beginner
3,128 Views

Hey Eliza,

Thank you for the solution. I somehow didn't figure out how should I create the ​roi_sensor object. However, the problem has been solved. I managed to use get_distance function to find the depth range of the ROI, then the approximate region of the target object's points in the point cloud can be cropped out using select() function.

I am still curious how should I use the roi_sensor. It will be lovely if you can offer me some examples or references.

Thank you again for your kind help and patience.

0 Kudos
Eliza_D_Intel
Employee
3,127 Views
Hello CDuan2, Unfortunately, in this moment there are no examples available that contain roi_sensor, but we have forwarded your request to the RealSense Team. Thank you and best regards, Eliza
0 Kudos
chiacos
Beginner
2,089 Views

Dear Eliza,

 

I would like to see some examples that contain roi_sensor class in MatLab to set the region of interest directly in the Intel RealSense  camera (I have D415 and  D435) Are still not available?

Please, let me know. Chiara

 

0 Kudos
Reply