📜 ⬆️ ⬇️

Binarization (practice part?)

My article on binarization

Practical application



How to ask to implement some of the methods I wrote about. What you will not do for the sake of interest and people.
')
I'll start small and simple:
Implemented

Binaryization with lower and upper thresholds

The simplest implementation is the upper (lower) thresholds, if the amplitude of the pixel below (above) the threshold turns black, the rest is white.
I will give an example of only the lower limit, since essentially the upper limit is the inverse.
Take for example 3 pictures, which, in my opinion, cause a lot of complexity.

First:
The difficulty lies in finding the edges, because the drop is quite low between the edges.
Second:
The flower is very small, the difference between the girl and the background is also very small, which makes the task heavier.
Third:
I will leave the last one without comment.

Dual threshold threshold binarization

The method consists in the fact that the value of the amplitudes of the pixels that are in the range [a, b] - turn black, which are not included in white.

Borders set just to show different options.

Ots Method (Otsu)

The link above describes the algorithm. Otsu method reference


Yanni Method

The method consists in finding the maximum values ​​of the amplitude of gray g max and the minimum value of the amplitude of gray g min . Next is the average number of pixels that fell into the range from the minimum to the middle. This is how the optimal Yanni (Yani) threshold is calculated:

The results of the Yanni (Yani) threshold:


Medium method

The method consists in finding the minimum g min and maximum value g max of the amplitude of gray and finding the average value between them.

T opt = (g max -g min ) / 2;



findings

As you can see, each method is developed for a specific area and its use does not always find application in other areas. Also, there are still a lot of methods for analysis, both local and global, I will try to further implement the methods and provide you with the results of their work.

Thanks for attention.

PS If there are errors, write correct.

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


All Articles