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:

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?



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.


Great advice. Thanks Jan