PointCloud issues with location XYZ

조회 수: 3(최근 30일)
Tiago Batanete Marques
Tiago Batanete Marques 2021년 1월 29일
댓글: Tiago Batanete Marques 2021년 2월 18일
I'm trying to use a program that requires the extraction of data from two consecutive images of a room and then creating a pointCloud of the room, like a world scene. In fact, it's very similar to programs that I found in the internet, which used the preinstalled data file 'livingRoom.mat', in the Computer Vision Toolbox. However, I'm trying to do the same thing but with photos taken by my webcam, and I am having trouble with the pointCloud function. I already stored a number of consecutive pictures into one .mat file, so I believe the problem lies within the pointCloud creation itself. Here's my piece of code:
dataFile = fullfile('C:\','Program Files (x86)','Intel RealSense SDK 2.0','matlab','+realsense','teste_sala_novo.mat');
% the variable name extracted by the datafile is II
image_to_ref = II{1};
image_to_current = II{2};
color_matrix = reshape(image_to_ref,720,1280,3);
image_to_ref_1 = im2double(image_to_ref);
image_to_current_1 = im2double(image_to_current);
ptCloudRef = pointCloud(image_to_ref_1,'Color',color_matrix);
ptCloudCurrent = pointCloud(image_to_current_1,'Color',color_matrix);
I believe that this is logically okay, but I'm concerned that the conversion between uint8 and double (or single, I have already tried them both) causes some sort of information loss, resulting in pointClouds with always the same X,Y and Z limits, such as below shown:
I don't know how to fix this, I tried to take pictures with a digital camera, and I tried to use pictures from the internet, and this always happens. Furthermore, this results in a world scene quite weird:
Appreciate the help. Thanks in advance.


Shashank Gupta
Shashank Gupta 2021년 2월 3일
Can you attach one of the sample file for me to investigate. But my first guess looking at the data would be, you might have performed some sorts of normalization because of 0-1 number. Can you check if by mistake you normalized sLocation property of point clouds. Just checked the location array once. That should be first step of approaching this problem.
I hope this helps.
  댓글 수: 3
Tiago Batanete Marques
Tiago Batanete Marques 2021년 2월 18일
Thanks for the quick answer, and I apologize for the delay in my response. I have failed to find the error, I tried to investigate further the functions but the problem kept surfacing. Here you have the sample file.
Thanks in advance.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by