MATLAB Answers

0

How to read and visualize my lidar data?

Asked by Kevin Chng on 16 Apr 2019
Latest activity Answered by KSSV
on 16 Apr 2019
Accepted Answer by KSSV
Hi All,
My lidar data is in bin file :
Anyone here has any idea how to read my lidar data in MATLAB?

  3 Comments

Do you have any info on the format? It is read by fread on knowing the format of the file.
I'm not sure with that, i download the data from the link below:
personally, I feel they should be in pcd file, somehow the downloaded file is bin.
I have tried
fid = fopen('n008-2018-08-01-15-16-36-0400__LIDAR_TOP__1533151061547455.pcd.bin', 'r');
data = fread(fid, '*int16');
fclose(fid);
I get a series of numeric data (one column), should i restructure it to 3 coloumns to represent x,y,z? Any insight?
Actually after reading the data using fread it will be reshaped to required dimension using reshape. To achieve this format of the file should be known.

Sign in to comment.

Tags

1 Answer

Answer by KSSV
on 16 Apr 2019
 Accepted Answer

Is this fine?
fid = fopen('n008-2018-08-01-15-16-36-0400__LIDAR_TOP__1533151061547455.pcd.bin', 'r');
data = fread(fid,'single');
fclose(fid);
data = reshape(data,[],2) ;
plot(data(:,1),data(:,2),'.r')

  0 Comments

Sign in to comment.