<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1614" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=042491217-20082008><FONT face=Arial color=#0000ff size=2>One
option is to use Numpy/Scipy:</FONT></SPAN></DIV>
<DIV><SPAN class=042491217-20082008><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=042491217-20082008><FONT face=Arial color=#0000ff size=2>import
Image</FONT></SPAN></DIV>
<DIV><SPAN class=042491217-20082008><FONT face=Arial color=#0000ff size=2>import
numpy as n</FONT></SPAN></DIV>
<DIV><SPAN class=042491217-20082008><FONT face=Arial color=#0000ff size=2>im =
Image.Open(...)</FONT></SPAN></DIV>
<DIV><SPAN class=042491217-20082008><FONT face=Arial color=#0000ff
size=2>data = n.asarray(im)</FONT></SPAN></DIV>
<DIV><SPAN class=042491217-20082008><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=042491217-20082008><FONT face=Arial color=#0000ff size=2>There
is a center_of_mass function in scipy.ndimage.measurements.</FONT></SPAN></DIV>
<DIV><SPAN class=042491217-20082008><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=042491217-20082008><FONT face=Arial color=#0000ff
size=2>Andrew</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
image-sig-bounces+hawryla=novachem.com@python.org
[mailto:image-sig-bounces+hawryla=novachem.com@python.org]<B>On Behalf Of
</B>Ashish Asgekar<BR><B>Sent:</B> 19 Aug 2008 10:31 PM<BR><B>To:</B>
image-sig@python.org<BR><B>Subject:</B> [Image-SIG] PIL - 1.1.6,
Centroid<BR><BR></FONT></DIV>
<DIV dir=ltr>Hello<BR> I was looking for Centroid function in
Python and downloaded PIL-1.1.6. I learnt that Centroid function is available
as Crack Code. However, when I search for CrackCode, I find it is not
available anymore from PythonWare.<BR> My questions
are:<BR> 1) Is CrackCode
available in PIL-1.1.6 in some other
form?<BR> 2) Can I
compute Centroid of an image using some other existing function? <BR
clear=all><BR> Thank
you.<BR> --
ashish<BR><BR>--
<BR>-----------------------------------------------------------------------------<BR>Dr.
Ashish Asgekar<BR>Physics Group,<BR>BITS Pilani-Goa Campus,<BR>Zuarinagar,
Goa.<BR>India 403 726<BR><BR><A
href="http://www.bits-goa.ac.in/Departments/Physics/Faculty.htm">www.bits-goa.ac.in/Departments/Physics/Faculty.htm</A>
<BR>-----------------------------------------------------------------------------<BR></DIV></BLOCKQUOTE></BODY></HTML>