<br><br><div class="gmail_quote">On Sat, Jan 8, 2011 at 1:44 AM, Christopher Barker <span dir="ltr"><<a href="mailto:Chris.Barker@noaa.gov">Chris.Barker@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 1/7/11 10:14 AM, Narendra Sisodiya wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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 class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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"d suspect some smoothing may take care of it.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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><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><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 <> background_color) # background color a uint32<br>
BB = (rows.min(), rows.max(), cols.min(), cols.max())<br>
</blockquote></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>