Closed laststand0810 closed 6 years ago
yeh its working in my project its fix my error.
it's cool,thanks
So I've just read through git book, i'll make a push request later on, just that the project seems to be abandoned.
So I've just read through git book, i'll make a push request later on, just that the project seems to be abandoned.
if ret is True: gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) else: continue
what is ret ?
_ , frame = cap.read()
# Convert BGR to HSV
if _ is True:
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
else:
continue
Trying to replicate on colab.research.google.com but error is not getting resolved
You can use: if ret is True: gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) else: break
This will end video when a frame has problem.
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) its not working
can i use raspberrypi camera in place of webcam
if yes the n share some idea in detail
I tried the above fix. Not getting the scn error anymore but after giving the command it's stuck not doing anything.
I am executing webcam.py from https://github.com/shantnu/Webcam-Face-Detect . Please note the file was run after doing the fix suggested in the comments above.
Any help would be appreciated, thanks.
gray = cv2.cvtColor(image_frame, cv2.COLOR_BGR2GRAY)
cv2.error: /build/opencv-U1UwfN/opencv-2.4.9.1+dfsg1/modules/imgproc/src/color.cpp:3737: error: (-215) scn == 3 || scn == 4 in function cvtColor (I am facing this problem please help me)
You can use: if ret is True: gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) else: break
This will end video when a frame has problem.
It works. Thanks a lot!
Hi, couple days ago I have worked with this project and encounter this error below, I did a little tune and the error seems to have disappeared so I think I would like to submit my fix for those who may concerned. Authors please check it for me, thank you in advance (sorry I'm not that good with git =.='):
Issue reproduce:
Found face I'm listening Found audio Google Speech Recognition could not understand audio OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /tmp/opencv-20170224-1869-10nlf6f/opencv-2.4.13.2/modules/imgproc/src/color.cpp, line 3739 Traceback (most recent call last): File "bot.py", line 254, in
bot.start()
File "bot.py", line 40, in start
if self.vision.recognize_face():
File "/Users/macuser/AI-Smart-Mirror/vision.py", line 32, in recognize_face
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.error: /tmp/opencv-20170224-1869-10nlf6f/opencv-2.4.13.2/modules/imgproc/src/color.cpp:3739: error: (-215) scn == 3 || scn == 4 in function cvtColor
Suspected cause: while streaming webcam there must be a corrupted frame that have been assigned into cvtColor() and produce error reference: http://www.pyimagesearch.com/2016/12/26/opencv-resolving-nonetype-errors/
Suggest fix: change vision.py line 32 from
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
to:
if ret is True: gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) else: continue