I tried making this code work with the raspberry pi cam. how do you make the cv2.VideoCapture(0) recognise the raspberry pi camera as the designated camera
You cannot use cv2.VideoCapture() for RaspiCam.
cv2.VideoCapture()
The cv2.VideoCapture() is only for USB camera, not for CSI camera.
If you want to use RaspiCam for capturing, you can refer this tutorial