Skip to content

TypeError: VideoCapture() takes no arguments #518

Open
@savadkv01

Description

@savadkv01

This is the code which iam tryng in PyCharm

import cv2
import time

cap = cv2.VideoCapture(0)


while True:
    success, img = cap.read()
    cv2.imshow("Image", img)
    cv2.waitKey(1)

Iam getting below error

"C:\Users\Support ACTA\AppData\Local\Programs\Python\Python37\python.exe" "E:/Project/Python/advanced computer vision/Face Detection/FaceDetectionMin.py"
Traceback (most recent call last):
  File "E:/Project/Python/advanced computer vision/Face Detection/FaceDetectionMin.py", line 4, in <module>
    cap = cv2.VideoCapture(0)
TypeError: VideoCapture() takes no arguments

If I use the the video path also, same error iam getting

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions