When I use python code to capture the depth image, the depth image shown using opencv is as follows
(upload://py3lc8fMDl3nGESI7trrKgqskyB.png)
But the depth image saved with the code is as follows
(upload://vKWAwAimxhN5dQO1ns8PCU1bT1D.png)
The array of depth images is as follows
‘depth’: array([[ nan, nan, nan, …, 28.595, 28.603, 28.603],
[ nan, nan, nan, …, nan, nan, nan],
[ nan, nan, nan, …, nan, nan, nan],
…,
[ nan, nan, nan, …, 1.3295, 1.3295, 1.3297],
[ nan, nan, nan, …, 1.3327, 1.3328, 1.3347],
[ nan, nan, nan, …, 1.3333, 1.3347, 1.3349]], dtype=float32)
Why is this a problem, is it a problem with my depth image capture?
Here’s my code:
def main():
global image_net, exit_signal, run_signal, detections
capture_thread = Thread(target=torch_thread,
kwargs={‘weights’: opts.weights, ‘img_size’: opts.img_size, “conf_thres”: opts.conf_thres})
capture_thread.start()
print("Initializing Camera...")
zed = sl.Camera()
input_type = sl.InputType()
if opts.svo is not None:
input_type.set_from_svo_file(opts.svo)
cv2.imwrite('./visualization/my_new_depth.png', depth_frame)
cv2.imshow('depth',depth_frame)