How to remove image noise (horizontal lines) while filling the hyperbolas? Idea requested :)

205 Views Asked by At

I have an image as showin in '1'. I applied Hessian filter to get the result '2'. I applied Standard filter (stdfilt) in MATLAB to get the result as in '3'.

I wish to combine these two results into a single image such that:

  • the horizontal lines (noise in my case) are removed.
  • the hyperbolic areas are filled.

How could I obtain such a result?

Original (1):

Original Image

Hessian (2):

Hessian

stdfilt (3):

stdfilt

Last two without markups:

Hessian_copy

stdfilt_copy

1

There are 1 best solutions below

0
Michael Sohnen On

You can start by binarizing your image. I recommend opencv otsu threshold. it will be hard to solve this problem if gradients are present. After the image is binarized, you will need to fix bridging between the parabolas and the horizontal lines. I recommend morphological erosion, but I am still experimenting with this in my own projects. After that, you can use watershed or DBSCAN to flood-fill each region with a given marker or color. You can then filter out the horizontal lines by pixel count, since they will be much larger than a single parabola. If erosion+DBSCAN doesn't work reliably, you can look into opencv's connectedComponents function.

See:

https://iq.opengenus.org/connected-component-labeling/
https://scikit-learn.org/stable/modules/generated/sklearn.cluster.DBSCAN.html
https://docs.opencv.org/4.x/d3/db4/tutorial_py_watershed.html