Chip surface character segmentation method and device
Patent Information
- Application Number
- CN202610453545.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-08
- Publication Date
- 2026-09-18
AI Technical Summary
但在干扰较多的场景中,如芯片表面划伤、多印、粘连等干扰,导致Canny算子提取较多的干扰边缘点,使得SWT提取的笔画点存在误检、漏检和笔画宽度计算错误等情况,影响字符分割的准确率
[0018] As described above, this application provides a method and apparatus for character segmentation on a chip surface. The method includes: acquiring a chip surface image; extracting candidate regions of characters from the chip surface image using a maximum stable extremum region algorithm, and selecting regions of interest (ROIs) from the candidate regions; performing edge detection on the ROIs to obtain a set of edge points; removing background noise points from the set based on the contour features of the connected components where the edge points are located; extracting character stroke points from the set based on the area of the connected components and the stroke width of the edge points; removing falsely detected stroke points from the character stroke points based on morphological operations; and merging the character stroke points using a disjoint-set data structure to segment complete characters. By removing background noise points based on contour features, extracting character stroke points based on the area of the connected components and the stroke width, and removing falsely detected stroke points based on morphological operations, defects such as scratches and noise can be effectively removed, improving the accuracy and efficiency of character segmentation on the chip surface. This method and apparatus for character segmentation on a chip surface is simple and convenient, and can effectively reduce interference from scratches, multiple printings, and adhesions on the chip surface, thereby improving the accuracy of character segmentation.
Smart Images

Figure CN122780964A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of character recognition technology, and in particular to a method and apparatus for character segmentation on a chip surface. Background Technology
[0002] Chip packaging and testing is the final step before a chip leaves the factory. The characters displayed after chip packaging show key identification information such as the chip's name, model, specifications, and serial number, serving as crucial evidence for chip traceability. However, in actual production, surface defects can easily occur during the packaging process, such as missing characters, broken characters, reprinted characters, misprinted characters, and scratches. Figure 2 As shown, this affects chip traceability and after-sales service. Due to factors such as the large production volume, small size, and diverse types of defects in chips, manual inspection is still used in chip packaging. However, this method suffers from low inspection efficiency, high subjectivity, and a tendency to miss defects, making it difficult to meet the demands of the modern chip manufacturing industry for high-efficiency and high-accuracy inspection.
[0003] Computer vision-based character detection and recognition in images of license plates and instrument readings has been widely applied. However, due to scratches, multiple prints, adhesions, and surrounding interference on the surface of characters on packaged chips, character segmentation results are prone to errors, affecting the accuracy of character recognition and defect detection. For example, the Stroke Width Transform (SWT) algorithm calculates the width of each character stroke in the image based on edge points extracted by the Canny operator, and achieves character segmentation by merging stroke points with similar width values. It has good segmentation results for characters with less interference. However, in scenarios with more interference, such as scratches, multiple prints, and adhesions on the chip surface, the Canny operator extracts more interfering edge points, leading to false positives, false negatives, and errors in stroke width calculation in the stroke points extracted by SWT, thus affecting the accuracy of character segmentation. Therefore, a more effective character segmentation method is urgently needed. Summary of the Invention
[0004] In view of this, the purpose of this application is to propose a chip surface character segmentation method and apparatus to solve the above-mentioned technical problems.
[0005] A first aspect of this application provides a method for character segmentation on a chip surface, comprising: acquiring a chip surface image; extracting candidate regions of characters from the chip surface image using the Maximum Stable Extremal Regions (MSER) algorithm, and selecting regions of interest (ROIs) from the candidate regions of characters; performing edge detection on the ROIs to obtain a set of edge points; removing background noise points from the set based on the contour features of the connected components where the edge points are located; extracting character stroke points from the set based on the area of the connected components and the stroke width of the edge points; removing falsely detected stroke points from the character stroke points based on morphological operations; and merging the character stroke points using a disjoint-set data structure to segment complete characters.
[0006] Furthermore, acquiring the chip surface image includes: acquiring a color image of the chip surface; and performing grayscale conversion, Gaussian filtering, and contrast enhancement processing on the color image to obtain the chip surface image.
[0007] Furthermore, the method of extracting candidate character regions from the chip surface image using the maximum stable extreme value region algorithm includes: dividing the chip surface image into bright extreme value regions and dark extreme value regions; calculating the area change rate of different extreme value regions; and selecting the region where the area change rate reaches a local minimum as the candidate character region.
[0008] Further, the step of selecting character regions of interest from the character candidate regions includes: using a non-maximum suppression algorithm to remove redundant regions in the character candidate regions to obtain multiple segmented regions; scoring the segmented regions to obtain scores, wherein the distance between the center point of the segmented region and the center point of the chip surface image is a first distance, the first distance is negatively correlated with the score, and the area of the segmented region is positively correlated with the score; and selecting the segmented region with the highest score as the character region of interest.
[0009] Further, the step of performing edge detection on the character region of interest to obtain a set of edge points includes: performing gradient calculation on the character region of interest to obtain the gradient magnitude and gradient direction of each pixel in the region; performing non-maximum suppression processing on the gradient magnitude according to the gradient direction to retain the pixels with local maximum gradient values as candidate edge points; filtering the candidate edge points using a dual threshold detection method to determine the candidate edge points with gradient magnitudes greater than a first threshold as strong edge points, and the candidate edge points with gradient magnitudes between a second threshold and the first threshold as weak edge points; and retaining the weak edge points connected to the strong edge points through edge connection processing to obtain a set of edge points.
[0010] Further, the step of removing background noise points from the set based on the contour features of the connected region where the edge point is located includes: calculating the contour features and area features of the connected region where the edge point is located, wherein the contour features = number of pixels in the region / area of the circumscribed rectangle, and the area features = convex hull area / area of the circumscribed rectangle; removing loose background noise points from the set based on the contour features; and removing irregular background noise points from the set based on the area features.
[0011] Further, the step of extracting character stroke points from the set based on the connected region area and stroke width of the edge points includes: determining another edge point along the opposite gradient direction based on one edge point, and taking the distance between the two edge points as the stroke width; determining the connected region area of the other edge point; and extracting the other edge point as a character stroke point when the connected region area is greater than the product of the stroke width and a threshold ratio coefficient.
[0012] Furthermore, the step of removing falsely detected strokes from the character strokes based on morphological operations includes: filling the internal holes of the character strokes through closing operations; and removing character burrs through opening operations to remove falsely detected strokes from the character strokes.
[0013] Furthermore, the step of merging the character strokes using a disjoint-set data structure to divide them into complete characters includes: merging character strokes with the same stroke width into a single character stroke using a disjoint-set data structure; and merging the character strokes into complete characters using a maximum stable extreme value region algorithm.
[0014] A second aspect of this application provides a chip surface character segmentation apparatus, comprising: an image acquisition module configured to acquire a chip surface image; a region filtering module configured to extract candidate character regions from the chip surface image using a maximum stable extremum region algorithm, and filter character regions of interest from the candidate character regions; an edge detection module configured to perform edge detection on the character regions of interest to obtain a set of edge points; an interference removal module configured to remove background noise points in the set based on the contour features of the connected components where the edge points are located; extract character stroke points in the set based on the area of the connected components and the stroke width of the edge points; remove falsely detected stroke points from the character stroke points based on morphological operations; and a character segmentation module configured to merge the character stroke points using a disjoint-set data structure to segment complete characters.
[0015] A third aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the chip surface character segmentation method as described in the first aspect above.
[0016] A fourth aspect of this application provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the chip surface character segmentation method as described in the first aspect above.
[0017] A fifth aspect of this application provides a computer program product including computer program instructions that, when executed on a computer, cause the computer to perform the chip surface character segmentation method as described in the first aspect above.
[0018] As described above, this application provides a method and apparatus for character segmentation on a chip surface. The method includes: acquiring a chip surface image; extracting candidate regions of characters from the chip surface image using a maximum stable extremum region algorithm, and selecting regions of interest (ROIs) from the candidate regions; performing edge detection on the ROIs to obtain a set of edge points; removing background noise points from the set based on the contour features of the connected components where the edge points are located; extracting character stroke points from the set based on the area of the connected components and the stroke width of the edge points; removing falsely detected stroke points from the character stroke points based on morphological operations; and merging the character stroke points using a disjoint-set data structure to segment complete characters. By removing background noise points based on contour features, extracting character stroke points based on the area of the connected components and the stroke width, and removing falsely detected stroke points based on morphological operations, defects such as scratches and noise can be effectively removed, improving the accuracy and efficiency of character segmentation on the chip surface. This method and apparatus for character segmentation on a chip surface is simple and convenient, and can effectively reduce interference from scratches, multiple printings, and adhesions on the chip surface, thereby improving the accuracy of character segmentation. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating a chip surface character segmentation method according to an embodiment of this application.
[0021] Figure 2 Example diagrams showing scratches, multiple prints, adhesion, and surrounding interference on the chip surface.
[0022] Figure 3 This is a schematic diagram showing the results of edge detection in an embodiment of this application.
[0023] Figure 4This is a schematic diagram showing the result of removing background noise points from the set in an embodiment of this application.
[0024] Figure 5 This is a schematic diagram illustrating the principle of extracting character stroke points from a set in an embodiment of this application.
[0025] Figure 6 This is a schematic diagram showing the result of extracting character stroke points from the set in an embodiment of this application.
[0026] Figure 7 This is a schematic diagram of the final character division in the embodiments of this application.
[0027] Figure 8 This is a schematic diagram of the structure of a chip surface character segmentation device according to an embodiment of this application.
[0028] Figure 9 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.
[0030] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0031] The following describes specific embodiments in conjunction with... Figure 1 , Figures 3 to 9 The technical solution of this application will be described in detail below.
[0032] Some embodiments of this application provide a chip surface character segmentation method, such as... Figure 1 As shown, the chip surface character segmentation method includes the following steps:
[0033] S1. Obtain an image of the chip surface.
[0034] S2. Extract candidate regions of characters from the chip surface image using the maximum stable extreme value region algorithm, and filter regions of interest of characters from the candidate regions of characters.
[0035] The maximum stable extreme value region is a local feature detection method based on grayscale images. It detects relatively stable connected regions under different grayscale thresholds by performing multi-threshold segmentation on the image, and has good anti-interference ability against noise. For the characters to be detected in chip packaging, since they only occupy a part of the chip surface image, in order to improve detection efficiency, only the candidate regions of characters are extracted and the regions of interest of characters are selected.
[0036] S3. Perform edge detection on the region of interest of the character to obtain a set of edge points.
[0037] Canny edge detection is performed on the region of interest image of the characters to extract the edge information of the characters on the chip surface.
[0038] S4. Remove background noise points from the set based on the contour features of the connected components where the edge points are located; extract character stroke points from the set based on the area of the connected components and the stroke width of the edge points. Remove falsely detected stroke points from the character stroke points based on morphological operations.
[0039] The set of edge points is as follows Figure 3 As shown in the gray pixels, these are divided into character edge points and defective edge points. For example, the blue rectangles in the image represent defective edge points inside the character, while the green rectangles represent defective edge points outside the character. Traditional SWT searches for another character edge point with a roughly opposite gradient direction within the character along the gradient direction of the original edge point to extract the character stroke points in that gradient direction. However, due to the susceptibility to the influence of defective edge points within the character, it is difficult to extract complete character stroke points or the calculated stroke width information may be incorrect. Random noise can change the gradient direction of individual character edge points, resulting in jagged, falsely detected stroke points, causing character adhesion and affecting the character segmentation accuracy. Missing edge points at the intersection of character strokes lead to the failure to extract stroke points at these intersections, causing a single stroke to be divided into multiple segments, further impacting character segmentation accuracy.
[0040] To address the above issues, this embodiment proposes edge-point connected component denoising. SWT stroke point extraction is performed on edge points of different connected components separately. Imperfect edge points within characters are removed based on the area of the connected component and the local stroke width, thus avoiding the influence of internal character defects on SWT stroke point extraction. Specifically, background edge points are removed based on the contour features of the connected component; imperfect edge points within characters are removed based on the area of the connected component and the stroke width; and burr stroke points are removed based on morphological operations.
[0041] S5. Use a disjoint-set data structure to merge the strokes of the character and divide it into complete characters.
[0042] Using a conventional disjoint-set data structure, we can divide adjacent or similar character strokes to obtain more accurate characters.
[0043] This chip surface character segmentation method first acquires an image of the chip surface and preprocesses it. Then, it uses the maximum stable extremum region algorithm to detect characters in the preprocessed image, extracting candidate regions and determining the region of interest (ROI) through region filtering. Next, edge detection is performed within the ROI, and connected component analysis is conducted on the detected edge points to remove interfering edge points caused by scratches, noise, etc. Based on this, the gradient direction of the edge points is calculated, and the stroke width transformation algorithm is used to calculate the character stroke width. Finally, connected component merging is performed based on stroke width consistency to achieve segmentation of the character region on the chip surface. The segmentation result is shown below. Figure 7 As shown, it can effectively improve the accuracy of character segmentation with almost no flaws.
[0044] In some embodiments, acquiring the chip surface image includes: S101. Obtain a color image of the chip surface.
[0045] S102. Perform grayscale conversion, Gaussian filtering, and contrast enhancement processing on the color image to obtain a chip surface image.
[0046] An image acquisition device is used to acquire an RGB color image of the chip package surface under illumination conditions. The image is then processed by grayscale conversion, Gaussian filtering, and contrast enhancement to obtain a preprocessed image for subsequent character detection.
[0047] In some embodiments, the extraction of candidate character regions from the chip surface image using the maximum stable extremum region algorithm includes: S201. Divide the bright extreme value region and dark extreme value region in the chip surface image.
[0048] For a grayscale image, if the grayscale values of all pixels in a connected region of the image are greater than or equal to a given threshold, then the region is a bright extremum region; if the grayscale values of all pixels in a connected region of the image are less than or equal to a given threshold, then the region is a dark extremum region.
[0049] S202. Calculate the rate of change of area in different extreme value regions.
[0050] The formula for calculating the area change rate is as follows: (1) in, The grayscale threshold is The area of the extreme region, The grayscale thresholds are respectively and At that time, the extreme region arrive Change in area. The smaller the rate of change in area, the more stable the extreme value region.
[0051] S203. The region where the area change rate reaches a local minimum value is selected as the candidate region for characters.
[0052] The MSER algorithm calculates the area change rate when the grayscale threshold changes, and identifies the region where the change rate reaches a local minimum as the maximum stable extremum region. The formula for determining the maximum stable extremum region MSER is as follows: (2) in, A region is a candidate region for characters.
[0053] In some embodiments, filtering character regions of interest from the character candidate regions includes: S204. Use the nonmaximum suppression algorithm to remove redundant regions in the candidate character regions to obtain multiple segmentation regions.
[0054] Since MSER extracts the maximum stable extremum region under each grayscale threshold, and there are spatially overlapping regions, non-maximum suppression (NMS) is used to process character candidate regions through contour feature filtering and scoring ranking. Multiple segmented regions (NMS(A)) are obtained. The non-maximum suppression formula is as follows: (3) in, Set a preset threshold for the combination, for example, 0.5.
[0055] S205. The segmented region is scored to obtain a score, wherein the distance between the center point of the segmented region and the center point of the chip surface image is a first distance, the first distance is negatively correlated with the score, and the area of the segmented region is positively correlated with the score.
[0056] S206. Select the segmentation region with the highest score as the character region of interest.
[0057] The scoring formula is as follows: (4) in, and These represent the x and y coordinates of the center point of the divided region, respectively. and The x and y coordinates of the center point of the image are respectively. and These represent the width and height of the segmented region, respectively. Indicates the area of the divided region. Represents the area of the image. , These represent the proportional coefficients for each item.
[0058] The scoring criteria include two points: the degree of deviation from the image center position and the priority of the region area. Degree of deviation from the image center position: Chip character regions are usually located in the image center region; therefore, the distance between the center point of the segmented region and the image center point is calculated, with a lower score for greater distances. In this embodiment, vertical deviation can be used for calculation. Priority of region area: Generally, pre-segmented regions such as scratches on the chip are smaller than character regions; therefore, the larger segmented region is usually selected as the character region.
[0059] Finally, the region with the highest score is selected as the region of interest for the character.
[0060] In this embodiment, the specific scoring calculation formula can be as follows: (5) in, Take 1 for each.
[0061] In some embodiments, the step of performing edge detection on the region of interest of the character to obtain a set of edge points includes: S301. Perform gradient calculation on the region of interest of the character to obtain the gradient magnitude and gradient direction of each pixel in the region.
[0062] S302. Perform non-maximum suppression processing on the gradient magnitude according to the gradient direction, so as to retain the pixel points with local maximum gradient values as candidate edge points.
[0063] S303. Candidate edge points are screened using a dual-threshold detection method. Candidate edge points with gradient magnitude greater than the first threshold are identified as strong edge points, and candidate edge points with gradient magnitude between the second threshold and the first threshold are identified as weak edge points.
[0064] S304. Through edge connection processing, the weak edge points connected to the strong edge points are retained to obtain a set of edge points.
[0065] First, gradient calculation is performed on the region of interest of the character to obtain the gradient magnitude and direction of each pixel in the image. Then, non-maximum suppression processing is performed on the gradient magnitude according to the gradient direction to retain local maximum gradient values and remove non-edge responses. Candidate edge points are screened by a dual threshold detection method. Pixels with gradient magnitudes greater than the high threshold (first threshold) are identified as strong edge points, and pixels with gradient magnitudes between the low threshold (second threshold) and the high threshold are identified as weak edge points. Finally, edge point connection processing is performed to retain the weak edge points connected to the strong edges, thereby obtaining the final set of edge points of the character on the chip surface, which is used as the input for subsequent stroke width transformation calculation.
[0066] In some embodiments, removing background noise points from the set based on the contour features of the connected component where the edge point is located includes: S401. Calculate the contour features and area features of the connected region where the edge point is located. The contour features = number of pixels in the region / area of the circumscribed rectangle. The area features = convex hull area / area of the circumscribed rectangle.
[0067] S402. Remove loose background noise points from the set based on the contour features.
[0068] S403. Remove irregular background noise points from the set based on the area characteristics.
[0069] The characters are located in the central region of the image, far from the border, and the connected components are compact. By filtering the contour features of the connected components, coarse localization can be achieved quickly, eliminating large areas of background / noise and reducing the computational cost of subsequent SWT. Connected component analysis is performed on the edge-detected set. By using the geometric features of the contours, large and irregular backgrounds and small and discrete noise points in the connected component contours are removed, retaining only the character regions that conform to the shape of the character strokes.
[0070] Specifically, the contour features (number of pixels in the region / area of the circumscribed rectangle) and area features (area of the convex hull / area of the circumscribed rectangle) of all connected components are calculated. The contour features and area features of the connected components are then filtered to remove irregularly shaped and scattered parts of the connected components, i.e., background noise points with low contour features and low area features.
[0071] In this embodiment, the contour feature threshold for connected components is 0.35. By filtering out loose background noise points with a contour feature < 0.35, the contour feature of the character is between 0.35 and 1. The area feature threshold is 0.65. By filtering out irregularly shaped background noise points, the area feature of the character is between 0.65 and 1. The background edge point removal result is as follows: Figure 4As shown, this method can remove most of the interfering edge points and improve the calculation efficiency of subsequent SWT, but there are still flawed edge points inside the character (blue rectangle in the figure), flawed edge points outside the character (green rectangle in the figure), and background edge points (red rectangle in the figure).
[0072] In some embodiments, extracting character stroke points from the set based on the connected region area and stroke width of the edge points includes: S404. Based on one edge point, determine another edge point along the opposite gradient direction, and use the distance between the two edge points as the stroke width.
[0073] S405. Determine the area of the connected region of another edge point.
[0074] S406. When the area of the connected region is greater than the product of the stroke width and the threshold ratio coefficient, the other edge point is extracted as a character stroke point.
[0075] SWT extracts stroke points within character strokes by finding another character edge point with the opposite gradient direction along the gradient direction of the character edge point. However, it also extracts flawed edge points within the character (such as...). Figure 5 (as shown in purple) and character edge points (such as) Figure 5 The red area (indicated by the character strokes) is difficult to distinguish, making it challenging for SWT to extract accurate character stroke points. This embodiment improves the SWT algorithm by combining the connected component area of edge points and character stroke width information. This can eliminate flawed edge points within characters, avoiding their impact on SWT stroke point extraction. The connected component area of flawed edge points within characters is relatively smaller than that of character edge points. By combining the connected component area of edge points with local stroke width information, flawed edge points within characters can be effectively eliminated, improving SWT's resistance to interference from noisy edge points such as flawed edge points within characters.
[0076] like Figure 5 As shown, gray pixels represent character edge points with a connected region area of 39, while purple pixels represent flawed edge points within the character, with both connected regions having an area of 2. SWT searches for character edge points along the gradient direction of the green character edge points that are in the opposite direction (here, "opposite" means approximately opposite, allowing for deviations such as ±10%). To avoid mistakenly identifying purple flawed edge points as character edge points, the character edge point determination rule is set as follows: (6) in, These are the edge points to be matched. The area of the connected region. It is an edge point With edge points The distance between them represents the stroke width of the character. This is the stroke width threshold ratio coefficient.
[0077] by Figure 5 Taking the green dot as an example, the nearest point with the opposite gradient direction to this point is the purple dot in the diagram, and the area of the connected region at this point is 2. , Generally, we take 3, then 2 < If the condition in formula (6) is not met, then the purple dot is an edge point of a defect inside the character. Furthermore... Figure 5 Taking the green dot as an example, the second nearest point in the opposite gradient direction is the red dot in the diagram, and the area of the connected region at this point is 39. If 39 > 5 × 3 satisfies the judgment of formula (6), then the red dot is the character edge point.
[0078] The improved SWT stroke point extraction results are as follows: Figure 6 As shown, it can effectively remove flawed edge points inside characters, most background edge points, and flawed edge points outside characters, accurately extracting character stroke points.
[0079] In some embodiments, the step of removing falsely detected stroke points from the character stroke points based on morphological operations includes: S407. Fill the internal holes of the character stroke points by closing the operation.
[0080] S408. Remove character burrs by opening operation to eliminate falsely detected stroke points among the character stroke points.
[0081] Due to the influence of random noise, the gradient direction of some edge points changes. SWT mistakenly identifies flawed edge points outside the character as character edge points, extracting falsely detected stroke points with burr-like shapes, such as... Figure 6 As shown in the green rectangular area, there may be prominent burrs or noise at the edges of the strokes. Morphological operations can be used to remove these burrs. Morphological operations (erosion followed by dilation) can remove these tiny burrs without damaging the main strokes, making the stroke edges more regular.
[0082] In this embodiment, the small holes inside the stroke are first filled by a 3×3 core of closing operation, and then the opening operation is performed using a 5×5 core to adapt to the size of the chip character burrs. The opening operation is iterated once to avoid excessive stroke shrinkage caused by multiple iterations.
[0083] In some embodiments, the step of merging the character strokes using a disjoint-set data structure to divide the character into complete characters includes: S501. Using a disjoint-set data structure, the character strokes with the same stroke width are merged into a single character stroke.
[0084] S502. The character strokes are merged into a complete character using the maximum stable extreme value region algorithm.
[0085] Based on the disjoint-set data structure, adjacent strokes with the same (meaning approximately the same, allowing for deviations of, for example, ±5%) can be merged into a single character stroke.
[0086] Based on MSER (Mean Sequence Array) character stroke merging, broken character strokes can be merged into complete character strokes. By merging character strokes with similar width values according to their positional relationships, the character segmentation result on the chip surface can be obtained. Figure 7 As shown.
[0087] In this example, the stability threshold step Δ for MSER is 1 (controlling the stability of the region), and the minimum / maximum region area (filtering out excessively small noise regions and excessively large background regions) are total pixels / 30 and total pixels / 5, respectively. The disjoint-set data structure's disjoint-set width threshold is 2.5, meaning that if the difference in width between two strokes is less than 2.5 pixels, they are judged to be the same character and merged. The disjoint-set region overlap threshold is an overlap height ≥ (the sum of the median widths of the two strokes) / 3, which determines that the stroke domains are adjacent and avoids erroneous merging of irrelevant strokes.
[0088] It is understood that before using the technical solutions of the various embodiments in this disclosure, users will be informed of the type, scope of use, and usage scenarios of the personal information involved in an appropriate manner, and user authorization will be obtained.
[0089] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media performing the operations of this disclosed technical solution.
[0090] As an optional but not limited implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0091] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0092] In some embodiments of this application, a chip surface character segmentation device is provided, such as... Figure 8As shown, the system includes: an image acquisition module 81, configured to acquire an image of the chip surface; a region filtering module 82, configured to extract candidate character regions from the chip surface image using a maximum stable extremum region algorithm, and filter character regions of interest from the candidate character regions; an edge detection module 83, configured to perform edge detection on the character regions of interest to obtain a set of edge points; an interference removal module 84, configured to remove background noise points in the set based on the contour features of the connected components where the edge points are located; extract character stroke points in the set based on the area of the connected components and the stroke width of the edge points; remove falsely detected stroke points from the character stroke points based on morphological operations; and a character segmentation module 85, configured to merge the character stroke points using a disjoint-set data structure to segment complete characters.
[0093] The apparatus of the above embodiments is used to implement the corresponding chip surface character segmentation method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0094] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the chip surface character segmentation method described in any of the above embodiments.
[0095] Figure 9 This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.
[0096] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0097] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0098] The input / output interface 1030 is used to connect input / output modules to realize information input and output. The input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. The input devices can include keyboards, mice, touchscreens, microphones, various sensors, etc., and the output devices can include displays, speakers, vibrators, indicator lights, etc.
[0099] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (e.g., USB, Ethernet cable, etc.) or wireless means (e.g., mobile network, WIFI, Bluetooth, etc.).
[0100] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.
[0101] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0102] The electronic devices described above are used to implement the corresponding chip surface character segmentation method in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0103] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to execute the chip surface character segmentation method as described in any of the above embodiments.
[0104] The non-transitory computer-readable medium of this embodiment includes both permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0105] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the chip surface character segmentation method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0106] Based on the same concept, corresponding to any of the above embodiments, this application also provides a computer program product, including computer program instructions, which, when run on a computer, cause the computer to execute the chip surface character segmentation method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0107] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.
[0108] Furthermore, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the apparatus may be shown in block diagram form. This is to prevent the embodiments of this application from being difficult to understand, and it also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully within the understanding of those skilled in the art). In setting forth specific details to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application may be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0109] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description.
[0110] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.
Claims
1. A method for character segmentation on a chip surface, characterized in that, include: Acquire images of the chip surface; The maximum stable extreme value region algorithm is used to extract candidate regions of characters in the chip surface image, and then the region of interest of characters is selected from the candidate regions of characters. Edge detection is performed on the region of interest of the character to obtain a set of edge points; Background noise points in the set are removed based on the contour features of the connected regions where the edge points are located; character stroke points in the set are extracted based on the area of the connected regions of the edge points and the stroke width. False strokes in the character strokes are removed based on morphological operations; The character strokes are merged using a disjoint-set data structure to divide the character into complete characters.
2. The chip surface character segmentation method according to claim 1, characterized in that, The acquisition of the chip surface image includes: Acquire a color image of the chip surface; The color image is subjected to grayscale conversion, Gaussian filtering, and contrast enhancement to obtain the chip surface image.
3. The chip surface character segmentation method according to claim 1, characterized in that, The method of extracting candidate character regions from the chip surface image using the maximum stable extreme value region algorithm includes: Divide the bright extremum region and dark extremum region in the chip surface image; Calculate the rate of change of area in different extreme regions; The region where the area change rate reaches a local minimum is selected as the candidate region for characters.
4. The chip surface character segmentation method according to claim 1, characterized in that, The step of filtering character regions of interest from the candidate character regions includes: Multiple segmentation regions are obtained by eliminating redundant regions in the candidate character regions using a nonmaximum suppression algorithm. The segmented region is scored to obtain a score, wherein the distance between the center point of the segmented region and the center point of the chip surface image is a first distance, the first distance is negatively correlated with the score, and the area of the segmented region is positively correlated with the score; The segmentation region with the highest score is selected as the region of interest for the character.
5. The chip surface character segmentation method according to claim 1, characterized in that, The step of performing edge detection on the region of interest of the character to obtain a set of edge points includes: Gradient calculation is performed on the region of interest of the character to obtain the gradient magnitude and gradient direction of each pixel in the region; Non-maximum suppression processing is performed on the gradient magnitude based on the gradient direction to retain the pixels with local maximum gradient values as candidate edge points; Candidate edge points are screened using a dual-threshold detection method. Candidate edge points with gradient magnitudes greater than the first threshold are identified as strong edge points, while candidate edge points with gradient magnitudes between the second threshold and the first threshold are identified as weak edge points. By performing edge connection processing, the weak edge points connected to the strong edge points are retained, resulting in a set of edge points.
6. The chip surface character segmentation method according to claim 1, characterized in that, The step of removing background noise points from the set based on the contour features of the connected components where the edge points are located includes: Calculate the contour features and area features of the connected region where the edge point is located. The contour features = number of pixels in the region / area of the bounding rectangle. The area features = convex hull area / area of the bounding rectangle. Based on the contour features, remove loose background noise points from the set; Irregular background noise points in the set are removed based on the area characteristics.
7. The chip surface character segmentation method according to claim 1, characterized in that, The extraction of character stroke points from the set based on the connected component area and stroke width of the edge points includes: Based on one edge point, determine another edge point along the opposite gradient direction, and use the distance between the two edge points as the stroke width. Determine the area of the connected region at another edge point; When the area of the connected region is greater than the product of the stroke width and the threshold ratio coefficient, the other edge point is extracted as a character stroke point.
8. The chip surface character segmentation method according to claim 1, characterized in that, The method of removing falsely detected stroke points from the character stroke points based on morphological operations includes: The internal holes of the character stroke points are filled by closing operations; The character glitch is removed by opening operation to eliminate falsely detected stroke points among the character stroke points.
9. The chip surface character segmentation method according to claim 1, characterized in that, The process of merging character strokes using a disjoint-set data structure to divide a complete character includes: Using a disjoint-set data structure, the stroke points of characters with the same stroke width are merged into a single character stroke; The character strokes are merged into a complete character using the maximum stable extreme value region algorithm.
10. A chip surface character segmentation device, characterized in that, include: The image acquisition module is configured to acquire images of the chip surface. The region filtering module is configured to extract candidate regions of characters in the chip surface image using the maximum stable extreme value region algorithm, and to filter regions of interest of characters from the candidate regions of characters. The edge detection module is configured to perform edge detection on the region of interest of the character to obtain a set of edge points; The interference removal module is configured to remove background noise points in the set based on the contour features of the connected components where the edge points are located; extract character stroke points in the set based on the area of the connected components of the edge points and the stroke width; and remove falsely detected stroke points from the character stroke points based on morphological operations. The character segmentation module is configured to use a disjoint-set data structure to merge the strokes of the character and segment it into a complete character.