RealSense d435 MATLAB settings
Hi!
I using a RealSense d435 to get a pointcloud in MATLAB.
Everything is working but when I use Computer Vision Library's ROI function, it takes almost 2 seconds per iteration, which is not useful in my application.
I therefore wanna use the built in parameters on the RealSense like in the RealSense Viewer. It has a "depth table" that worked really well.
Therefore my question:
How to I use the options in Matlab? I have looked through the examples, but cant seem to find what i want. Only that option (34) max_distance might be what im looking for. How to I incorporate this in my matlab code?
My simple matlab script:
% Make Pipeline object to manage streaming
pipe = realsense.pipeline();
% define point cloud object
pcl_obj = realsense.pointcloud();
% Start streaming on an arbitrary camera with default settings
pipe.start();
for j = 1:1
frames = pipe.wait_for_frames();
% Select depth frame
depth = frames.get_depth_frame();
% get point cloud points without color
pnts = pcl_obj.calculate(depth);
vertices = pnts.get_vertices();
% optional: populate MATLAB point cloud object
pCloud = pointCloud(vertices);
roi = [-inf,inf,-inf,inf,-inf,0.5]; %Region of interest
roi_idx = findPointsInROI(pCloud,roi); %Indices of the points in ROI
pcl2 = select(pCloud,roi_idx);
%display point cloud
pcshow(pcl2);
%pause(0.01);
disp(num2str(j))
end
pipe.stop();
-
Hi Flarse17 A reply has been posted on your RealSense GitHub version of this question. Thanks!
Please sign in to leave a comment.
Comments
1 comment