Edge feature-based binarization Threshold Selection Method-ywp125

Source: Internet
Author: User
Edge feature-based binarization Threshold Selection Method

Summary Threshold selection is the basis of image processing and analysis. The experiment results are compared by computer simulation based on several common automatic threshold selection methods for image binarization. On this basis, a new image binarization algorithm is proposed. This algorithm focuses on retaining the edge features of an image when the image is binarization. Experimental results show that this algorithm based on edge feature detection operator can well retain the edge features of the source image and process low-quality images.KeywordsImage segmentation image processing binarization image segmentation is an important means of image molecular processing. Its purpose is to separate the target region from the background region from the image. There are many methods for image segmentation. the most simple and effective method is threshold processing. By selecting one or several appropriate grayscale thresholds, the target and background in the source image are easily separated. How to select a threshold to achieve effective segmentation is the key to threshold processing.1Several typical algorithms1.1 average gray value method This method uses the average gray value of all pixels in the image as the threshold value. The threshold value is calculated by the following formula: N indicates the total number of pixels, L indicates the maximum gray level, and f (I, j) indicates the gray level of the vertex. This method is easy to calculate and is very effective for images with high contrast, but less effective for images with low contrast. The 1.2 class variance method divides an image into foreground and background based on a threshold. different thresholds can be used to obtain different class separation performance, CATEGORY variance reflects the performance of classification. The category variance automatic door restriction method uses the category variance as the judgment basis, and selects the threshold that minimizes inter-Class Variance and intra-Class Variance as the optimal threshold. Set the gray scale range in the image to G = {0, 1, 2 ,..., L-1}, select the threshold T will be divided into two categories: 1.3 maximum entropy method because entropy belongs to a uniformity, uniformity with entropy to Measure 3, you can export the Maximum Entropy Threshold Method: set T as the threshold, and the target gray distribution is P0/Pt, P1/Pt ,..., Pt/Pt, where ,. Likewise, the background gray distribution is Pt + 1/(1-PT ),..., PL-1/(1-PT), partial entropy of target is partial entropy of background, and entropy of histogram is E (t) = e1 (t) + E2 (t) E (t) the maximum value indicates that the gray distribution of the target region and the background region has the largest identity, and t indicates the threshold value of the two regions. This method is slow because it involves logarithm operations, but it can produce better segmentation effects for images of different target sizes and signal-to-noise ratio. None of the above algorithms consider retaining the features of the original image during binarization.2Edge feature-based binarizationEdge features are important features in text recognition, fingerprint recognition, and other applications. They are critical to the success of recognition. Therefore, in the binarization preprocessing process in these applications, we hope to better retain the edge features of the original image without adding new edge features. Key to the algorithm concept: first, use a differential operator to detect the edge of an image, and then automatically select the binarization threshold on these edge pixels. Finally, for other non-edge pixel points, the conventional method is used for binarization. The algorithm is described as follows: // F is the input image after noise removal, and G is the binarization image ① edge features are extracted from F to obtain edge image E; ② perform conventional binarization processing on e to obtain Binary Image B; ③ use the overall threshold method to determine the overall threshold of F; ④ determine the threshold corresponding to each pixel of F; ⑤ output the binary image G Based on the obtained threshold value. The source image may contain noise. To remove noise before processing, you can use the mean filter or median filter, or select a more complex method, such as adaptive filtering. In step ① Edge Extraction Using Sobel operator: | f (I-1, J-1) + 2f (I-1, j) + f (I-1, J + 1) -[f (I + 1, J-1) + 2f (I + 1, J) + f (I + 1, J + 1)] | + | f (I-1, J-1) + 2f (I, J-1) + f (I + 1, J-1)-[F (I-1, J + 1) + 2f (I, j + 1) + f (I + 1, J + 1)] | step 2 is to perform regular binarization on edge feature images to determine which pixels are edge pixels. The average gray value or the maximum entropy method can be used. Step 4 is the key to the algorithm. Based on the result of step 2, The binarization threshold is automatically selected and the local threshold is calculated at the edge pixel point. The specific implementation of the algorithm is as follows: for (I = 1; I <M-1; I ++) // F is m × n {for (j = 1; j <N-1; j ++) If B (I, j) = 1 // if it is an edge pixel. A = average gray value of pixel points related to E (I, j) {A = (f (I-1, J-1) + f (I, J-1) + f (I + 1, J-1) + f (I-1, j) + f (I, j) + f (I + 1, J) + f (I-1, J + 1) + f (I, j + 1) + f (I + 1, J + 1)/9; // calculate each and E (I, j) the entropy value of correlation pixel f (u, v) is assigned to ath (I-1, J-1) = A; th (I, J-1) = A; th (I + 1, J-1) = A; th (I-1, j) = A; th (I, j) = A; th (I + 1, J) = A; th (I-1, J + 1) = A; th (I, j + 1) = A; th (I + 1, J + 1) = ;} else // the threshold for non-edge points is th0th (I, j) = th0;} in step 5, F is binarization based on the calculated threshold, obtain output image G immediately.3Comparison of experiment resultsIn the previous section, an algorithm is proposed to combine image edge features with other threshold values. Figure 1 ~ 4. It is the result of processing and comparing the same image using this algorithm and several other automatic threshold binarization methods. Figure 1 source Image 2 binarization Based on edge information 3 binarization based on average gray value 4 binarization based on maximum variance as you can see, the binarization with the Class Variance as the threshold is better than the average gray scale value as the threshold, but the binarization result obtained using the method in this article is the best. It retains the details of the source image. References: 1 Fu Zhongliang. construction of the image threshold selection method. china NLP graphics report, 466 (6): 4692-Wang Kunming. comparison of automatic threshold selection methods. journal of Fushun Petroleum Institute, (22): 70-72

 

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.