You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I met a problem when I was trying to generate the demo for SemanticKITTI dataset. That is, I have generated all .pkl files for validation (sequence 08) set, but I am not sure where is the camera pose I could use or how to fix the same viewpoint for these frames. The script I wrote as following:
import open3d as o3d
import pickle
import numpy as np
import cv2
def get_grid_coords(dims, resolution):
'''
:param dims: the dimensions of the grid [x, y, z] (i.e. [256, 256, 32])
:return coords_grid: is the center coords of voxels in the grid
'''
The sensor in centered in X (we go to dims/2 + 1 for the histogramdd)
g_xx = np.arange(0, dims[0] + 1)
The sensor is in Y=0 (we go to dims + 1 for the histogramdd)
g_yy = np.arange(0, dims[1] + 1)
The sensor is in Z=1.73. I observed that the ground was to voxel levels above the grid bottom, so Z pose is at 10
if bottom voxel is 0. If we want the sensor to be at (0, 0, 0), then the bottom in z is -10, top is 22
Hi @anhquancao, thanks for your excellent repo.
I met a problem when I was trying to generate the demo for SemanticKITTI dataset. That is, I have generated all .pkl files for validation (sequence 08) set, but I am not sure where is the camera pose I could use or how to fix the same viewpoint for these frames. The script I wrote as following:
import open3d as o3d
import pickle
import numpy as np
import cv2
def get_grid_coords(dims, resolution):
'''
:param dims: the dimensions of the grid [x, y, z] (i.e. [256, 256, 32])
:return coords_grid: is the center coords of voxels in the grid
'''
The sensor in centered in X (we go to dims/2 + 1 for the histogramdd)
g_xx = np.arange(0, dims[0] + 1)
The sensor is in Y=0 (we go to dims + 1 for the histogramdd)
g_yy = np.arange(0, dims[1] + 1)
The sensor is in Z=1.73. I observed that the ground was to voxel levels above the grid bottom, so Z pose is at 10
if bottom voxel is 0. If we want the sensor to be at (0, 0, 0), then the bottom in z is -10, top is 22
(we go to 22 + 1 for the histogramdd)
ATTENTION.. Is 11 for old grids.. 10 for new grids (v1.1) (PRBonn/semantic-kitti-api#49)
sensor_pose = 10
g_zz = np.arange(0, dims[2] + 1)
Obtaining the grid with coords...
xx, yy, zz = np.meshgrid(g_xx[:-1], g_yy[:-1], g_zz[:-1])
coords_grid = np.array([xx.flatten(), yy.flatten(), zz.flatten()]).T
coords_grid = coords_grid.astype(np.float32)
coords_grid = (coords_grid * resolution) + resolution/2
temp = np.copy(coords_grid)
temp[:, 0] = coords_grid[:, 1]
temp[:, 1] = coords_grid[:, 0]
coords_grid = np.copy(temp)
return coords_grid, g_xx, g_yy, g_zz
def draw_semantic_open3d(
voxels,
cam_param_path="",
voxel_size=0.2):
Line80: #param.extrinsic = pose_matrix # set extrinsic matrix from 4x4 camera pose matrix
def process(scan, dataset="Semantic_KITTI"):
from glob import glob
if name == "main":
pkl_file = glob("./Semantic_KITTI/*.pkl")
process(pkl_file[0])
Could you plesae tell me how to set the camera matrix at line:80 I marked? I have tried to find the camera matrix from https://www.cvlibs.net/datasets/kitti/eval_odometry.php and #16 . But it seems both of them does not work.
Thank you so much for your time and help.
The text was updated successfully, but these errors were encountered: