Looking for some tips


I am trying to find the area of these hills. I am having trouble using the threshold to obtain any kind of feasible data. I have been trying different filters, using various contrasts, and other plugins. This seems to be the best I can get the picture to outline the areas I need. Does anyone know of a way I can measure the area of these bubbles?

Before Picture.

Good day Steve,

bearing in mind that good image acquisition is the best image processing, you should try to avoid the vertical illumination gradients and the horizontal band-like structure.



These images are taken with an X-ray machine. I will pass on the information, but I am not sure there is much that can be done about the horizontal band-like structures, which is the bulk of my problem.

Hey @FirstImagej

It’s true your image quality is not ideal… I’d say another big issue it the variation in background that you’re seeing - the shadows at the top/bottom of the image.

But I gave it a go… trying to deal with that background variation. This protocol should be ‘safe’ if you are primarily interested in the area of your objects:

  1. Duplicate the image and name it “background”
  2. Apply a Gaussian blur to the “background” image - with sigma=30
  3. Use the Image Calculator to subtract the “background” image from your original image. Note: create a 32-bit float image as a result
  4. Then use that resulting image in the MorphoLibJ plugin’s Morphological Segmentation tool. Here is a snapshot of the segmentation I got and the settings I used:

11 AM

It’s still not ideal, but is a start.

Here are some other helpful links for Segmentation in ImageJ/Fiji:

I hope this all helps!




I forgot to mention that the sample image suffers from considerable noise.

“These images are taken with an X-ray machine.”

Well accepted but what does it explain?

In any case, uneven illumination and noise appear to be the main problems with the sample image.



Thanks! I’ll give this a go, and report back after I read some of those links.

1 Like

I am not sure the X-Ray Technician has the capability to improve on the illumination and noise. Which means, I need a possible work around to this problem.

You could try filtering the horizontal line artifacts via Fourier Transform (FFT)

  • Convert to 32-bit (Image > Type > 32-bit)
  • Process > FFT > FFT
  • Draw two narrow rectangular selections on the central vertical line of the spectrum and erase this part of the image (press X)

  • Process > FFT > Inverse FFT


On this image (after inverting it to make the edges bright), I was getting reasonable results with Morphological Segmentation (similar to @etadobson’s suggestion, but I was using the Border Image option as the edges are already reasonably bright in your image):

As @etadobson suggested, you’ll have to do some shading correction to address the current under-segmentation at the image borders.