My set up is Raspbian Stretch on a Pi 3B. For the past couple of years I have been successfully using two cameras, the official CSI camera (mark 1 version) for shape recognition and an old Logitec webcam for colour recognition, both using Python 2.7, OpenCV version 3.3.0 and v4l2 (initiated with "sudo modprobe bcm2835-v4l2"). I originally set this up in Wheezy, upgraded to Jessie and then to Stretch about a year ago.
However, recent attempts to carry out normal regular apt-get update + upgrade of Stretch always result in the CSI camera ceasing to work. However the web cam continues to work as normal
"cap = cv2.VideoCapture(index)" followed by "success, frame = cap.read()" in a "while" loop fails for the CSI camera, "success" reading False. ("index" is 0 for the web cam and 1 for the CSI camera when both are plugged in to the Pi.)
This would seem to be a problem with either the v4l2 driver or OpenCV as the camera works correctly using "raspistill -t 2000 -o test.jpg" in a terminal window so it's not a connection or hardware fault.
I have tried 3 different CSI cameras and 2 different Pi's. I have also downloaded a fresh install of Stretch from raspberrypi.org and installed OpenCV on it but the problem persists.
I'd be most grateful if anyone could help me sort this out.