Hello,
I’m working on a program running Segnet which reads a webcam video stream using OpenCV, processes the image with Segnet, converts the output back to OpenCV, and displays an output. I’m getting a visual error where only a tiny portion of the Segnet overlay displays on the image. Below is an example, with a few small lines of the Segnet overlay being displayed, mainly in the top left:
I’m using a code that differs significantly from the example segnet.py, as segnet.py has trouble reading in my video frames (something to do with size mismatch in GStreamer). I have tested segnet.py with single images, and produced the expected result, so I think it must be an issue with my code. The processing loop is as follows:
Bizarrely, it seems that just having all the images shown with cv2.imshow() makes the output appear as desired, with the full overlay applied. Actually, as long as I also imshow() img_np, the correct output is displayed by img_cv2.
I thought it might be an issue with values getting overwritten too fast for the program to display the original (so the img_cv2 values were getting rewritten with regular RGB frames for some reason), but I didn’t see the correct outcome when doing a time.sleep() to delay the loop.
Any insight you could give would be much appreciated.