Microchip surface character segmentation method
Through image smoothing processing, improved Otsu threshold segmentation, mathematical morphological operation and multi-threshold vertical projection character segmentation, the problem of unclear image information processing in the chip surface character recognition system is solved, and the accurate segmentation and verification of chip characters is realized, character defects are avoided, and recognition accuracy is improved.
Patent Information
- Application Number
- CN202510309708.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-06-17
AI Technical Summary
In the prior art, the chip surface character recognition system lacks clear processing of image information, resulting in blurred character information processing, and prone to character defects, sticking, scratches and other problems.
The chip surface character segmentation and verification are performed using image smoothing processing, improved Otsu threshold segmentation based on histograms, mathematical morphological operation, and multi-threshold vertical projection character segmentation.
Through these technical means, the chip image can be processed effectively and clearly, avoid character defects, and improve the accuracy and convenience of character recognition.
Smart Images

Figure CN120163846A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of visual image processing, and particularly relates to a method for segmenting characters on the surface of a microchip. Background Art
[0002] During the chip packaging and testing process, due to the complexity of the chip surface character marking process, individual chips may have problems such as character defects, adhesions, and scratches. If the correctness verification is not carried out, it will cause huge economic and reputation losses to the enterprise.
[0003] Under the existing conditions, according to a method for manufacturing a micro LED character display chip disclosed in the patent publication number CN113990987B, the following steps are included: selecting an epitaxial wafer, preprocessing the epitaxial wafer, and fabricating a P ohmic contact electrode 102 and an N ohmic contact electrode on the surface of the epitaxial wafer. The common chip surface character recognition system includes three parts: character positioning, character segmentation, and character recognition. Whether the character segmentation is accurate directly determines the final character recognition result, but it lacks the clarification process of the chip image information, resulting in the problem of unclear image information data, which is likely to have a negative impact on the subsequent character information processing. Summary of the Invention
[0004] The purpose of the present invention is to solve the problem that characters are defective due to the lack of verification of the chip in the prior art, and to propose a method for segmenting characters on the surface of a microchip.
[0005] In order to achieve the above purpose, the present invention adopts the following technical solutions:
[0006] A method for segmenting characters on the surface of a microchip, the segmentation method includes the following steps:
[0007] Step S1, image smoothing processing, where the image smoothing processing refers to obtaining a processed image by using a median filter;
[0008] Step S2, improved Otsu threshold segmentation based on a histogram, where the improved Otsu threshold segmentation based on a histogram refers to using the improved Otsu threshold segmentation method to segment the target region and the background region;
[0009] Step S3, mathematical morphology operation, where the mathematical morphology operation refers to smoothing the image edge after binary segmentation;
[0010] Step S4, character segmentation by multi-threshold vertical projection method, where the character segmentation by multi-threshold vertical projection method refers to performing column scanning on the image and counting the effective pixel points in the vertical direction, and obtaining a projection map on the plane coordinate axis according to the count.
[0011] Preferably, image smoothing processing refers to obtaining the processed image by using a median filter. Specifically, the principle of median filtering is to replace the gray value of a certain pixel point with the median of the gray values of the neighborhood template of that pixel point. To eliminate noise points and keep the characters clear at the same time, a 5×5 median filtering algorithm is adopted, and its calculation formula is:
[0012] g(x,y) = med{f(x - k,y - l),(k,l∈W)}
[0013] where f(x,y) is the original image, g(x,y) is the processed image, and W is a two-dimensional template.
[0014] Preferably, the improved Otsu threshold segmentation based on the histogram refers to segmenting the target area and the background area by using the improved Otsu threshold segmentation method. Specifically: Let f(x,y) be the original image pixel value distribution function, g(x,y) be the image pixel value distribution function after threshold segmentation, the gray level of the pixel value be [0,255], and the binarization threshold be set as T, T∈[0,255]. Then the formula for binarization processing is:
[0015]
[0016] Pixels in the image with a gray value greater than T are determined as the target, and pixels with a gray value less than T are determined as the background. The size of the threshold T determines the quality of the image segmentation result.
[0017] Preferably, the improved Otsu threshold segmentation based on the histogram for threshold segmentation means that, assuming the size of the image pixel data matrix is m×n and the number of pixels with the image pixel value of i is N i , then the total number S of the image pixel matrix = m×n, and the probability of pixels with different gray values appearing in the image is P i = N i / S;
[0018] Assuming that T divides the image into two parts A and B, then the probabilities of the two regions are respectively:
[0019]
[0020] The average gray values of region A and region B are respectively:
[0021]
[0022] The average gray value of the entire image is:
[0023]
[0024] Then the between-class variance is:
[0025] σ 2 = w A(μ A - μ) 2 + w B (μ B - μ) 2 ;
[0026] Select the optimal threshold T = T * , and satisfy:
[0027]
[0028] Preferably, the Otsu threshold segmentation method based on the histogram is as follows: Generally, there will be a highest peak value and a second highest peak value in the gray - level histogram. Assuming that peak A is much higher than peak B, it is inferred that the area near peak A is the background area, and the area near peak B is the target area. The segmentation threshold must be between peak A and peak B. Let the gray - level value corresponding to peak A be a, and the gray - level value corresponding to peak B be b. The traversal interval is reduced from [0, 255] to [a, b], and the computational amount is reduced from 225 2 to 255(b - a), reducing the computational amount and improving the operation efficiency.
[0029] Preferably, the mathematical morphology operation refers to smoothing the image edge after binary segmentation. Specifically: To eliminate image outliers and achieve the effect of smoothing the image edge, the closing operation is used to process the image, and its calculation formula is:
[0030]
[0031] where A is the input image, B is the structuring element, and A Θ B respectively represent B dilating A and B eroding A, and [x, y] represents the position of the image pixel.
[0032] Preferably, the multi - threshold vertical projection method for character segmentation means performing column scanning on the image and counting the effective pixel points in the vertical direction, and obtaining the projection graph on the plane coordinate axis according to the count. Specifically: Traverse and search each coordinate's projection value from left to right on the vertical projection graph of the chip characters. According to this method, the left and right boundaries of the remaining projection areas can be found. Generally, the valley point position of the projection image is the character segmentation position, and the characters in the whole image are segmented using the valley points.
[0033] Preferably, when the projection value is not zero, the pixel point corresponding to the projection value is recorded as the left boundary of the projection area, and continue to search to the right. When it is detected that the projection value is zero, the pixel point corresponding to the projection value is recorded as the right boundary of the projection area. Its specific operation process is:
[0034] When the projection value is not zero, the pixel point corresponding to the projection value is recorded as the left boundary of the projection area, and continue to search to the right. When it is detected that the projection value is zero, the pixel point corresponding to the projection value is recorded as the right boundary of the projection area. The specific operation process is as follows:
[0035] Import the binary image of the chip character surface and perform vertical projection on it;
[0036] Set the threshold T, character width width, and character count count;
[0037] Traverse and search each coordinate's projection value P from left to right on the vertical projection map of the chip character. If the searched projection value P is greater than the set threshold, mark the pixel point corresponding to the projection value as the left boundary X_left of the projection area, otherwise return;
[0038] Continue to search to the right. If the projection value P is less than the set threshold T and the difference between the current search position X t and the position of the left boundary X_left is greater than the set character width width, mark the pixel point corresponding to the projection value as the right boundary X_right of the projection area, otherwise return;
[0039] Continue to search to the right in this way. For each character searched, the character count count is incremented by 1 until the right boundary of the image is searched, and all character boundary segmentations are completed.
[0040] Compared with the prior art, the present invention has the following advantages:
[0041] 1. The present invention can process the chip image through image smoothing processing, so that the characters on the chip surface can remain clear. Through the improved Otsu threshold segmentation based on the histogram, the target and background on the chip characters can be segmented and distinguished, and then the chip characters can be verified.
[0042] 2. The present invention can smooth the edges of the chip characters through mathematical morphology operations, and the multi-threshold vertical projection method for character segmentation can segment the chip characters, so that after the chip characters are verified, the situations of character defects, adhesion, and scratches can be avoided, and then the chip characters are more convenient for later recognition.
[0043] In summary, the present invention can process the chip image through image smoothing processing, so that the characters on the chip surface can remain clear. Through the improved Otsu threshold segmentation based on the histogram, the target and background on the chip characters can be segmented and distinguished, and then the chip characters can be verified; through mathematical morphology operations, the edges of the smooth chip characters can be processed, and the multi-threshold vertical projection method for character segmentation can segment the chip characters, and then the chip characters are more convenient for later recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is the overall flowchart of a method for segmenting characters on the surface of a microchip proposed by the present invention;
[0045] Figure 2 This is the chip image after median filtering;
[0046] Figure 3 This is the chip image after threshold segmentation by the Otsu algorithm based on the histogram;
[0047] Figure 4 This is the chip image after closing operation processing;
[0048] Figure 5 This is the algorithm flowchart of the multi-threshold vertical projection character segmentation method;
[0049] Figure 6 This is the chip image of a single character after multi-threshold vertical projection character segmentation. Specific implementation manner
[0050] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments.
[0051] Refer to Figures 1-6 , a method for segmenting characters on the surface of a microchip, including the following steps:
[0052] First, image smoothing processing. Image smoothing processing refers to obtaining the processed image by using a median filter. Specifically, the principle of median filtering is to replace the gray value of a certain pixel point with the median of the gray values of the neighborhood template of that pixel point. To eliminate noise points and keep the characters clear, a 5×5 median filtering algorithm is used, and its calculation formula is:
[0053] g(x,y) = med{f(x - k,y - l),(k,l∈W)}
[0054] where f(x,y) is the original image, g(x,y) is the processed image, and W is a two-dimensional template;
[0055] Secondly, improved Otsu threshold segmentation based on the histogram. Improved Otsu threshold segmentation based on the histogram refers to using the improved Otsu threshold segmentation method to segment the target area and the background area;
[0056] Histogram-based improved Otsu threshold segmentation means using the improved Otsu threshold segmentation method to segment the target region and the background region. Specifically: Let f(x, y) be the original image pixel value distribution function, and g(x, y) be the image pixel value distribution function after threshold segmentation. The gray level of the pixel value is [0, 255], and the binary threshold is set to T, where T ∈ [0, 255]. Then the formula for binary processing is:
[0057]
[0058] Pixels in the image with a gray value greater than T are determined to be the target, and pixels with a gray value less than T are determined to be the background. The size of the threshold T determines the quality of the image segmentation result.
[0059] Histogram-based improved Otsu threshold segmentation for threshold segmentation means that, assuming the size of the image pixel data matrix is m×n, and the number of pixels with the image pixel value i is N i , then the total number S of the image pixel matrix is S = m×n, and the probability of pixels with different gray values appearing in the image is P i = N i / S;
[0060] Assuming that T divides the image into two parts A and B, then the probabilities of the two regions are respectively:
[0061]
[0062] The average gray values of region A and region B are respectively:
[0063]
[0064] The average gray value of the entire image is:
[0065]
[0066] Then the between-class variance is:
[0067] σ 2 = w A (μ A - μ) 2 + w B (μ B - μ) 2 ;
[0068] Select the optimal threshold T = T * , and satisfy:
[0069]
[0070] The Otsu threshold segmentation method based on histogram is as follows: Generally, there will be a highest peak value and a second highest peak value in the grayscale histogram. Assuming that peak A is much higher than peak B, it is inferred that the area near peak A is the background area and the area near peak B is the target area. The segmentation threshold must be between peak A and peak B. Let the grayscale value corresponding to peak A be a and the grayscale value corresponding to peak B be b. The traversal interval is reduced from [0, 255] to [a, b].
[0071] The amount of calculation is reduced from 225 2 to 255(b - a), reducing the amount of calculation and improving the operation efficiency. The traditional Otsu threshold segmentation method needs to traverse and search the gray levels L (L is [0, 255]), so it needs to perform L^2 between-class variance operations, and its calculation amount is large and the algorithm running time is long.
[0072] Table 1 Statistics of processing time of two algorithms
[0073]
[0074] As shown in Table 1, it is a comparison of the processing time between the traditional Otsu threshold segmentation algorithm and the Otsu threshold segmentation algorithm based on histogram. It can be seen from the table that the Otsu threshold segmentation algorithm based on histogram has less running time and faster operation efficiency.
[0075] Then, mathematical morphology operation. Mathematical morphology operation refers to smoothing the image edge after binary segmentation. Specifically, in order to eliminate the image outliers and achieve the effect of smoothing the image edge, the closing operation is used to process the image, and its calculation formula is:
[0076]
[0077] where A is the input image and B is the structuring element. A ⊕ B and A Θ B represent B dilating A and B eroding A respectively, and [x, y] represents the position of the image pixel.
[0078] Next, multi-threshold vertical projection method for character segmentation. The multi-threshold vertical projection method for character segmentation refers to performing column scanning on the image and counting the effective pixel points in the vertical direction, and obtaining the projection map on the plane coordinate axis according to the count. Specifically, it traverses and searches the projection values of each coordinate from left to right on the vertical projection map of the chip characters.
[0079] According to this method, the left and right boundaries of the remaining projection areas can be found. Generally, the valley point position of the projection image is the character segmentation position. The characters in the whole image are segmented using the valley points. During the chip production and testing process, sometimes there are scratches or dirt on the surface characters of individual chips, and their images will cause character breakage or adhesion phenomena. After multi-threshold vertical projection character segmentation of the single-character chip image, the segmentation effect is relatively obvious, which can serve as a template basis for subsequent chip character defects.
[0080] When the projection value is not zero, the pixel point corresponding to the projection value is recorded as the left boundary of the projection area, and continue to search to the right. When it is detected that the projection value is zero, the pixel point corresponding to the projection value is recorded as the right boundary of the projection area. The specific operation process is as follows:
[0081] Import the binary image of the chip character surface and perform vertical projection on it;
[0082] Set the threshold T, character width width, and character count count;
[0083] Traverse and search the projection value P of each coordinate from left to right on the vertical projection map of the chip character. If the searched projection value P is greater than the set threshold, the pixel point corresponding to the projection value is marked as the left boundary X_left of the projection area, otherwise return;
[0084] Continue to search to the right. If the projection value P is less than the set threshold T and, and the difference between the current search position X t and the position of the left boundary X_left is greater than the set character width width, the pixel point corresponding to the projection value is marked as the right boundary X_right of the projection area, otherwise return;
[0085] Continue to search to the right according to this method. For each character searched, the character count count is incremented by 1 until the right boundary of the image is searched, and all character boundary segmentations are completed.
[0086] Based on the traditional vertical projection method, multiple adaptive thresholds are added, including the minimum set threshold T, character width width, and character count count, to improve the accuracy of chip surface character segmentation through multi-threshold setting;
[0087] The chip characters are successively processed through image smoothing, improved Otsu threshold segmentation based on histogram, mathematical morphology operations, and multi-threshold vertical projection method character segmentation, enabling the chip characters to perform correctness verification and preparing for subsequent accurate identification of chip surface characters and accurate determination of character defects.
[0088] The functional principle of the present invention can be elaborated through the following operation methods:
[0089] Step S1, first import the original chip image;
[0090] Step S2, after the original chip image is imported, it undergoes image smoothing processing. The median filter in the image smoothing processing adopts a 5×5 median filtering algorithm, which can keep the characters clear;
[0091] Step S3, after the chip image is processed, perform improved Otsu threshold segmentation based on the histogram, and obtain the target and background according to the binarization processing formula;
[0092] Step S4, there are still some bright spots in the chip image after binarization segmentation. Usually, these bright spots are called outliers. To eliminate the outliers in the image and achieve the effect of smoothing the image edge, use closing operation to process the image;
[0093] Step S5, perform vertical projection method character segmentation on the chip image after arithmetic processing. Obtain the projection graph according to the count on the plane coordinate axis. Traverse and search the projection values of each coordinate from left to right on the vertical projection graph of the chip characters, and use the valley points to segment the characters in the whole image;
[0094] Step S6, it is a single-character chip image after multi-threshold vertical projection character segmentation. Its segmentation effect is good, and it can be used as a template basis for subsequent character recognition and character defect recognition.
[0095] As mentioned above, it is only the preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, makes equivalent replacements or changes, and should be covered by the protection scope of the present invention.
Claims
1. A method for segmenting characters on a microchip surface, characterized in that: The segmentation method comprises the following steps: Step S1, image smoothing processing, wherein the image smoothing processing refers to obtaining a processed image using a median filter; Step S2, histogram-based improved Otsu threshold segmentation, wherein the histogram-based improved Otsu threshold segmentation refers to segmenting the target area and the background area using the improved Otsu threshold segmentation method; Step S3, mathematical morphological operation, wherein the mathematical morphological operation refers to smoothing the image edge after binary segmentation; Step S4, character segmentation by multi-threshold vertical projection method, wherein the character segmentation by multi-threshold vertical projection method refers to scanning the image in columns and counting effective pixels in the vertical direction, and obtaining a projection image on the plane coordinate axis according to the count.
2. A method for segmenting characters on a microchip surface according to claim 1, characterized in that: The image smoothing process refers to the use of a median filter to obtain a processed image. Specifically, the principle of median filtering is to replace the gray value of a pixel with the median of the gray value of the neighborhood template of a certain pixel. In order to eliminate noise points and keep the characters clear, a 5×5 median filtering algorithm is used, and its calculation formula is: g(x,y)=med{f(xk,yl),(k,l∈W)} Where f(x,y) is the original image, g(x,y) is the processed image, and W is the two-dimensional template.
3. A method for segmenting characters on a microchip surface according to claim 1, characterized in that: The improved Otsu threshold segmentation based on histogram refers to segmenting the target area and the background area by using the improved Otsu threshold segmentation method. Specifically, let f(x, y) be the pixel value distribution function of the original image, g(x, y) be the pixel value distribution function of the image after threshold segmentation, the grayscale of the pixel value is [0, 255], and the binarization threshold is set to T, T∈[0, 255]. Then the formula for binarization processing is: Pixels with grayscale values greater than T in the image are judged as targets, and pixels with grayscale values less than T are judged as background. The size of the threshold T determines the quality of the image segmentation result.
4. A method for segmenting characters on a microchip surface according to claim 3, characterized in that: The improved Otsu threshold segmentation based on histogram is used for threshold segmentation. Assume that the size of the image pixel data matrix is m×n, and the number of image pixel values i is N. i , then the total number of image pixel matrices S = m × n, and the probability of pixels with different gray values appearing in the image is P i =N i / S; Assuming that T divides the image into two parts, A and B, the probabilities of the two regions are: The average grayscale values of area A and area B are: The average gray value of the entire image is: Then the between-class variance is: s 2 =w A (m A -m) 2 +w B (m B -m) 2 ; Select the optimal threshold T = T * , and satisfy:
5. A method for segmenting characters on a microchip surface according to claim 4, characterized in that: The histogram-based Otsu threshold segmentation method is as follows: Generally, there will be a highest peak and a second highest peak in the grayscale histogram. Assuming that peak A is much higher than peak B, it is inferred that the area near peak A is the background area, and the area near peak B is the target area. The segmentation threshold must be between peak A and peak B. Let the grayscale value corresponding to peak A be a, and the grayscale value corresponding to peak B be b. The traversal interval is reduced from [0,255] to [a,b], and the calculation amount is reduced from 225 2 Reduced to 255 (ba), reducing the amount of calculation and improving operational efficiency.
6. A method for segmenting characters on a microchip surface according to claim 1, characterized in that: The mathematical morphological operation refers to smoothing the image edge after binary segmentation. Specifically, in order to eliminate image wild values and achieve the effect of smoothing the image edge, the image is processed using a closed operation, and the calculation formula is: Where A is the input image, B is the structural element, and AΘB represent B dilation A and B erosion A respectively, and [x, y] represents the image pixel position.
7. A method for segmenting characters on a microchip surface according to claim 1, characterized in that: The multi-threshold vertical projection method character segmentation refers to scanning the image in columns and counting the valid pixels in the vertical direction, and obtaining the projection image on the plane coordinate axis according to the count. Specifically, the projection value of each coordinate is searched from left to right on the vertical projection image of the chip character. According to this method, the left and right boundaries of the remaining projection area can be found. Generally, the valley point position of the projection image is the character segmentation position, and the valley point is used to segment the characters in the entire image.
8. A method for segmenting characters on a microchip surface according to claim 7, characterized in that: When the projection value is not zero, the pixel point corresponding to the projection value is recorded as the left boundary of the projection area, and the search continues to the right. When the projection value is detected to be zero, the pixel point corresponding to the projection value is recorded as the right boundary of the projection area. The specific operation process is as follows: Process E1, importing the binary image of the chip character surface and performing vertical projection on it; Process E2, setting the threshold T, character width width and character number count; Process E3, traverse from left to right on the vertical projection map of the chip character to search for the projection value P of each coordinate. If the searched projection value P is greater than the set threshold, mark the pixel point corresponding to the projection value as the left boundary X_left of the projection area, otherwise return; Process E4, continue searching to the right, if the projection value P is less than the set threshold T and the current search position X t If the difference between the left boundary X_left and the position is greater than the set character width width, the pixel corresponding to the projection value is marked as the right boundary X_right of the projection area, otherwise it is returned; Process E5, continue searching rightward in this way, and each time a character is searched, the character count is increased by 1 until the right edge of the image is found, and all character boundaries are segmented.
Citation Information
Patent Citations
A method for manufacturing a micro LED character display chip
CN113990987B