-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error rendering depth image #14
Comments
Hi @alpha571, The following line normalizes your depths into the range between 0 and 255, and you lose the original units of the rendered depths. Our depth maps are stored in the original units of the rendered mesh (e.g., meters).
Another issue might be storing the depth maps in
I implemented an Open3D renderer some time ago. You can use that one, or use it to debug your own rendering pipeline. It uses Open3D OffscreenRenderer, so the overall structure is a bit different. |
Dear v-pnk , |
pycolmap 0.3.0 or 0.4.0 should work. |
Dear tsattler and v-pnk,
When I use the ply model and camera pose file you shared to render depth images with Open3D, I'm having trouble getting depth images that match yours in scale. I think there might be something off with my camera position calculations or other parts of the process, but since I'm just starting out, I can't figure it out on my own. Could you help me spot where things might be going wrong in the code below? Thanks a lot!
import open3d as o3d
import numpy as np
import re
mesh = o3d.io.read_triangle_mesh("akitchen.ply")
mesh.compute_vertex_normals()
def load_camera_intrinsics(file_path):
with open(file_path, 'r') as f:
lines = f.readlines()
intrinsic, width, height = load_camera_intrinsics("cameras.txt")
camera_params = o3d.camera.PinholeCameraParameters()
camera_params.intrinsic = intrinsic
file_name = "frame-000357.pose.txt"
frame_number = re.search(r'frame-(\d+)', file_name).group(1)
poses = []
with open(file_name, 'r') as f:
lines = f.readlines()
for i in range(0, len(lines), 4):
pose_block = []
for j in range(4):
if i + j < len(lines):
pose_row = np.fromstring(lines[i + j], dtype=float, sep=' ')
pose_block.append(pose_row)
if len(pose_block) == 4:
pose = np.vstack(pose_block)
poses.append(pose)
vis = o3d.visualization.Visualizer()
vis.create_window(width=width, height=height, visible=True)
vis.add_geometry(mesh)
for i, pose in enumerate(poses):
extrinsic = pose
vis.destroy_window()
The text was updated successfully, but these errors were encountered: