Measuring an object area using imagej

Dear All,

I used both edge detection and particle analysis to measure the area of a ball bearing in the image. I have no idea why these two approaches provide me with different results.
The edge detection approach found an area of 2.22mm2 while the particle analysis approach found an area of 1.86mm2.
ball
edge


Thanks
Vincent

Hi,
The Find Edges command uses Sobel convolution as described here:
https://imagej.nih.gov/ij/docs/guide/146-29.html#toc-Subsection-29.3

This leads to slight enlarging of the boundaries.

Here are your original image and edges image overlaid in red and green

1 Like

I assume you have used ‘Find Edges’ for edge detection.
This function calculates the edge magnitude based on the Sobel operator.
According to this operator pixels with highest edge magnitude are actually on both sides of your ‘binary’ object contour obtained by thresholding and using the wand tool (Particle Analyzer is doing exactly this).
The result of ‘Find Edges’ can be studied in more detail on a 32bit version of your image.
To answer your question:
The edge detection approach includes pixels outside of the ‘binary’ contour into the measurement.
This explains the differences.
… sorry for the duplication

1 Like

Thanks for the reply. Is there any way to contour the ball without enlarging the boundaries because it overestimates the area of the ball… Or can we do some preprocessing so that the correct boundaries can be selected?

Yes I used ‘Find Edges’ for edge detection. You don’t need thresholding to obtain object contour. You can obtain object contour by ‘Find Edges’ turn the image to 8 bit and select the boundaries using wand tool. I prefer the edge detection approach because it doesn’t require me to adjust the threshold value for the image as I found that I got different area if I chose a different threshold value and the result is not consistent…

ball2

Maybe you can use the function <Image/Selection/Enlarge…> to shrink your contour 1 pixel ( value -1 ).

Hi phaub,

I can’t find the <Image/Selection/Enlarge…> function
could you show me where is it?

I think Edit>Selection>Enlarge is what was meant.