PCAP to .MAT (want to use PCAP in Examples)

13 visualizaciones (últimos 30 días)
Abdullah Rasul
Abdullah Rasul el 11 de Feb. de 2019
Respondida: Paola Donis Noriega el 29 de Oct. de 2025 a las 14:11
i am currently using velodyne VLP16 and most of the work is done in PCAP file.
i have tried some matlab examples with PCAP file and they are really good but there are some examples that uses .mat file instead of pcap.
can any one help me in using PCAP in those examples or how can i convert PCAP to .mat or even how can i get .mat file using velodyne VLP16.
thanks,
  5 comentarios
Akshay Gupta
Akshay Gupta el 13 de Abr. de 2022
Hello, can we save above mentioned converted MATLAB file into pcap file again?
As I have transfromed the point from pcap file frame by frame and save it in matrix/ or matlab file.
But I need to convert it to pcap file again.
Please suggest the solution for this.
Thanks
Abdullah Rasul
Abdullah Rasul el 14 de Abr. de 2022
Matlab does not allow much processing with PCAP files. It usually converts them to .mat files for the processing.
In my opinion, convert your points to the point cloud file as explained here: https://www.mathworks.com/help/vision/ref/pointcloud.html#d123e118474
This way you can use the point cloud for processing as well and this point cloud format is compatible with most of the hardware/software
Thanks.

Iniciar sesión para comentar.

Respuestas (1)

Paola Donis Noriega
Paola Donis Noriega el 29 de Oct. de 2025 a las 14:11
Hi Abdullah,
You can read point clouds from a PCAP file and store them as an array of pointCloud objects. Then, you can save this array to a MAT file. For example:
% Create a reader object for the PCAP file.
veloReader = velodyneFileReader('lidarData_ConstructionRoad.pcap','HDL32E');
% Preallocate an array to hold each point cloud frame.
numFrames = veloReader.NumberOfFrames;
ptCloudArr = repmat(pointCloud(zeros(0, 3)),numFrames,1);
for i = 1:numFrames
% Read each frame and store it in the array.
ptCloudArr(i) = readFrame(veloReader,i);
end
% Save the array of point clouds to a MAT file.
save("velodyneData.mat","ptCloudArr")
Note: MATLAB does not support writing point clouds to PCAP files. To export point clouds, you can use the pcwrite function to save each point cloud to a PLY or PCD file.

Categorías

Más información sobre Point Cloud Processing en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by