I want to calculate the number of people in a pool, for a statistic usage. I will use artificial intelligence and image processing on the images generated by a security camera located on the ceiling of a pool. The camera is static, so it has no axis of rotation.
For the image processing step, I would like to focus on the swimmers, and try to remove the rest of the pool. I need a good contrast between the background and the swimmers.
The problem is that output images of the camera have a lot of "noise", such as sunlight, rays of light, black lines at the bottom of the water, flags in the air and cables for sparation corridors.
Here is an example of what the images look like. The real images will just be in better quality, because this example is taken from a picture of the output using my cellphone.
Because the camera does not move, I can obtain other images, with the same background (excepts for the sunrays) and maybe I could use the differences on the images to extract swimmers?
I am looking for any ideas/filters/references.
My suggestion is to analyse the image into HSV space. For information H (hue) corresponds to the colors. S (saturation) is the purity of the color.
If you are using matlab use the function rgb2hsv() in opencv use cvCvtColor() to convert the color space.
Here is a little experiment I have done on your image. I have converted the image to HSV space. and I have posted the false color map of it. Now with this what u may do is clustering something like k-means to identify the people.
exact commands to regenerate it in octave/matlab is:
>> im = imread( '9Nd5s.png' );
>> hsv = rgb2hsv( im );
>> imagesc( hsv(:,:,1) ), colormap( hot )
Hope this is helpful, let me know if u need any more help. your problem seems interesting to work upon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With