Analyze Particles: wrong measurement in perimeter?

I have some doubts when Analyze particles is measuring the Perimeters. I did this test;


Each square is inclined 5° respect to the previous one. The dimension is 50x50 mm (200mm). The circles are 55mm of diameter.
Analyzing the value of the perimeter it has this kind of error (error vs degree):

WHY? Is giving me wrong results? Where am I wrong?

Hi @paolozanon,

the edges of binary objects are build by the square screen representation of pixels. Rotating the object will lead to some stair step artifacts as seen in the image below. Without having checked it in the ImageJ code in depth, a test shows that the perimeter is measured by following the pixels edges and not the angle of the particle edge with a straight line. Following a stair step outline always leads to a longer measured “path” as following the straight line. Depending on the degree of rotation the deviation is variable. This is what you have nicely shown in your graph.

This effect can be reduced when you get a selection around your object e.g. with the wand tool and then run Edit ► Selection ► Interpolate with 1 pixel to get the line in a more straight manner. Measuring this selection still shows a deviation but to a lower extent since it better resembles a straight line along the outline of the object.

6 Likes

Many thanks,
I have improved my macro starting from your good observation!
After many and many tests I have added the “Convex Hull” selection and I have found very good results, not only for geometric shapes but also for “strange” shapes, with a known perimeter.
Now this is the error of the squares in the pictures:

Thanks,
Paolo

5 Likes

Thanks @paolozanon and @Bio7. This is an important point—perhaps someone would care to add it to the Principles page? It would be great to mention it as a critical consideration when measuring images.

Thanks for sharing these results! @paolozanon Would you mind also sharing the macro code you used to measure these?