How to change a PCAP file into the PCD file?

46 次查看(过去 30 天)
I am trying to change my raw lidar file of .pcap to .pcp file to be used for detection and tracking of vehicle. Can anyone help me how I can change in into .pcd format. Also I have to select a portion of frames from the whole dataset. Can anyone give a hint or how should I start.
Ps- I am working with Velodyne vlp-16 and using Veloview to view my generated file.
  2 个评论
Youssef Attia
Youssef Attia 2023-11-12
wanted to know if you finished your project. I'm also currently working on the same project, but i can't seem to understand what to do
Shashank Rajput
Shashank Rajput 2023-11-13
Yes I finished, what's the thing you can't understand. If you can explain me clearly maybe I can help.

请先登录,再进行评论。

回答(1 个)

Shashank Rajput
Shashank Rajput 2022-3-7
Hey,
I myself have found the answer to my question. I am attaching my code where I have taken frames(25049-28765) from the total data set and converted that into the pcd files.
outputFolder = fullfile('C:\Users\Shashank Rajput\OneDrive - IIT Kanpur\Documents\Research\lidar data\Lidar');
%Saving the PCD files of the data
pcdfolder = fullfile(outputFolder, 'Velodyne VLP-16\Trial Data\', 'Detections', 'PCD_03')
%Reading the lidar file
veloReader = velodyneFileReader('C:\Users\Shashank Rajput\OneDrive - IIT Kanpur\Documents\Research\lidar data\Lidar\2022-02-24-18-23-31_Velodyne-VLP-16-Data.pcap','VLP16');
%Limits of the Lidar
xlimits = [-60 60];
ylimits = [-80 80];
zlimits = [-20 20];
player = pcplayer(xlimits,ylimits,zlimits);
%Label the Axes
xlabel(player.Axes,'X (m)');
ylabel(player.Axes,'Y (m)');
zlabel(player.Axes,'Z (m)');
frame=25049;
%Display
while(hasFrame(veloReader) && player.isOpen() && (frame<=28765))
ptCloud = readFrame(veloReader,frame);
ptCloud = pointCloud(reshape(ptCloud.Location, [],3), 'Intensity',single(reshape(ptCloud.Intensity, [],1)));
name = sprintf('frame%04d.pcd',frame);
pcwrite(ptCloud, fullfile(pcdfolder,name));
frame=frame+1;
end
  2 个评论
Sarang Jokhio
Sarang Jokhio 2022-4-1
Hi Shashank,
I assume that you saved file in pcd format to open it in Lidar Labeler app?
I also used similar method to convert raw lidar scans into point clouds and then into pcd files.
However, when use dir function, the resulting order of the files is not correct. Did you also face same issue?
If not, could you please check it with dir and let me know if you have files in correct order?
Thank you :)
Shashank Rajput
Shashank Rajput 2022-4-5
Sorry for the late reply.No I didn't used the dir function. It's better to write it using the sprintf function only in order to get the correct order.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Point Cloud Processing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by