ivmech / ivport-v2

Raspberry Pi Camera Module V2 Multiplexer
http://ivmech.com
42 stars 11 forks source link

Overlapping camera1 and camera2 frames in ROS #24

Open IvonaKr opened 4 years ago

IvonaKr commented 4 years ago

Hello everyone :)

I am using an IVPORT-V2 multiplexer for my masters' thesis. The multiplexer is connected to Raspberry Pi, Model B VI.2. Raspberry runs on Ubuntu Mate 18.04., with ROS Melodic. I have two Raspberry Pi Camera V2 connected to the multiplexer, one is Noir and the other one is regular. Using iv.camera_change andiv.camera_capture I am enabled to access every camera's frames. Every frame I convert with cv_bridge and then I publish that frame as ROS message, type Image from sensor_msgs.msg. There are two topics for each camera, camera_topic1 and camera_topic2. And everything seems to works great :D

Then I have two Subscribers, that are on my laptop, takes that frames, and show it through cv2.imshow. The problem is that approximately every 10 seconds, frame from camera_topic1 shows in camera2 cv2.imshow windows, and I got this pink stripe. It is important for me to have the right picture in every moment because the processed images will be used in the neural network.

Here are the pictures for a better understanding. Expected (without pink stripe) : Screenshot from 2020-05-26 17-09-09

Error : Screenshot from 2020-05-26 17-09-24

Does anybody have an idea? It would really mean a lot to me. Thanks in advance. :)