Adaptive threshold value of two value

Source: Internet
Author: User

The principle of binary value:

A grayscale image binary, in fact, is to find a threshold, so that the lower, gray level is greater than the threshold, set to 255, gray level is less than this threshold, set to 0.

Adaptive thresholding of threshold values:

Non-adaptive Two value, there is a problem, is that a threshold is often only corresponding to a class of images, if the image of the light darkened, the single threshold condition of the two value of the effect will be greatly discounted. Adaptive binary is actually a kind of image based on the gray histogram, to get a suitable two value threshold value of this picture.


This paper gives an adaptive threshold generation method, of course there are many kinds of methods, this article is just a method.

The principle of this program is very simple: as shown, blue represents a histogram of a grayscale image, to find a suitable mixed Gaussian distribution to approximate it. Mixed Gaussian distribution is actually the sum of two Gaussian distributions. We think that the gray values of the places where the two Gaussian distributions intersect are the thresholds to be selected.


So how do you find a Gaussian distribution that approximates it? I'm using a rather stupid method, take a variable t, and move the variable T, from left to right, through each grayscale. Each time the data on the left of T is considered as a set of samples to estimate a Gaussian distribution, the second Gaussian distribution is estimated by the data on the right of T as another sample. Combine the two Gaussian distributions into a mixed Gaussian distribution that matches the original data. As for the matching criteria can be arbitrarily selected, you can use the minimum mean square error, you can also use the minimum absolute value error, can also be related to the degree. With the traversal of T, we find the matching degree of each mixed Gaussian distribution to the original data, and choose the T value value of the most matched mixed Gaussian distribution as the threshold value.

The practice proves that the self-adaptability of this method is good and the robustness is better.


When changing the histogram, the matching effect of the Gaussian model is still a lot of good.

But there is a point that requires the processing of images, grayscale can not be too complex, as far as possible to conform to the mixed Gaussian model.


Adaptive threshold value of two value

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.