Locate The Center of WhiteDot from a Image

Narendra Sisodiya <[email protected]>
Newsgroups gmane.comp.python.image
Message-ID <[email protected]>
Dear All,
      the given image has only two level. Pixel are either black or white.
See this image - http://www.flickr.com/photos/nsisodiya/5333747510/
Now, I want  to locate the center of whitedot.
This can be done by locating the bounding box of white dot.
I have used following algorithm
https://gist.github.com/769847
This Code Look for bounding box which I am calculating by scanning each row
and column one by one. If I am finding any white pixel, I am including it
into my bounding box.
After this, I can calculating mid of box.
Now, Here is the problem with the code.

1) there may a change that 2 or more WhiteDOT may present. One is Big
whiedot and other are very smaller whitedot(just 2-3 pixel) near to this Big
whitedot.
So, I am getting bigger bounding box.

I want to get center based on density of whitepixel. basically center where
white pixel density is very high. Also, I am applying this algorithm on
every frame taken from camera at 2fps. So I want a high speed algorithm. PIL
must be having some function or trick to do it.



-- 
┌─────────────────────────┐
│    Narendra Sisodiya
│    http://narendrasisodiya.com
└─────────────────────────┘

_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.