필터 지우기
필터 지우기

Ground truth labeler shows no points

조회 수: 4 (최근 30일)
youssef Alaa
youssef Alaa 2022년 5월 21일
답변: Githin George 2023년 10월 10일
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)

답변 (1개)

Githin George
Githin George 2023년 10월 10일
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