-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Now HR can be obtained through the device's back camera. Feature #376 #981
base: master
Are you sure you want to change the base?
Conversation
@rochoSC - this is a really interesting idea. I am curious if you have had the opportunity to compare accuracy against the HR taken via the watch/HealthKit. This would be interesting as a way to gather Heart Rate for users without a watch however I do have some concerns about multiple Heart Rate sources and potentially differing data. |
@kelseydedoshka-apple Thanks for taking a look at it! I totally agree, the HR estimates provided from difference sources should be congruent. I could not compare the results obtained from this against those of the smartwatch just because I don't have one, however, I informally compared the results I was getting with those of a Empatica E4 device, a clinical quality wearable device designed specifically for HR obtention. The results were very close with an average error of about 2 to 3 BPM. |
@rochoSC - thats great, and exciting to hear the results were so close. Do you envision a user utilizing this step and then writing that data to HealthKit for analysis later? I would love to understand what your use case for this was and how effective you found it? Again I have a few reservations about the secondary source of HR data but if used appropriately I think this could be really valuable to users. |
@kelseydedoshka-apple Being completely honest I didn't have a use case that motivated me to do this. The reason why I decided to contribute its because I have been working with this PPG stuff on smartphone cameras (specifically with an Ipod touch) for my Master thesis. When I read about the Research Kit library, I though that since the only way a user can get their HR is trough the smart watch, it may be a good idea to incorporate another way to get such information for people who don't own a SmartWatch. So, I would say that I envision the usage of this step as an alternative of measuring the HR after certain tasks or activities as required. On the other hand, about the reservations you have about the secondary source, I totally understand. I would say that there are two ways to ensure that this measurements are coherent among them. The first one is to validate the HR obtained from the camera with that of the smartwatch and do whatever its required to match the HR of the smartwatch. The second and easiest in terms of development its simply match the algorithm that is being used to get HR from the smartwatch PPG signal and apply such algorithm to the PPG signal obtained from the camera. However, I don't think the code for such HR is available. I hope I addressed all your questions, if I did't please let me know and I will try to explain myself better. |
@rochoSC - I love to hear that you considered contributing this while doing your thesis. This use case you have mentioned for gathering HR from non smart watch users is a really interesting one to consider and I appreciate your thoughts on how to handle multiple sources of data. I am interested to throw this idea around to some other folks on our side to get feedback from them as well, and would be interested to keep this discussion open as I gather more input. |
@kelseydedoshka-apple That sounds awesome, thanks for considering this contribution. I'm looking forward hearing back from you guys! |
This is a great feature, particularly for the health sciences! Why has it not yet been merged into the master? |
Hi @srinathtm-apple , is Apple still considering this feature to be available in ResearchKit? |
I used the VideoCaptureStep as a guideline and created a new step that uses the device's back camera and measures user's heart rate. The step uses an FFT based approach to estimates the HR of the user every second once the measurement is started and enough samples have been collected (64 samples just to start showing information, supposing we are sampling at 30FPS we are talking about 2 seconds). The step retrieves a list of estimated HR values during the given session that can last no more than 2 minutes and no less than 20 seconds. #376