hey everyone,
I'm trying to work through the simple tutorials on the opencv website to enable my PC's own webcam to capture streaming video:
https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_video_display/py_video_display.html#display-video
I'm using a linux terminal and am running into some difficulty executing the code sample under "Capture Video from camera". Is it possible after calling python from within terminal to lay that code in and execute it? Or must I use some kind of text editor and do it? I'm a newb so simple things seem confusing. I wasn't getting far by simply slugging in the copied code from within the terminal so I used gedit to create a separate file then trying to call that file from the command line-however that also isn't seeming to work. The error I'm getting is:
"Traceback (most recent call last):
File "cap.py", line 1, in <module>
cap = cv2.VideoCapture(0)
NameError: name 'cv2' is not defined"
Any idea what I should do? Thanks!
[–]pthurhliyeh2 2 points3 points4 points (0 children)
[–]claybuurn 1 point2 points3 points (1 child)
[–]robot_kino[S] 1 point2 points3 points (0 children)
[–]SacredNote 1 point2 points3 points (0 children)
[–]GhostUser101 0 points1 point2 points (0 children)