Azzera filtri
Azzera filtri

Ground truth labeler shows no points

4 visualizzazioni (ultimi 30 giorni)
youssef Alaa
youssef Alaa il 21 Mag 2022
Risposto: Githin George il 10 Ott 2023
I was trying to use Ground truth labeler for labeling (ViViD Dataset) RGB and point cloud. The point cloud was in (.bin) format, which was not acceptable as Ground truth labeler only accepts PCD or PLY format. SO, I used this code to convert from binary to PCD and then i uploaded the point cloud in PCD format. But, there was no points to visualize
import numpy as np
import struct
import sys
import open3d as o3d
def bin_to_pcd(binFileName):
size_float = 4
list_pcd = []
with open(binFileName, "rb") as f:
byte = f.read(size_float * 4)
while byte:
x, y, z, intensity = struct.unpack("ffff", byte)
list_pcd.append([x, y, z])
byte = f.read(size_float * 4)
np_pcd = np.asarray(list_pcd)
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(np_pcd)
return pcd
def main(binFileName, pcdFileName):
pcd = bin_to_pcd(binFileName)
o3d.io.write_point_cloud(pcdFileName, pcd)

Risposte (1)

Githin George
Githin George il 10 Ott 2023
Hi Youssef,
I understand you are trying to convert data in ‘bin’ format to PCD format.
You could try executing the following code in MATLAB to obtain the same.
fid = fopen('yourData.bin', 'r');
data = fread(fid,'single');
fclose(fid);
% Reshape Data based on the Structure of the Data. I am assuming data
% contains x y and z data
data = reshape(data,[],3);
% See "doc pointCloud" for providing intensity or Color data as Name Value Pair
pcdData = pointCloud(data);
pcwrite(ptCloud, 'lidar_data.pcd');
This should help you load the correct data to Ground Truth Labeler app.

Community Treasure Hunt

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

Start Hunting!

Translated by