Dajing method (maximum inter-class variance, adaptive threshold) Image segmentation _deb

Source: Internet
Author: User

Transferred from http://hi.baidu.com/niiuniu1127/blog/item/5ac703da2e1b62deb6fd48bd.html

The maximal inter-class variance method, which was proposed by Japanese scholar Otsu in 1979, is an adaptive threshold determination method, also known as Otsu
Law, referred to as Otsu. It is according to the gray character of the image, the image is divided into the background and the target 2 parts. Inter-class variance between background and target
The larger the 2 parts of the image, the greater the difference, when part of the target error is divided into background or part of the background error divided into the target will lead to 2 parts
The difference between the points becomes smaller. Therefore, the division of the maximal variance between classes means that the probability of error is the least.

For the image I (x,y), the foreground (i.e. the target) and the background segmentation threshold are recorded as T, and the number of pixels belonging to the foreground is the ratio of the whole picture.
The average gray level of μ0 and the ratio of background pixel to the whole image is ω1, and the average gray level of ω0 is μ1. Total average of images
The gray scale is μ and the variance between the classes is G.

Assuming the background of the image is darker and the image is of MXN size,
The pixels in the image are less than the threshold T of the number of pixels as N0, pixel grayscale is greater than the threshold t of the number of pixels recorded as N1, then there are:
Ω0=N0/MXN (1)
Ω1=N1/MXN (2)
N0+N1=MXN (3)
Ω0+ω1=1 (4)
Μ=ω0*μ0+ω1*μ1 (5)
G=ω0 (μ0-μ) ^2+ω1 (μ1-μ) ^2 (6)
The formula (5) is substituting (6) to obtain an equivalent equation:
G=ω0ω1 (μ0-μ1) ^2 (7)
Using traversal method to get the maximum threshold of variance between classes
T, that is the request.

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.