I have been working on a system to detect epileptic seizures (fits) to raise an alarm without requiring sensors to be attached to the subject.
I am going down three routes to try to do this:
- Reduce the size of the image by averaging pixels into ‘meta pixels’ – I do this using the openCV pyrDown function that does the averaging (it is used to build image pyramids of various resolution versions of an image). I am reducing the 640×480 video stream down to 10×7 pixels to reduce the amount of data I have to handle.
- Collect a series of images to produce a time series of images. I am using 100 images at 30 fps, which is about 3 seconds of video.
- For each pixel in the images, calculate the fourier transform of the series of measured pixel intensities – this gives the frequency at which the pixel intensity is varying.
- If the amplitude of oscillation at a given frequency is above a threshold value, treat this as a motion at that particular frequency (ie, it could be a fit).
- The final version will check that this motion continues for several seconds before raising an alarm. In this test version, I am just highlighting the detected frequency of oscillation on the original video stream.
Test Set Up
- Blue = <3 hz="" li="">
- Yellow = 3-6 Hz
- Red = 6-9 Hz
- White = >9 Hz
- No motion detected near the stationary 0 Hz circle (good!).
- <3hz 1="" 2="" and="" circles="" detected="" good="" hz="" li="" motion="" near="" the="">
- 3-6 Hz motion detected near the 2,3,4 and 5 Hz circles (ok, but why is it near the 2Hz one?)
- 6-9 Hz motion detected near the 5 and 6 Hz circles (a bit surprising)
- >9Hz motion detected near the 4 and 7 Hz circles and sometimes the 8Hz one (?)