I have a PLY from a stereo vision sensor (1024 x 1280). The PLY gives:
- Location (X,Y,Z) [1310442 x 3]
- Color (R, G, B) [1310442 x 3] and
- XLimits, YLimits, ZLimits.
I am trying to convert the Color into a grayscale image/matrix. My attempt has been the following:
Image = ptCloud.Color(:,:,1);
R = double(Image(:,1));
G = double(Image(:,2));
B = double(Image(:,3));
I = 0.2989 * R + 0.5870 * G + 0.1140 * B;
Image_2d = reshape (I, 1024, 1280)
The image on the left is by plotting the PLY with MatLab's pcshow feature. This is what I want to obtain as an image/matrix but instead by following the above code... I get the image on the right which does not look correct!