I have seen a research paper that did breathing detection, but it relied on fitting the output of the Kinect to a skeleton model to identify the chest area to monitor. I would like to do it with a less calculation intensive route, so am trying to just use image processing.
To detect the small movements of the chest during breathing, I am doing the following:
|Start with a background depth image of empty room.|
|Grab a depth image from kinect|
|Subtract Background so we have only the test subject.|
|Subtract a rolling average background image, and amplify the resulting small differences - makes image very sensitive to small movements.|
|Resulting video shows image brightness changing due to chest movements from breathing.|
We can calculate the average brightness of the test subject image - the value clearly changes due to breathing movements - job for tomorrow night is to do some statistics to work out the breathing rate from this data.
The source code of the python script that does this is the 'benfinder' program in the OpenSeizureDetector archive.