Hello,
I want to send the frames via tcp from the Oak 4 Pro. Here is the logic I used to modify the pose estimation example:
Preview is detection_nn.passthrough.link(script.inputs["preview"])
I added these changes in the script:
frame = node.inputs['preview'].get()
dets = node.inputs['det_in'].get()
data = frame.getData()
data = np.frombuffer(data, dtype=np.uint8).reshape((192,768,3))
data = cv2.resize(data, (720, 720), interpolation=cv2.INTER_LINEAR)
# encode frame to jpeg
success, encoded_image = cv2.imencode('.jpg', data)
data = encoded_image.tobytes()
conn.send(data)
This is my decoding logic:
frame_data = np.frombuffer(payload, dtype=np.uint8)
image = cv2.imdecode(frame_data, cv2.IMREAD_COLOR)
cv2.imshow('Received Image', image)
For some reason, my image looks like this:

What am I doing wrong?
@RakshithSingh