Re: Perimeter measurement

Posted by Michael Schmid on
URL: http://imagej.273.s1.nabble.com/Perimeter-measurement-tp3696992p3696997.html

Hi Olga,

there are many ways how to define the perimeter.

For rectangular selections, ImageJ does take the (rectangular)
outline of a rectangle, so a rectangular selection of 1x1 pixel
has a perimeter of 1. The same for a polygon that happens to
be a 1x1 pixel square (e.g. the convex hull).

For a circle with diameter 1, the outline is pi=3.14159...
(even though one pixel is selected and the pixel has a square
outline).

If another type of selection happens to have only one pixel
selected, e.g. the result of clicking with the Wand tool,
ImageJ cuts the corners because such an operation will usually
result in a weird shape. If you follow the outline of such a
shape along the pixel boundaries, you would get a perimeter
that is too large for objects having sides not parallel to
the x or y axes.

---

Apart from this, I have the impression that the perimeter for
composite selections is not given correctly:

A single 10x10 square has a perimeter of 40 (rectangular) or
37.65 (traced by wand). Two separate 10x10 squares have a
perimeter of 60, three of them have 90, etc.

So it seems that there is a problem with the perimeter, but not
that of a single pixel.

Michael
________________________________________________________________

On 5 Mar 2008, at 12:37, OlgaFishkis wrote:

> Hello,
> Could someone explain me please why if I measure a square particle  
> 1x1 sq.
> px the values of the area is correct (1 sq px) but the perimeter is  
> 2.8
> instead of 4 px?
> If I apply a macro to measure a convex hull of the same square  
> particle I
> get  the right value of the perimeter - 4.
> Thank a lot
> Olga