Identifying Round Objects

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Identifying Round Objects

panovr
Hi,
  Matlab has a demo named : "Identifying Round Objects" in the
Image Processing Toolbox, which using bwboundaries, a boundary tracing
routine.
  I want to do the same task in ImageJ,
and I want to know if there are some guides showing how to
complete this task, or there is a plugin which can do boundary tracing?
Otherwise, maybe I should write it myself?
  Thanks!

reference
http://www.mathworks.com/products/image/demos.html?file=/products/demos/shipping/images/ipexroundness.html
Reply | Threaded
Open this post in threaded view
|

Re: Identifying Round Objects

Michael Schmid
Hi Yili,

you can simply use the equation given there in ImageJ:
   4*pi*area/perimeter^2

Make sure you have "Area" and "Perimeter" checked in the Measurement  
options and use "Analyze Particles". Then, use either a spreadsheet  
or a simple macro to determine this quantity for your objects.

for (i=0; i<nResults; i++) {
   perimeter = getResult("Perim.",i);
   area = getResult("Area",i);
   setResult("metric", i, 4*PI*area/(perimeter*perimeter));
}

Due to the ragged outlines caused by single pixels, a circle won't  
give you a 'metric' value of 1, but only slightly above 0.9,. A  
square will give you pi/4 in the ideal case, but values like 0.82  
might also occur (again, because of finite pixel size).

Michael
________________________________________________________________

On 25 May 2011, at 16:27, Yili Zhao wrote:

> Hi,
>   Matlab has a demo named : "Identifying Round Objects" in the
> Image Processing Toolbox, which using bwboundaries, a boundary tracing
> routine.
>   I want to do the same task in ImageJ,
> and I want to know if there are some guides showing how to
> complete this task, or there is a plugin which can do boundary  
> tracing?
> Otherwise, maybe I should write it myself?
>   Thanks!
>
> reference
> http://www.mathworks.com/products/image/demos.html?file=/products/ 
> demos/shipping/images/ipexroundness.html