Just set up my newly arrived OAK SR POE and set it up on a POE switch on LAN with the host from which I'm testing, connectivity seemed good but when attempting to run the depthai_demo.py I keep getting [19443010E11C742700] [192.168.1.93] [5.596] [ColorCamera(0)] [error] Camera not detected on socket: 0
. So I figured there's no better way than to learn by doing, and set up a simple (if ugly) example as follows:
if __name__ == '__main__':
pipeline = depthai.Pipeline()
cam_rgb_right = pipeline.createColorCamera()
cam_rgb_right.setResolution(ColorCameraProperties.SensorResolution.THE_800_P)
cam_rgb_right.setBoardSocket(CameraBoardSocket.CAM_C)
cam_rgb_left = pipeline.createColorCamera()
cam_rgb_left.setResolution(ColorCameraProperties.SensorResolution.THE_800_P)
cam_rgb_left.setBoardSocket(CameraBoardSocket.CAM_B)
# XLinkOut is a "way out" from the device. Any data you want to transfer to host need to be send via XLink
x_out_rgb_r = pipeline.createXLinkOut()
# For the rgb camera output, we want the XLink stream to be named "rgb"
RGB_RIGHT: Final[str] = "rgbr"
x_out_rgb_r.setStreamName(RGB_RIGHT)
# Linking camera preview to XLink input, so that the frames will be sent to host
cam_rgb_right.preview.link(x_out_rgb_r.input)
# XLinkOut is a "way out" from the device. Any data you want to transfer to host need to be send via XLink
x_out_rgb_l = pipeline.createXLinkOut()
# For the rgb camera output, we want the XLink stream to be named "rgb"
RGB_LEFT: Final[str] = "rgbl"
x_out_rgb_l.setStreamName(RGB_LEFT)
# Linking camera preview to XLink input, so that the frames will be sent to host
cam_rgb_left.preview.link(x_out_rgb_l.input)
with depthai.Device(pipeline) as device:
print('MxId:', device.getDeviceInfo().getMxId())
print('Connected cameras:', device.getConnectedCameras())
q_rgb_r = device.getOutputQueue(RGB_RIGHT)
q_rgb_l = device.getOutputQueue(RGB_LEFT)
for i in range(5):
in_rgb_r = q_rgb_r.get()
in_rgb_l = q_rgb_l.get()
if in_rgb_r is not None:
# If the packet from RGB camera is present, we're retrieving the frame in OpenCV format using getCvFrame
frame = in_rgb_r.getCvFrame()
cv2.imshow("right", frame)
cv2.waitKey(1000)
if in_rgb_l is not None:
# If the packet from RGB camera is present, we're retrieving the frame in OpenCV format using getCvFrame
frame = in_rgb_l.getCvFrame()
cv2.imshow("left", frame)
cv2.waitKey(1000)
My issue is that the frames receied appear to be very purple, I see that there is a fix for what appears to be similar issues here but that appears to be talking about being outside, and I'm indoors with the blinds shut. Am I just missing something silly here due to my inexperience?