jok23
jok23

Reputation: 296

How to segment anomalies on the glossy surface with opencv (c++)

I have an image of a glossy surface: enter image description here

My goal is to detect anomalies on that image. The same image with marked anomalies I show you here: enter image description here

As we can see from images above, anomalies have bad contrast (or at least not the best), and they are also changing from image to image by their shape, contrast, orientation... I was trying to increase anomalies contrast by using tophat filtering. The result is here: enter image description here Now I anomalies are much more visible on the image, I want to segment them out from the image. The aim is to binarize image and use connectedComponents function to calculate areas, dimensions, positions of anomalies...

What kind of segmentation do you suggest? What would be the best way to binarize image? Should I even use tophat filtering to increase anomalies contrast or should I try to segment anomalies directly from first image?

Upvotes: 0

Views: 853

Answers (1)

You can:

  1. try several top hat filters of different sizes and parameters, to see which one highlights the anomalies best while suppressing the finger prints.

or

  1. go directly to thresholding and adjust parameters there to make sure that none of the anomalies are lost in the process. Then use the features of connected components to extract the actual anomalies.

An increasingly popular approach is to train a deep neural network using lots of images of anomalies and then using the network to identify them.

Upvotes: 1

Related Questions