Increase / decrease shape boundary by 1 pixel

I am measuring SEM images converted to binary threshold images and then run through particle analyzer. My process is:

  1. Despeckle
  2. convert to 8-bit
  3. threshold about 0-5%
  4. analyze particles.

I want to be able to measure the area of the particles if I was to change the boundary outwards or inwards. I want to use this as an indicator of error in my area estimates in my threshold technique.

Original image: https://www.dropbox.com/s/hvj2lyj7kradjrc/Original%20Image.png?dl=0
Particles: https://www.dropbox.com/s/t7xfqv7yrjyb3aa/Particle%20Mask.png?dl=0

Hi @MaltyWhench,

I like reading about quality/error measurement of segmentations.
If you have an selection (or ROI), you can use the menu Edit > Selection > Enlarge to enlarge the selection. If you enter a negative amount of pixels, you can also shrink it.
If you have a mask (or binary image), you can use the menu Process > Binary > Dilate to enlarge it and Process > Binary > Erode to shrink the area.

Furthermore, you can easily switch between selections and masks using the menus Edit > Selection > Create Selection and Edit > Selection > Create Mask.

Does that help?

Cheers,
Robert

2 Likes

The Binary method is perfect.

I believe if I use the ROI method, this would only apply the enlargement to the active selection and cannot be applied to multiple ROIs.

Thanks alot!!

1 Like

You can iterate over all ROIs in the ROI Manager using a loop in a script. With Process > Binary > Dilate, nearby regions can fuse together, whereas they can stay as separate (partially overlapping) regions when using Edit > Selection > Enlarge in a loop. Use whatever fits your needs best.

3 Likes

Great advice. Thanks Jan