PCAP to .MAT (want to use PCAP in Examples)
조회 수: 7 (최근 30일)
이전 댓글 표시
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.
i am trying to use https://www.mathworks.com/help/driving/examples/ground-plane-and-obstacle-detection-using-lidar.html#driving-ex69316687
thanks,
댓글 수: 5
Akshay Gupta
2022년 4월 13일
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
답변 (1개)
Paola Donis Noriega
2025년 10월 29일
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Point Cloud Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!