Closed sunhufly closed 3 years ago
Can you share with me your calls to DepthVisualizer API?
from DepthVisualizer import DepthRenderer, Utils
import cv2
import numpy as np
from matplotlib import pyplot as plt
renderer = DepthRenderer(1200, 800, camera_fov=100)
renderer.set_camera_coords(0, 0, 0) # Camera originally starts at [0, 10, -10]
renderer.change_camera_rotation(0, 10) # Camera originally has pitch of -10
rgb_image = cv2.cvtColor(cv2.imread("image.png"), cv2.COLOR_BGR2RGB)
sample_depth_map = np.ones((rgb_image.shape[0], rgb_image.shape[1], 1)) # A depth map where depth of every pixel is 1
kitti_calib = Utils.read_kitti_calibration("calib.txt")
focal_length = kitti_calib["focal_length"]
principal_point = kitti_calib["principal_point"]
points = Utils.convert_depthmap_to_points(sample_depth_map, focal_length, principal_point, rgb_image)
renderer.set_points(points)
renderer.render()
frame = renderer.get_rendered_frame()
plt.imshow(frame)
renderer.set_camera_coords(0, 1.5, -1)
renderer.change_camera_rotation(0, -25)
renderer.add_axis_lines()
renderer.render()
frame = renderer.get_rendered_frame()
plt.imshow(frame)
predicted_depth_map = Utils.read_depth_map("predicted_depth.png")
points = Utils.convert_depthmap_to_points(predicted_depth_map, focal_length, principal_point, rgb_image)
renderer.set_points(points)
renderer.render()
frame = renderer.get_rendered_frame()
plt.imshow(frame)
renderer.show_window()
renderer.render_loop()
renderer.hide_window()
renderer.close()
Something seems to be broken, I will check whats going on after work and hopefully fix the issue soon.
Fixed the issue with latest update
Hi, thanks for your code, there is no error in the code,but no results are displayed in the end. There is only one window named "depth visualizer", and there is no diaplay content. Can you tell me how to solve it?