webcam-pulse-detector
webcam-pulse-detector copied to clipboard
Plotting error: assertion failed
When enabling plotting, the following error is happening:
bpm plot enabled
OpenCV Error: Assertion failed (mat.isContinuous()) in unknown function, file ..
\..\..\opencv-2.4.4\modules\core\src\opengl_interop.cpp, line 1153
Traceback (most recent call last):
File "get_pulse.py", line 127, in <module>
App.main_loop()
File "get_pulse.py", line 122, in main_loop
self.key_handler()
File "get_pulse.py", line 94, in key_handler
self.key_controls[key]()
File "get_pulse.py", line 64, in toggle_display_plot
self.make_bpm_plot()
File "get_pulse.py", line 80, in make_bpm_plot
bg = self.processor.grab_faces.slices[0])
File "e:\docs\test\webcam-pulse-detector-master\lib\interface.py", line 113, i
n plotXY
cv2.imshow(name,z)
cv2.error: ..\..\..\opencv-2.4.4\modules\core\src\opengl_interop.cpp:1153: error
: (-215) mat.isContinuous()
I have Windows, Python 2.7, OpenCV 2.4.4 and OpenMDAO 0.5.5 and the 'S' part works perfectly.
Hmm, OpenCV is very picky when it comes to data formatting sometimes, and the errors that different builds give are difficult to replicate across platforms.
Just before line 113 of lib/interface.py (the last line), try explicitly casting z to a numpy array first:
z = np.array(z)
and see if that helps. Odd as it may sound,that fixed a few bugs that came up for me in a few places.
Same probleme here, the fix didn't work
OpenCV Error: Assertion failed (p.checkVector(2, CV_32S) >= 0) in polylines
P is :
[[ 10 18] [ 78 61] [148 70] [216 52] [287 26] [315 32] [350 33] [381 35] [412 39] [445 35] [478 25] [503 26] [535 22] [565 14] [595 12] [630 10]] [[ 10 150] [ 98 116] [187 98] [275 90] [364 90] [452 97] [541 115] [630 147]] [[ 10 170] [630 230]]
Similar issue....
bpm plot enabled
OpenCV Error: Assertion failed (p.checkVector(2, CV_32S) >= 0) in polylines, file /build/buildd/opencv-2.3.1/modules/core/src/drawing.cpp, line 2064
Traceback (most recent call last):
File "get_pulse.py", line 127, in
Python 2.7.3, libCV2.3, openMdao 0.5.5 and s part also works.
I just added a quick check of cv's polylines's function in test_webcam.py, since it seems to be tricky for a few people.
What happens when you run that?
for me, it's only when i press the key 'D' in the get_pulse.py
Update: I changed part of how it is used in interface.py, but since I can't seem to replicate the error I'm not sure if that will fix it
Same issue, I've just pulled.
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
face detection lock = True
bpm plot enabled
OpenCV Error: Assertion failed (p.checkVector(2, CV_32S) >= 0) in polylines, file /build/buildd/opencv-2.3.1/modules/core/src/drawing.cpp, line 2064
Traceback (most recent call last):
File "get_pulse.py", line 127, in
Re-pulled - I've seen that you modified test_webcam.py. Here's the error I have with it now.
python test_webcam.py
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
OpenCV Error: Assertion failed (p.checkVector(2, CV_32S) >= 0) in polylines, file /build/buildd/opencv-2.3.1/modules/core/src/drawing.cpp, line 2064
Traceback (most recent call last):
File "test_webcam.py", line 15, in
Just pulled
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
init done
opengl support available
bpm plot enabled
OpenCV Error: Assertion failed (p.checkVector(2, CV_32S) >= 0) in polylines, file /home/abuild/rpmbuild/BUILD/OpenCV-2.3.1/modules/core/src/drawing.cpp, line 2064
Traceback (most recent call last):
File "get_pulse.py", line 127, in
pts1 = numpy.array([[0,0],[100,100]], numpy.int32)
pts2 = numpy.array([[0,0],[0,500],[200,200]],numpy.int32)
seems to fix the problem in test_webcam.py
Yes
interesting - I'll test that out on my end and add that change in.
I also replaced cv2.polylines with iterations over cv2.line, since a google search shows that a ton of opencv installations seem to have problems with polylines (for some reason). The python bindings for opencv may not be entirely complete across platforms...
Apparently, the last push you did fixed this issue, however I'm getting this error now:
../bin/python get_pulse.py
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
face detection lock = True
bpm plot enabled
Traceback (most recent call last):
File "get_pulse.py", line 127, in
Same than flacostec
Fixed my issue by returning nothing in that function.
lib/interface.py:14 def moveWindow(args,*kwargs): return
ITS WORKING
Excellent, thanks for the feedback on these bugs!
Thanks :+1:
I have this error now, upon pressing D. S and test-webcam works OK.
face detection lock = True
bpm plot enabled
OpenCV Error: Assertion failed (mat.isContinuous()) in unknown function,
file ..
....\opencv-2.4.4\modules\core\src\opengl_interop.cpp, line 1153
Traceback (most recent call last):
File "get_pulse.py", line 127, in
On 16 April 2013 17:02, flacostec [email protected] wrote:
Thanks [image: :+1:]
— Reply to this email directly or view it on GitHubhttps://github.com/thearn/webcam-pulse-detector/issues/3#issuecomment-16453719 .
Sorry, was away. Just did a pull and all working now. Zero errors.
Sorry, this is still active. Pulled latest today, but still have the original bug:
bpm plot enabled
OpenCV Error: Assertion failed (mat.isContinuous()) in unknown function, file ..
\..\..\opencv-2.4.4\modules\core\src\opengl_interop.cpp, line 1153
Traceback (most recent call last):
File "get_pulse.py", line 131, in <module>
App.main_loop()
File "get_pulse.py", line 126, in main_loop
self.key_handler()
File "get_pulse.py", line 98, in key_handler
self.key_controls[key]()
File "get_pulse.py", line 65, in toggle_display_plot
self.make_bpm_plot()
File "get_pulse.py", line 84, in make_bpm_plot
bg = self.processor.grab_faces.slices[0])
File "e:\dev\libs-nosync\OpenMDAO\webcam-pulse-detector\lib\interface.py", lin
e 126, in plotXY
cv2.imshow(name,z)
cv2.error: ..\..\..\opencv-2.4.4\modules\core\src\opengl_interop.cpp:1153: error
: (-215) mat.isContinuous()
Same problem with 'D' part. Win, Python 2.7, OpenCV 2.4.5, OpenMDAO 0.8.1