I need to do this too. Could you possibly keep the list updated with your findings?<br><br><br><br><div class="gmail_quote">On Fri, Jan 7, 2011 at 8:26 PM, Narendra Sisodiya <span dir="ltr">&lt;<a href="mailto:narendra@narendrasisodiya.com">narendra@narendrasisodiya.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br><br><div class="gmail_quote"><div class="im">On Sat, Jan 8, 2011 at 1:44 AM, Christopher Barker <span dir="ltr">&lt;<a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>On 1/7/11 10:14 AM, Narendra Sisodiya wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
This Code Look for bounding box which I am calculating by scanning each<br>
row and column one by one. If I am finding any white pixel, I am<br>
including it into my bounding box.<br>
</blockquote>
<br>
</div><div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
1) there may a change that 2 or more WhiteDOT may present. One is Big<br>
whiedot and other are very smaller whitedot(just 2-3 pixel) near to this<br>
Big whitedot.<br>
</blockquote>
<br></div>
Not sure about this one off the top of myhead, but I&quot;d suspect some smoothing may take care of it.<div><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I am applying this<br>
algorithm on every frame taken from camera at 2fps. So I want a high<br>
speed algorithm. PIL must be having some function or trick to do it.<br>
</blockquote>
<br></div>
The Image..getbbox() method should do it.<br>
<br></blockquote></div><div><br>Thanks, I tried getbbox on wrong image. Now I am using getbbox and I am getting proper result that too very fast.<br> </div><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


If you need more math, numpy can help. Somethign like:<br>
<br>
a = np.asarray(PIL_image)<br>
background_color = 0<br>
rows, cols = np.where(a &lt;&gt; background_color) # background color a uint32<br>
BB = (rows.min(), rows.max(), cols.min(), cols.max())<br>
</blockquote></div></div><br><br>I am unable to get what that code means ?<br>May you explain how I can use above code with getbbox ? Or the above code using NumPy is alternate of getbbox method ?<br>IF yes, then which will be the faster ?<br>

<br>PS: I have looked at centroid algorithm, It is again going at pixel level and that will be slow. My application will become better with faster centroid algorithm.<br><br><br>Also I have another question !<br>I am grabbing image from camera using opencv-python. How we can compare python PIL with OpenCV ? My guess that PIL will is faster then opencv library ?<br>

<br>
<br>_______________________________________________<br>
Image-SIG maillist  -  <a href="mailto:Image-SIG@python.org">Image-SIG@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/image-sig" target="_blank">http://mail.python.org/mailman/listinfo/image-sig</a><br>
<br></blockquote></div><br>