Re: Locate The Center of WhiteDot from a Image

Garrett Davis <[email protected]>
Newsgroups gmane.comp.python.image
Message-ID <[email protected]>
  Narendra Sisodiya wrote:

 > Now, I want to locate the center of whitedot.
 > 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.

I would recommend using the getbbox() method, as Christopher Barker 
has already pointed out, along with one of these two techniques:

a) shrinking the size of the image to, say, 16x16, so that the 
smaller 'noise' dots disappear or turn into small grey dots, and then 
apply, or re-apply, the 'point' method discussed in an earlier thread 
to erase them;

b) using a 'centroid' algorithm to determine a 'center of mass' which 
would not be affected much by small amounts of 'noise'.

Fred Lundh had kindly provided this list with such an algorithm, here:
http://mail.python.org/pipermail/image-sig/2008-August/005149.html

I use both methods in my application - detection of cars on a 
racetrack for timing and scoring purposes - with good results, and 
with no performance problems when processing larger images at 10 frames/second.

Garrett Davis


_______________________________________________
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.