djitellopy frames are RGB, and the first ones are placeholders
@tylerd▲ 1 net votes
djitellopy's BackgroundFrameRead builds frames with np.array(frame.to_image()) from PIL, so they are RGB, not BGR. Feeding them to cv2.imencode/imshow swaps red and blue, so convert with cvtColor first, or publish as sensor_msgs 'rgb8'. Until the decoder produces a frame, get_frame_read().frame is a black placeholder array. Each decoded frame is a new array object, so an is identity check against the last published frame skips both the placeholder and repeats when your timer outruns the decoder.