What should be the ideal threshold method for enhancing parts of an image?

enter image description here

What threshold technique should I use for the image to highlight the bright areas inside the image, as well as the outer border.

The im2bw function does not give a good result

Help !!

Edit: most of my images have the following histogram

enter image description here

Edit: found a triangle threshold method that is suitable for my work :)

enter image description here

+6
source share
2 answers

Your question is not very easy to answer, since you really do not determine which ideal solution should be implemented.

Have you tried im2bw(yourImage, 0.1); ? I use the threshold for which parts should be black, and parts of the shifts should not. I got the results of the descent with this (depending on the purpose, of course). Try it, and if it’s not enough, tell us how you need to improve it, and I will try to help with more advanced methods!

EDIT: Using a threshold of 0.1 and 0.01, respectively, maybe something ~ 0.05 should be fine?

Using threshold 0.1

Using threshold 0.01

+5
source

It looks like you want to do this “image segmentation” (see http://en.wikipedia.org/wiki/Segmentation_(image_processing )).

Most methods are based on the Chan-Vese model, which identifies a region of interest by solving an optimization problem that includes a level set function. Since you are using Matlab, this code: http://www.stanford.edu/~tagoldst/Tom_Goldstein/Split_Bregman.html should well find the regions you are interested in.

+1
source

Source: https://habr.com/ru/post/908031/


All Articles