Hello, I managed to get a grayscale image of (480,640) through the code below.
cap_depth = cv2.VideoCapture("rtsp://admin:admin@192.168.1.10/depth", cv2.CAP_GSTREAMER)
while(True):
ret2, frame_depth = cap_depth.read()
cv2.namedWindow('kinova_depth', cv2.WINDOW_AUTOSIZE)
cv2.setMouseCallback('kinova_depth', mouse_callback)
cv2.imshow('kinova_depth',frame_depth)
if cv2.waitKey(20) & 0xFF == ord('q'):
break
cap_depth.release()
cv2.destroyAllWindows()
However, the output image was in uint8 format ranging from 0 to 255, and accurate depth information could not be obtained.
I was able to get a value similar to uint16 through (pixel/255)*65535, but a lot of errors occurred because I had already brought the value of uint8.
Is there a way to get raw depth information of uint16 when streaming rtsp using opencv?
My environment is as below
Window10
python 3.7
opencv 4.1.0