Segmentation of teeth/tissue

Hello

I am quite new at image processing, so would greatly appreciate some help/directions. I am trying to segment the teeth from the rest of the mouth in images similar to the one below.
I tried Weka but it is not accurate enough. I have not done any preprocessing of the images.
Thank you

dm_2015_005_cambria002%20-%20Copia%20(2)

Hi @J.Verne,
welcome to the forum!
Just wonder, what you consider as accurate and not accurate?
Can you show results that you already achieved?
Do you want to have teeth all together or as one single object?

1 Like

I would start by looking at HSB or Lab colour spaces.

2 Likes

ok thanks. i will be more specific.
i am trying to segment 2 classes: teeth and everything else. my goal is to obtain binary masks for a series of images.
my questions

  1. If i have a series of these images and i want to eventually train and apply a segmentation on the batch, should i normalize them in any way?
    Fiji (ImgLib) seems to have a normalize algorithm accessible through the expression parser (i could only find it there).
    And then there is Enhance Contrast for which we have the Histogram Equalization option.
    Which to use?
  2. Is there other preprocessing needed? Some noise reduction maybe (not sure which kind)?
  3. I studied the Weka segmentation manual and various threads and examples. As a result, I tried different features in the Weka trainer. I obtained what I think to be my best results when using Gaussian Difference + Variance (max sigma 4) + Laplacian + Kuwahara + default Fast Random Forest. Using various feature combinations yielded almost similar results. Even a Laplacian on its own did relatively well. So choosing the best one is subjective and based on staring at a few hundreds of these results until I thought some were better than others.
    Any suggestions here?
    You can see the probability maps below. class1 - tissue, class2 - teeth

class 1.tif (991.1 KB)
class 2.tif (991.1 KB)

  1. I am not sure how to process these probability masks to make them better and obtain binary masks that are very accurate in showing the teeth only. I would like to eliminate the classifications errors for both classes that are clearly wrong (to the human eye).

Thank you

@J.Verne,

If i have a series of these images and i want to eventually train and apply a segmentation on the batch, should i normalize them in any way?

I think the best strategy is to make sure that all the images have the same white balance, convert them to HSV (hue, saturation, value) color space and work with the Hue and Value channels. Just using the hue channel would allow you to get masks like that:
image
After that you can filter the images by keeping the largest object and do morphological dilation and erosion steps with closing the holes.
image

If you have many images you may still consider to use classifiers as Ilastik or Weka, but use HSV image as an input. The teeth have distinct hue and also differ by their Value-component from the part that gave a noise pattern in the image I showed first. Having them both in the classifier should fix this problem.

And then there is Enhance Contrast for which we have the Histogram Equalization option.

I don’t think it is good idea, because enhancing of the contrast is applied to each image individually, which may create problems if you continue with the classifiers.

Is there other preprocessing needed? Some noise reduction maybe (not sure which kind)?

It is difficult to conclude from the JPG-compressed image that you’ve provided, I think in your case you may do well without it. I recommend to use anisotropic diffusion (Perona-Malik) or I am constantly using BM3D filter (but I am not sure whether it is available in Fiji).

I would like to eliminate the classifications errors for both classes that are clearly wrong (to the human eye).

There are naturally errors, in our case we try to do as much automation as possible and whenever needed polish the models manually.

Ilya

Thank you for your help.
I split the image into HSV (HSB). Used the Hue image with Weka and obtained the following probablity map. I made a mask from it and overlaid it on the original and it looks good.
class2.tif (247.9 KB)
I will try the rest of your suggestions regarding the white balance and the noise reduction filters.
Thanks again

So I am following your instructions.
Use HUE channel - success
Keep largest object - success
Morph dilation/erosion/closing - success
Enhacing contrast does not help - tried it - you are right - succcess

Working on:
White Balance for all images
Aniso Diff
BM3D filter (n/a fiji correct)
Add Value channel to classifier

I am stuck at this one:

I looked into this but I do not know how to set white balance the same for all images. Can you please help? Thank you

@J.Verne,
if you were taking images at the same light conditions you might not really need that. I suggest to try without it first, unless you clearly see that teeth have different hue on different images.
In photography, I constantly adjust white balance, but I am not ready to say right away what would be the best procedure to do that in Fiji or Matlab.
The quick search gives:


or
https://se.mathworks.com/help/images/comparison-of-auto-white-balance-algorithms.html

I hope that helps!
Ilya

Thanks! They have different Hue histograms…
I will look at your links.