Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added video processing support with automatic tracking start\reset #49

Open
wants to merge 4 commits into
base: no_openmdao
Choose a base branch
from

Conversation

Serhiy-Shekhovtsov
Copy link

  • Tracking starts automatically when face is stable for N seconds.
  • Tracking restarts automatically when face is not detected for some time or if it moves out of the range.
  • The face frame is stabilized for better performance.
  • Added a video processing example in get_pulse_from_video.py

@connormeaton
Copy link

@Serhiy-Shekhovtsov When I run get_pulse_from_video.py I get this error:

Traceback (most recent call last):
  File "get_pulse_from_video.py", line 214, in <module>
    print([int(val) for val in App.processor.results])
AttributeError: 'findFaceGetPulse' object has no attribute 'results'

Any ideas how to fix? Thank you.

@Serhiy-Shekhovtsov
Copy link
Author

@cmeaton do you have the same issue when running my fork?

@connormeaton
Copy link

connormeaton commented May 26, 2020

@Serhiy-Shekhovtsov Hmm, it all of a sudden runs now, but breaks quickly. It shows a video I recorded from my webcam (.mov) for a few seconds then crashes with this error:

Traceback (most recent call last):
  File "get_pulse_from_video.py", line 211, in <module>
    App.main_loop(frame)
  File "get_pulse_from_video.py", line 167, in main_loop
    self.make_bpm_plot()
  File "get_pulse_from_video.py", line 124, in make_bpm_plot
    bg=self.processor.slices[0])
  File "/Users/asi/connor_asi/webcam-pulse-detector/webcam-pulse-detector/lib/interface.py", line 72, in plotXY
    bg = cv2.resize(bg,(wd,int(h)))
cv2.error: OpenCV(4.2.0) /Users/travis/build/skvark/opencv-python/opencv/modules/imgproc/src/resize.cpp:4048: error: (-215:Assertion failed) inv_scale_x > 0 in function 'resize'

This happens right after the pulse function (dark green box) starts on the video. It also takes ~10 seconds of video time before the pulse function starts counting down to start. Is this normal?

@Serhiy-Shekhovtsov
Copy link
Author

Not sure what the plotXY is doing here and why it crashes tbh. As for the delay with counting - it's normal. The app will wait for the face to stabilize and the processing will start when enough data has been collected: https://github.com/Serhiy-Shekhovtsov/webcam-pulse-detector/blob/no_openmdao/lib/processors_noopenmdao.py#L176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants