Taking photo every 66 milliseconds on Android phone for colour analysis (Heart Rate Monitor)

风格不统一 提交于 2019-12-09 06:32:20

问题


I'm doing a final year project at university which involves making a medical application for Android, as a practice I have to make a heart rate monitor app.

I have worked out that the best way to do this is to look for colour changes in your blood when holding the camera against your finger with the flash switched on.

This is where the problems come into play, is it possible to take a photo every 66 milliseconds on the camera, then compare each pair of photos for any intensity changes in order to count a heart beat? or am I better off recording a video and analysing each frame looking for a change.

Heck is it even possible to just look at the video preview and compare each frame.

The questions I need answering for this problem are neatly listed below

  • What is the best method for this, taking photos, recording video or looking at the live preview.

  • Is there any posts or pages I can visit on the internet where people have attempted similar things

  • Anyone got a basic method I should do to get two images that I can compare within the time frame.

  • Lastly If I do take the basic take a picture every 66 milliseconds approach, what can I do to ensure the picture is taken at the correct time intervals


回答1:


What is the best method for this, taking photos, recording video or looking at the live preview.

I would think that live preview would be the right answer. Taking photos is not -- they will not happen anywhere near that quickly. Recording video and post-processing it would be possible, but I fail to see how this will be applicable for a real-time heart monitor.

Is there any posts or pages I can visit on the internet where people have attempted similar things

You can examine the Barcode Scanner source code, which uses the live preview to scan for barcodes.

Lastly If I do take the basic take a picture every 66 milliseconds approach, what can I do to ensure the picture is taken at the correct time intervals

Android is not a hard RTOS. AFAIK it will be impossible for you to precisely time things to be 66 milliseconds.



来源:https://stackoverflow.com/questions/7320140/taking-photo-every-66-milliseconds-on-android-phone-for-colour-analysis-heart-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!