06-08-2023, 01:00 AM
Code:
print(cam.setParam("Settings"))
# FOV=63.911 PixelSize=2.599117 Size=640x480 Snapshot=640x480 SHOW_LIMITS FOCAL_LENGTH=1.00 FAR_LENGTH=2800.00 BG_COLOR=#ffffff Persp WindowResize
bytes_img = RDK.Cam2D_Snapshot("", cam, "Color")
nparr = np.frombuffer(bytes_img, np.uint8)
img = cv2。imdecode (nparr cv2。IMREAD_UNCHANGED)
print(img.shape)
# sometimes (480, 640, 4), sometimes (480, 640, 3)
What I expect to happen:Snapshots are either always 4-channel RGBA or always 3-channel RGB regardless of what happens to be in front of the camera.
(OS: macOS, RoboDK version: latest, just downloaded now and tried on currently available latest version)