I'm using python-OpenCV version 4.4 and when running just a basic code block:
import cv2
camera_capture = cv2.VideoCapture(0)
fps = 30
size = int(camera_capture.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)),\
int(camera_capture.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT))
video_writer = cv2.VideoWriter('MyOutputVid.avi', cv2.cv.CV_FOURCC('I','4','2','0'),
fps, size)
I get AttributeError: module 'cv2.cv2' has no attribute 'cv'
I understand there has been a transition from OpenCV to OpenCV2 but how
the imports were affected ?
I found similar topic here but removing second cv2
from the code didn't help in my case. It just threw another error AttributeError: module 'cv2.cv2' has no attribute 'CV_CAP_PROP_FRAME_WIDTH'
How can I use the attributes ?