Detect Speed with a Raspberry Pi, Camera and OpenCV

The camera is working, only I don’t know how to activate it via this script. Earlier I used to call Picamera2, but this script does not seem to support that. That’s more the problem