I extracted ground data using 'segmentGroundFromLidarData(ptCloud)' form 3D lidar (Velodyne) data. How to save ground segmented data as a pcap file to use for the further process?
I tried to save using as below but it is not working out.
save GroudData.pcap groundPtsIdx
Please find the code:
veloReader = velodyneFileReader('lidar.pcap','VLP16');
for i = 1 : 597
ptCloud = veloReader.readFrame(i);
colorLabels = zeros(size(ptCloud.Location,1),size(ptCloud.Location,2));
groundPtsIdx = segmentGroundFromLidarData(ptCloud);
colorLabels(groundPtsIdx (:)) = greenIdx;
colorLabels(~groundPtsIdx (:)) = redIdx;