Dimension Detection Method, Device, Equipment and Computer Readable Storage Medium
By employing image processing techniques to measure pixel counts in detection images, the method accurately determines wafer functional area dimensions, enhancing detection efficiency and accuracy.
Patent Information
- Application Number
- CN202111635181.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2041-12-29
AI Technical Summary
During wafer detection, the prior art cannot accurately judge the size of the functional area, resulting in inaccurate size judgment, affecting detection efficiency and accuracy.
By acquiring the detection image, the grayscale histogram of the area to be tested is determined, the binarization process is performed, the number of pixel points in the area to be tested is calculated in different directions, and the size of the area to be tested is determined.
Accurate dimensional detection of the wafer area to be tested is achieved, avoiding the inflow of unqualified products into subsequent processes, and improving detection efficiency and accuracy.
Smart Images

Figure CN114283185B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of detection technology, and in particular, to a method, apparatus, device, and computer-readable storage medium for dimension detection. Background Art
[0002] During the detection process of a wafer, before detecting the defects on the wafer surface, it is first necessary to detect the dimensions of different functional areas on the wafer surface. After determining that the dimensions of different functional areas on the wafer meet the requirements, then detect the defects existing in the functional areas of the wafer. When detecting the dimensions of the functional areas of the wafer, when processing the taken pictures and making a judgment based on the processed pictures, it is often impossible to accurately judge the functional areas, resulting in inaccurate judgment of the dimensions of the functional areas, and products with unqualified functional area dimensions flow into the subsequent processes, affecting the detection efficiency of the test piece and reducing the detection accuracy of the test piece. Summary of the Invention
[0003] Embodiments of this application provide a method, apparatus, device, and computer-readable storage medium for dimension detection.
[0004] In a first aspect, embodiments of this application provide a dimension detection method, and the dimension detection method includes:
[0005] Obtain a detection image of a test piece;
[0006] Determine a test area in the detection image;
[0007] Determine the number of first pixel points in each row of the test area along a first direction and the number of second pixel points in each column along a second direction, where the first direction is perpendicular to the second direction;
[0008] Determine the size of the test area according to the number of first pixel points and the number of second pixel points.
[0009] Optionally, the determining the number of first pixel points in each row of the test area along a first direction and the number of second pixel points in each column along a second direction, where the first direction is perpendicular to the second direction, includes:
[0010] Determine the gray level histogram of the test area;
[0011] Determine a binary gray level value according to the gray level histogram;
[0012] Perform binarization on the detection image according to the binary gray level value to obtain a binary image;
[0013] Determine the number of first pixel points in each row of the binary image corresponding to the region to be measured along the first direction and the number of second pixel points in each column along the second direction, where the first direction is perpendicular to the second direction.
[0014] Optionally, the determining the binarization gray value according to the gray histogram includes:
[0015] Determine the gray value distribution of the gray values less than the preset gray value in the gray histogram;
[0016] Determine the gray value corresponding to the pixel point with the largest number of pixel points less than the preset gray value in the gray value distribution as the binarization gray value.
[0017] Optionally, the size of the region to be measured includes a first size along the first direction and a second size along the second direction. The determining the size of the region to be measured according to the number of first pixel points and the number of second pixel points includes:
[0018] Determine the first preset quantity along the first direction and the second preset quantity along the second direction of the preset region to be measured in the template image;
[0019] Determine the first size of the region to be measured along the first direction according to the first preset quantity and the number of first pixel points, and determine the second size of the region to be measured along the second direction according to the second preset quantity and the number of second pixel points.
[0020] Optionally, the determining the first preset quantity along the first direction and the second preset quantity along the second direction of the preset region to be measured in the template image includes:
[0021] Perform a row-by-row scan of the preset region to be measured along the first direction to determine the number of pixel points in each row along the first direction, and perform a column-by-column scan of the preset region to be measured along the second direction to determine the number of pixel points in each column along the second direction;
[0022] Determine the first preset quantity according to the number of pixel points along the first direction and the second preset quantity according to the number of pixel points along the first direction.
[0023] Optionally, the determining the first size of the region to be measured along the first direction according to the first preset quantity and the number of first pixel points, and determining the second size of the region to be measured along the second direction according to the second preset quantity and the number of second pixel points includes:
[0024] When the ratio of the number of first pixel points of the region to be measured along the first direction to the first preset quantity reaches the first preset ratio, determine the number of first pixel points in the first direction of this row as the first size;
[0025] When the ratio of the number of second pixel points of the to-be-detected area in the second direction to the second preset quantity reaches the second preset ratio, determine that the number of second pixel points of the to-be-detected area in the second direction in this row is the second dimension.
[0026] Optionally, after binarizing the detection image according to the binarized gray value to obtain a binary image, the method further includes:
[0027] Determine the detection area of the binary image;
[0028] According to the detection area, perform the steps of determining the number of first pixel points of each row of the binary image corresponding to the to-be-detected area in the first direction and the number of second pixel points of each column in the second direction.
[0029] Optionally, determining the detection area of the binary image includes:
[0030] Determine the central position of the to-be-detected area in the binary image, and determine the detection area of the binary image with a first detection length in the first direction and a second detection length in the second direction from the central position.
[0031] In a second aspect, an embodiment of the present application provides a size detection device, where the size detection device includes:
[0032] An acquisition unit, configured to acquire a detection image of a to-be-detected part;
[0033] A determination unit, configured to determine a to-be-detected area in the detection image;
[0034] The determination unit is further configured to determine a gray level histogram of the to-be-detected area;
[0035] The determination unit is further configured to determine a binarized gray value according to the gray level histogram;
[0036] An image processing unit, configured to binarize the detection image according to the binarized gray value to obtain a binary image;
[0037] The determination unit is further configured to determine the number of first pixel points of each row of the to-be-detected area in the first direction and the number of second pixel points of each column in the second direction, where the first direction is perpendicular to the second direction;
[0038] The determination unit is further configured to determine the size of the to-be-detected area according to the number of first pixel points and the number of second pixel points.
[0039] In a third aspect, an embodiment of the present application provides a size detection device, including a processor, a memory, a transceiver, and one or more programs. The one or more programs are stored in the memory and configured to be executed by the processor. The programs include instructions for performing the steps in the method described in any of the above embodiments.
[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program causes a computer to execute the method described in any of the above embodiments.
[0041] It can be seen that in the embodiment of the present application, the size detection device acquires a detection image of the component to be measured; determines the measurement area in the detection image; determines the number of first pixel points in each row of the measurement area along a first direction and the number of second pixel points in each column along a second direction, where the first direction is perpendicular to the second direction; and determines the size of the measurement area according to the number of first pixel points and the number of second pixel points. Through the size detection method, the size of the measurement area on the component to be measured can be accurately determined, thereby facilitating the detection of the size of the component to be measured and avoiding the problem that the detection efficiency of the component to be measured is reduced due to the component being too large or too small without accurate detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] To more clearly illustrate the technical solutions in the embodiments of the present application or in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0043] Figure 1 is a flowchart of a size detection method provided by an embodiment of the present application;
[0044] Figure 2 is a schematic diagram of a binary image provided by an embodiment of the present application;
[0045] Figure 3 is a schematic diagram of the structure of a size detection device provided by an embodiment of the present application;
[0046] Figure 4 is a schematic diagram of the structure of a size detection device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] To enable those skilled in the art to better understand the solution of this application, the following will clearly and completely describe the technical solution in the embodiments of this application in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
[0048] The following will be described in detail respectively.
[0049] The terms "first", "second", "third", "fourth", etc. in the description and claims of this application and the accompanying drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally further include steps or units not listed, or may optionally further include other steps or units inherent to these processes, methods, products or devices.
[0050] Referring to "embodiment" herein means that a specific feature, structure or characteristic described in connection with the embodiment may be included in at least one embodiment of this application. The phrase appears in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein may be combined with other embodiments.
[0051] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of a dimension detection method provided by an embodiment of this application. As Figure 1 shown, the dimension detection method includes:
[0052] Step 10, obtaining a detection image of the part to be measured;
[0053] Wherein, the part to be measured is a wafer. It can be understood that the part to be measured can also be a glass substrate or other products that need to be used for surface detection.
[0054] It can be understood that for the dimension detection method described in this application, when the detection device has already acquired the detection image of the part to be measured by other means, step 10 can be omitted and the step of determining the area to be measured in the detection image in step 20 can be directly executed.
[0055] Step 20, determining the area to be measured in the detection image;
[0056] Among them, the template image can be a template image preset by the user, or a detection image of a standard part or other product. Specifically, the template image includes a region to be measured for determining the part to be measured.
[0057] Among them, the region to be measured in the detection image corresponds to the region that needs to be detected for the part to be measured. Specifically, the part to be measured is a wafer, and a plurality of conductive lines are provided on the wafer. And in order to facilitate the connection of a plurality of conductive lines simultaneously, a conductive protruding region is provided on the wafer. The conductive protruding region is connected to the plurality of conductive lines. When an external component needs to be connected to the plurality of conductive lines simultaneously, the external component can be directly connected to the conductive protruding region, so as to facilitate the connection of all the conductive lines connected to the conductive protruding region. In a specific embodiment, the region to be measured is the conductive protruding region of the wafer.
[0058] Step 30: Determine the number of first pixel points in each row of the region to be measured along the first direction and the number of second pixel points in each column along the second direction, where the first direction is perpendicular to the second direction;
[0059] Among them, after performing binarization processing on the detection image and obtaining the binary image, in order to facilitate determining the size of the region to be measured, it is necessary to determine the number of first pixel points in each row of the binary image corresponding to the region to be measured along the first direction and the number of second pixel points in each column along the second direction. In a specific embodiment, the region to be measured is rectangular, the first direction is parallel to one side edge of the region to be measured, the second direction is parallel to the other side edge of the region to be measured, and the first direction is perpendicular to the second direction.
[0060] In an alternative embodiment, the determining the number of first pixel points in each row of the region to be measured along the first direction and the number of second pixel points in each column along the second direction, where the first direction is perpendicular to the second direction, includes:
[0061] Determine the gray-level histogram of the region to be measured;
[0062] Among them, the gray-level histogram is used to statistically analyze the gray-level distribution of an image or a certain region in an image. Specifically, the gray-level histogram is to count the frequency of occurrence of all pixels in a digital image according to the size of the gray value. The gray-level histogram is a function of the gray level, which represents the number of pixels with a certain gray level in the image and reflects the frequency of occurrence of a certain gray level in the image.
[0063] Determine the binarization gray value according to the gray-level histogram;
[0064] Perform binarization on the detection image according to the binarization gray value to obtain a binary image;
[0065] Determine the number of first pixel points in each row of the binary image corresponding to the region to be measured along the first direction and the number of second pixel points in each column along the second direction, where the first direction is perpendicular to the second direction.
[0066] Among them, after determining the gray-level histogram of the region to be measured, it is also necessary to perform binarization processing on the detection image, so as to facilitate the detection of the size of the object to be measured corresponding to the detection image.
[0067] Among them, during the binarization process of the detection image, in order to facilitate the judgment of the region to be measured, the gray-level values of the pixel points with gray-level values greater than or equal to the binarization gray-level value are adjusted to 255, making them adjusted to white pixel points, and the gray-level values of the pixel points with gray-level values less than the binarization gray-level value are adjusted to, making them adjusted to black pixel points.
[0068] Among them, determining the binarization gray-level value according to the gray-level histogram includes:
[0069] Determine the gray-level value distribution of the gray-level values less than the preset gray-level value in the gray-level histogram;
[0070] Determine the gray-level value corresponding to the largest number of pixel points with gray-level values less than the preset gray-level value as the binarization gray-level value.
[0071] Among them, the preset gray-level value is 50, 100 or other gray-level values. The preset gray-level value can be an input by the user or a preset gray-level value, and can also be a gray-level value calculated according to the detection image.
[0072] Among them, when collecting the image of the object to be measured, the gray-level value of the functional area on the object to be measured, such as the conductive area, is relatively high, but the gray-level value of the non-functional area is relatively low. Therefore, the pixel points on the detection image can be divided according to the preset gray-level value.
[0073] Specifically, in a specific embodiment, the detection image includes a plurality of pixel points, and each pixel point has a corresponding gray-level value. In order to facilitate the determination of the binarization gray-level value, determine the gray-level values less than the preset gray-level value in the gray-level histogram. After determining the gray-level histogram according to the gray-level value of each pixel point, determine the gray-level value distribution of the detection image according to the gray-level histogram, then determine the pixel points with gray-levels less than the preset gray-level value as the corresponding binarization gray-level value, and then perform binarization processing on the detection image according to the binarization gray-level value, so as to reduce the influence of details in the binarization process of the detection image, reduce detail loss, reduce noise generated in the image processing process, and improve the detection efficiency.
[0074] Among them, after binarizing the detection image according to the binarized grayscale value to obtain a binary image, the following steps are further included:
[0075] Determine the detection area of the binary image;
[0076] According to the detection area, perform the steps of determining the number of first pixel points in each row of the binary image corresponding to the area to be measured along the first direction and the number of second pixel points in each column along the second direction.
[0077] Among them, please refer to Figure 2 , the first direction is the horizontal direction of the detection image, the second direction is the vertical direction of the detection image, and the first direction is perpendicular to the second direction.
[0078] Among them, the detection area is used to represent the detection range of the detection device when measuring the size of the area to be measured. Specifically, when the binary image includes multiple areas to be measured, in order to facilitate the detection of the areas to be measured and avoid the influence of pixel points in other areas outside the area to be measured on the detection result of the area to be measured, it is necessary to first determine the detection area of the binary image.
[0079] Among them, determining the detection area of the binary image includes:
[0080] Determine the central position of the area to be measured in the binary image, and determine the detection area of the binary image with the first detection length in the first direction and the second detection length in the second direction from the central position.
[0081] Among them, the first detection length is 500 pixels, 600 pixels or other lengths.
[0082] Among them, the second detection length is 500 pixels, 600 pixels or other lengths.
[0083] Among them, when determining the detection area of the binary image, first determine the central position of the area to be measured. Specifically, the central position of the area to be measured can be determined according to the position information of the preset area to be measured in the template image, or can also be determined by the position information input by the user.
[0084] Among them, after determining the central position, determine the detection area of the binary image according to the first detection length and the second detection length. In a specific embodiment, the ratio of the first detection length to the second detection length is equal to the ratio of the length in the first direction to the length in the second direction of the preset area to be measured in the template image, so as to ensure that the detection area can completely cover the area to be measured.
[0085] Step 40: Determine the size of the area to be measured according to the number of the first pixel points and the number of the second pixel points.
[0086] Among them, after determining the number of the first pixel points in the first direction and the number of the second pixel points in the second direction, determine the size of the area to be measured according to the number of the first pixel points and the number of the second pixel points.
[0087] Among them, each pixel point in the detected image corresponds to a certain size on the piece to be measured. In a specific embodiment, the length of the photographing area of the piece to be measured in the first direction is 100 mm, and the number of pixel points in the first direction of the detected image corresponding to the photographing area of the piece to be measured is 1000. Then, it can be determined that each pixel point corresponds to a length of 0.1 mm of the piece to be measured in the first direction.
[0088] Among them, the size of the area to be measured includes a first size in the first direction and a second size in the second direction. The determining the size of the area to be measured according to the number of the first pixel points and the number of the second pixel points further includes:
[0089] Determine a first preset quantity in the first direction and a second preset quantity in the second direction of a preset area to be measured in the template image;
[0090] Determine a first size in the first direction of a feature area in the detected image according to the first preset quantity and the number of the first pixel points, and determine a second size in the second direction of the feature area in the detected image according to the second preset quantity and the number of the second pixel points.
[0091] Among them, in order to facilitate the determination of the size of the area to be measured in the detected image, it is first necessary to determine the size of the preset area to be measured in the template image, and determine the edge in the detected image according to the preset area to be measured.
[0092] Among them, the determining a first preset quantity in the first direction and a second preset quantity in the second direction of a preset area to be measured in the template image includes:
[0093] Perform a row-by-row scan on the preset area to be measured in the first direction to determine the number of pixel points in each row in the first direction, and perform a column-by-column scan on the preset area to be measured in the second direction to determine the number of pixel points in each column in the second direction;
[0094] Determine the first preset quantity according to the number of pixel points in the first direction and determine the second preset quantity according to the number of pixel points in the first direction.
[0095] Among them, when the preset area to be measured is rectangular, the number of pixel points in each row of the preset area to be measured along the first direction is equal. Then, the number of pixel points in any row along the first direction is the first preset number of the preset area to be measured. The number of pixel points in each column of the preset area to be measured along the second direction is equal. Then, the number of pixel points in any column along the second direction is the first preset number of the preset area to be measured.
[0096] When the corners of the preset area to be measured are polygonal or circular, the number of pixel points in each row of the preset area to be measured along the first direction is not equal. Then, determine the number of pixel points in the row with the largest number of pixel points along the first direction as the first preset number. The number of pixel points in each column of the preset area to be measured along the second direction is not equal. Then, determine the number of pixel points in the column with the largest number of pixel points along the second direction as the second preset number.
[0097] Among them, the determining the first dimension of the area to be measured along the first direction according to the first preset number and the number of the first pixel points, and determining the second dimension of the area to be measured along the second direction according to the second preset number and the number of the second pixel points includes:
[0098] When the ratio of the number of the first pixel points of the area to be measured along the first direction to the first preset number reaches the first preset ratio, determine the number of the first pixel points in the first direction of this row as the first dimension;
[0099] When the ratio of the number of the second pixel points of the area to be measured along the second direction to the second preset number reaches the second preset ratio, determine the number of the second pixel points in the second direction of this row as the second dimension.
[0100] Among them, the first preset ratio is 70%, 80% or other values.
[0101] Among them, the second preset ratio is 70%, 80% or other values.
[0102] Among them, when the corners of the area to be measured are arc-shaped or polygonal, the edges of the area to be measured may not be detected, thereby improving the detection efficiency of the area to be measured. In a specific embodiment, the first preset quantity of the template image in the first direction is 100 pixels, the second preset quantity in the second direction is 200 pixels, the first preset ratio is 80%, and the second preset ratio is 90%. When detecting the characteristic area of the detection image row by row, when the ratio of the number of first pixel points in any row to the first preset quantity reaches 80% and the ratio of the number of first pixel points in the previous row to the first preset quantity does not reach 80%, determine the row position where the number of first pixel points is currently located as one side edge of the area to be measured in the first direction. When the ratio of the number of first pixel points in any row to the first preset quantity reaches 80% and the ratio of the number of first pixel points in the next row to the first preset quantity does not reach 80%, determine the row position where the number of first pixel points is currently located as the other side edge of the area to be measured in the first direction.
[0103] And so on, when the ratio of the number of second pixel points in any column to the first preset quantity reaches 90% and the ratio of the number of second pixel points in the previous column to the first preset quantity does not reach 90%, determine the column position where the number of second pixel points is currently located as one side edge of the area to be measured in the first direction. When the ratio of the number of second pixel points in any column to the first preset quantity reaches 90% and the ratio of the number of second pixel points in the next column to the first preset quantity does not reach 90%, determine the column position where the number of second pixel points is currently located as the other side edge of the area to be measured in the first direction.
[0104] By setting the first preset ratio and the second preset ratio, it is possible to avoid misjudgment of the characteristic area of the detection image caused by noise. In a specific embodiment, the first preset quantity is 100 and the first preset ratio is 80%. They are respectively A1 to A100. First, the detection device detects row by row from left to right. When the number of white pixel points in row A19 is 79 and the number of white pixel points in row A20 is 80, the number of pixel points in row A19 is less than the product of the first preset quantity and the first preset ratio, and the number of pixel points in row A20 is greater than or equal to the product of the first preset quantity and the first preset ratio. Therefore, determine row A20 as the upper side edge of the characteristic area.
[0105] Similarly, when the number of white pixel points in row A80 is 80 and the number of white pixel points in row A81 is 78, the number of pixel points in row A80 is greater than or equal to the product of the first preset quantity and the first preset ratio, and the number of pixel points in row A81 is less than the product of the first preset quantity and the first preset ratio. Then row A80 is the lower side edge of the characteristic area.
[0106] When determining that the left edge of the feature region is in column A20 and the right edge of the feature region is in column A80, the number of first pixel points of the feature region along the first direction is determined to be 80 - 20 = 60 pixel points.
[0107] It can be understood that when determining the second dimension of the feature region along the second direction, the method used is the same as that for determining the first dimension of the feature region, and will not be elaborated here.
[0108] After determining the number of first pixel points of the detection image along the first direction and the number of second pixel points along the second direction, the first dimension is determined according to the number of first pixel points and the second dimension is determined according to the number of second pixel points. In a specific embodiment, when the length of each pixel point corresponding to the test piece along the first direction is 0.1 mm, the number of first pixel points is 100, and the number of second pixel points is 200, then the first dimension of the test region along the first direction is 100 * 0.1 = 10 mm, and the second dimension along the second direction is 200 * 0.1 = 20 mm.
[0109] In the embodiment of the present application, the dimension detection device acquires a detection image of a test piece; determines a test region in the detection image; determines the number of first pixel points in each row of the test region along the first direction and the number of second pixel points in each column along the second direction, where the first direction is perpendicular to the second direction; determines the dimension of the test region according to the number of first pixel points and the number of second pixel points. Through the dimension detection method, the dimension of the test region on the test piece can be accurately determined, so as to facilitate the detection of the dimension of the test piece, avoid the test piece not being accurately detected due to being too large or too small in size, and solve the problem of reduced detection efficiency of the test piece.
[0110] Please refer to Figure 3 , Figure 3 which is a schematic structural diagram of a dimension detection device provided by an embodiment of the present application. As shown in the figure, the service device includes a processor, a memory, a transceiver interface, and one or more programs. Among them, the above one or more programs are stored in the above memory and are configured to be executed by the above processor. The above programs include instructions for performing the following steps:
[0111] Acquire a detection image of a test piece;
[0112] Determine the test region in the detection image;
[0113] Determine the number of first pixel points in each row of the test region along the first direction and the number of second pixel points in each column along the second direction, where the first direction is perpendicular to the second direction;
[0114] Determine the size of the region to be measured according to the number of the first pixel points and the number of the second pixel points.
[0115] In an implementation manner of the present application, in determining the number of the first pixel points in each row of the region to be measured along the first direction and the number of the second pixel points in each column along the second direction, where the first direction is perpendicular to the second direction, the above program includes instructions specifically for performing the following steps:
[0116] Determine the grayscale histogram of the region to be measured;
[0117] Determine the binarization grayscale value according to the grayscale histogram;
[0118] Binarize the detection image according to the binarization grayscale value to obtain a binary image;
[0119] Determine the number of the first pixel points in each row of the binary image corresponding to the region to be measured along the first direction and the number of the second pixel points in each column along the second direction, where the first direction is perpendicular to the second direction.
[0120] In an implementation manner of the present application, in determining the binarization grayscale value according to the grayscale histogram, the above program further includes instructions for performing the following steps:
[0121] Determine the grayscale value distribution of the grayscale values less than a preset grayscale value in the grayscale histogram;
[0122] Determine the grayscale value corresponding to the pixel point with the largest number of pixel points less than the preset grayscale value in the grayscale value distribution as the binarization grayscale value.
[0123] In an implementation manner of the present application, in determining the size of the region to be measured according to the number of the first pixel points and the number of the second pixel points, the above program includes instructions specifically for performing the following steps:
[0124] Determine the first preset quantity of the preset region to be measured in the template image along the first direction and the second preset quantity along the second direction;
[0125] Determine the first size of the region to be measured along the first direction according to the first preset quantity and the number of the first pixel points, and determine the second size of the region to be measured along the second direction according to the second preset quantity and the number of the second pixel points.
[0126] In an implementation manner of the present application, in determining the first preset quantity of the preset region to be measured in the template image along the first direction and the second preset quantity along the second direction, the above program further specifically includes instructions for performing the following steps after that:
[0127] Perform a line-by-line scan of the preset area to be measured along the first direction to determine the number of pixel points in each line along the first direction, and perform a column-by-column scan of the preset area to be measured along the second direction to determine the number of pixel points in each column along the second direction;
[0128] Determine the first preset quantity according to the number of pixel points along the first direction and the second preset quantity according to the number of pixel points along the first direction.
[0129] In an implementation manner of the present application, in terms of determining the first dimension of the area to be measured along the first direction according to the first preset quantity and the number of the first pixel points, and determining the second dimension of the area to be measured along the second direction according to the second preset quantity and the number of the second pixel points, the above program includes instructions specifically for performing the following steps:
[0130] When the ratio of the number of the first pixel points of the area to be measured along the first direction to the first preset quantity reaches the first preset ratio, determine the number of the first pixel points of this line in the first direction as the first dimension;
[0131] When the ratio of the number of the second pixel points of the area to be measured along the second direction to the second preset quantity reaches the second preset ratio, determine the number of the second pixel points of this line in the second direction as the second dimension.
[0132] In an implementation manner of the present application, after the above program, in terms of binarizing the detection image according to the binarized grayscale value to obtain a binary image, it is also used to execute instructions for performing the following steps:
[0133] Determine the detection area of the binary image;
[0134] According to the detection area, perform the step of determining the number of the first pixel points in each line of the binary image corresponding to the area to be measured along the first direction and the number of the second pixel points in each column along the second direction.
[0135] In an implementation manner of the present application, in terms of determining the detection area of the binary image, the above program is specifically used to execute instructions for performing the following steps:
[0136] Determine the central position of the area to be measured in the binary image, and determine the detection area of the binary image with the first detection length in the first direction and the second detection length in the second direction from the central position.
[0137] It should be noted that for the specific implementation process of this embodiment, reference can be made to the specific implementation process described in the above method embodiment, which will not be elaborated here.
[0138] Please refer to Figure 4 , Figure 4A dimension detection device provided by an embodiment of the present application is applied to a dimension detection device, and the dimension detection device includes:
[0139] An acquisition unit 410, configured to acquire a detection image of a to-be-detected part;
[0140] A determination unit 420, configured to determine a to-be-detected area in the detection image;
[0141] The determination unit 420 is further configured to determine the number of first pixel points in each row of the to-be-detected area along a first direction and the number of second pixel points in each column along a second direction, where the first direction is perpendicular to the second direction;
[0142] The determination unit 420 is further configured to determine the size of the to-be-detected area according to the number of first pixel points and the number of second pixel points.
[0143] In an implementation manner of the present application, in terms of determining a binarization gray value according to the gray histogram, the determination unit 420 is specifically configured to:
[0144] Determine the gray histogram of the to-be-detected area;
[0145] Determine the binarization gray value according to the gray histogram;
[0146] Binarize the detection image according to the binarization gray value to obtain a binary image;
[0147] Determine the number of first pixel points in each row of the binary image corresponding to the to-be-detected area along a first direction and the number of second pixel points in each column along a second direction, where the first direction is perpendicular to the second direction.
[0148] In an implementation manner of the present application, in terms of determining a binarization gray value according to the gray histogram, the determination unit 420 is specifically configured to:
[0149] Determine the gray value distribution of gray values less than a preset gray value in the gray histogram;
[0150] Determine the gray value corresponding to the pixel point with the largest number of pixel points with gray values less than the preset gray value in the gray value distribution as the binarization gray value..
[0151] In an implementation manner of the present application, in terms of determining the size of the to-be-detected area according to the number of first pixel points and the number of second pixel points, the determination unit 420 is specifically configured to:
[0152] Determine a first preset quantity along a first direction and a second preset quantity along a second direction of a preset to-be-detected area in a template image;
[0153] Determine a first dimension of the region to be measured along a first direction according to a first preset quantity and the number of the first pixel points, and determine a second dimension of the region to be measured along a second direction according to a second preset quantity and the number of the second pixel points.
[0154] In an implementation manner of the present application, in terms of determining a first preset quantity along the first direction and a second preset quantity along the second direction of a preset region to be measured in a template image, the determining unit 420 is specifically configured to:
[0155] Perform a line-by-line scan of the preset region to be measured along the first direction to determine the number of pixel points in each row along the first direction, and perform a column-by-column scan of the preset region to be measured along the second direction to determine the number of pixel points in each column along the second direction;
[0156] Determine the first preset quantity according to the number of pixel points along the first direction and determine the second preset quantity according to the number of pixel points along the first direction.
[0157] In an implementation manner of the present application, in terms of determining a first dimension of the region to be measured along the first direction according to a first preset quantity and the number of the first pixel points, and determining a second dimension of the region to be measured along the second direction according to a second preset quantity and the number of the second pixel points, the determining unit 420 is specifically configured to:
[0158] When the ratio of the number of first pixel points of the region to be measured along the first direction to the first preset quantity reaches a first preset ratio, determine the number of first pixel points of the row along the first direction as the first dimension;
[0159] When the ratio of the number of second pixel points of the region to be measured along the second direction to the second preset quantity reaches a second preset ratio, determine the number of second pixel points of the row along the second direction as the second dimension.
[0160] In an implementation manner of the present application, after the determining unit 420, in terms of binarizing the detection image according to the binarized gray value to obtain a binary image, it is further configured to:
[0161] Determine a detection region of the binary image;
[0162] According to the detection region, perform steps of determining the number of first pixel points in each row of the binary image corresponding to the region to be measured along the first direction and the number of second pixel points in each column along the second direction.
[0163] In an implementation manner of the present application, in terms of determining the detection region of the binary image, the determining unit 420 is specifically configured to:
[0164] Determine the central position of the area to be measured in the binary image, and determine the detection area of the binary image according to the first detection length in the first direction and the second detection length in the second direction from the central position.
[0165] It should be noted that the determination unit 420 and the image processing unit 430 can be implemented by a processor, and the acquisition unit 410 is implemented through transceiver.
[0166] The embodiments of the present application also provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute some or all of the steps described for the service device in the above method embodiments.
[0167] The embodiments of the present application also provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute some or all of the steps described for the service device in the above method. The computer program product can be a software installation package.
[0168] The steps of the method or algorithm described in the embodiments of the present application can be implemented in a hardware manner or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a random access memory (Random Access Memory, RAM), flash memory, read-only memory (Read Only Memory, ROM), erasable programmable read-only memory (Erasable Programmable ROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), registers, hard disks, removable hard disks, compact discs read-only memory (CD-ROM) or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in an access network device, a target network device or a core network device. Of course, the processor and the storage medium can also exist as discrete components in the access network device, the target network device or the core network device.
[0169] Those skilled in the art should be able to realize that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a Digital Video Disc (DVD)), or a semiconductor medium (such as a Solid State Disk (SSD)), etc.
[0170] The specific embodiments described above further elaborate on the objectives, technical solutions, and beneficial effects of the embodiments of the present application. It should be understood that the above description is only the specific embodiments of the embodiments of the present application and is not used to limit the protection scope of the embodiments of the present application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.
Claims
1. A dimension detection method, characterized in that, The dimension detection method includes: Obtaining a detection image of the component to be measured; Determining a measurement area in the detection image; Determining the number of first pixel points in each row of the measurement area along a first direction and the number of second pixel points in each column along a second direction, where the first direction is perpendicular to the second direction; Determining the dimension of the measurement area according to the number of first pixel points and the number of second pixel points; Wherein, the dimension of the measurement area includes a first dimension along the first direction and a second dimension along the second direction, and determining the dimension of the measurement area according to the number of first pixel points and the number of second pixel points includes: Determining a first preset quantity along the first direction and a second preset quantity along the second direction of a preset measurement area in a template image; When the ratio of the number of first pixel points in any row to the first preset quantity reaches a first preset ratio, and the ratio of the number of first pixel points in the previous row to the first preset quantity does not reach the first preset ratio, determining the row position where the number of first pixel points is currently located as one side edge of the measurement area along the first direction; when the ratio of the number of first pixel points in any row to the first preset quantity reaches the first preset ratio, and the ratio of the number of first pixel points in the next row to the first preset quantity does not reach the first preset ratio, determining the row position where the number of first pixel points is currently located as the other side edge of the measurement area along the first direction; When the ratio of the number of second pixel points in any column to the second preset quantity reaches a second preset ratio, and the ratio of the number of second pixel points in the previous column to the second preset quantity does not reach the second preset ratio, determining the column position where the number of second pixel points is currently located as one side edge of the measurement area along the second direction; when the ratio of the number of second pixel points in any column to the second preset quantity reaches the second preset ratio, and the ratio of the number of second pixel points in the next column to the second preset quantity does not reach the second preset ratio, determining the column position where the number of second pixel points is currently located as the other side edge of the measurement area along the second direction; Determining the first dimension of the measurement area along the first direction according to the two side edges of the measurement area along the first direction, and determining the second dimension of the measurement area along the second direction according to the two side edges of the measurement area along the second direction.
2. The dimensional inspection method according to claim 1, wherein Determining the number of first pixel points in each row of the measurement area along the first direction and the number of second pixel points in each column along the second direction, where the first direction is perpendicular to the second direction, includes: Determining the grayscale histogram of the measurement area; Determining a binarized grayscale value according to the grayscale histogram; Binarizing the detection image according to the binarized grayscale value to obtain a binary image; Determining the number of first pixel points in each row of the binary image corresponding to the measurement area along the first direction and the number of second pixel points in each column along the second direction, where the first direction is perpendicular to the second direction.
3. The dimensional inspection method according to claim 2, characterized in that, Determining the binarized grayscale value according to the grayscale histogram includes: Determine the gray value distribution in the gray histogram where the gray value is less than a preset gray value; Determine the gray value corresponding to the pixel point with the largest number of pixel points whose gray value is less than the preset gray value in the gray value distribution as the binarization gray value.
4. The dimensional inspection method according to claim 1, wherein The determination of the first preset quantity in the first direction and the second preset quantity in the second direction of the preset measurement area in the template image includes: Perform a line-by-line scan of the preset measurement area in the first direction to determine the number of pixel points in each row in the first direction, and perform a column-by-column scan of the preset measurement area in the second direction to determine the number of pixel points in each column in the second direction; Determine the first preset quantity according to the number of pixel points in the first direction and determine the second preset quantity according to the number of pixel points in the second direction.
5. The dimensional inspection method according to claim 2, characterized in that, After binarizing the detection image according to the binarization gray value to obtain a binary image, it further includes: Determine the detection area of the binary image; According to the detection area, perform the step of determining the number of first pixel points in each row in the first direction and the number of second pixel points in each column in the second direction corresponding to the measurement area of the binary image.
6. The dimensional inspection method according to claim 5, characterized in that, The determination of the detection area of the binary image includes: Determine the central position of the measurement area in the binary image, and determine the detection area of the binary image with the first detection length in the first direction and the second detection length in the second direction from the central position.
7. A dimension detection device, characterized in that, The size detection device includes: An acquisition unit for acquiring a detection image of a workpiece to be measured; A determination unit for determining the measurement area in the detection image; The determination unit is further configured to determine the number of first pixel points in each row in the first direction and the number of second pixel points in each column in the second direction of the measurement area, and the first direction is perpendicular to the second direction; The determination unit is further configured to determine the size of the measurement area according to the number of first pixel points and the number of second pixel points, specifically: Determine the first preset quantity in the first direction and the second preset quantity in the second direction of the preset measurement area in the template image; When the ratio of the number of first pixel points in any row to the first preset quantity reaches the first preset ratio, and the ratio of the number of first pixel points in the previous row to the first preset quantity does not reach the first preset ratio, determine the row position where the number of first pixel points is currently located as one side edge of the measurement area in the first direction; when the ratio of the number of first pixel points in any row to the first preset quantity reaches the first preset ratio, and the ratio of the number of first pixel points in the next row to the first preset quantity does not reach the first preset ratio, determine the row position where the number of first pixel points is currently located as the other side edge of the measurement area in the first direction; When the ratio of the number of second pixel points in any column to the second preset quantity reaches the second preset ratio, and the ratio of the number of second pixel points in the previous column to the second preset quantity does not reach the second preset ratio, determine the column position where the number of second pixel points is currently located as one side edge of the region to be measured along the second direction; when the ratio of the number of second pixel points in any column to the second preset quantity reaches the second preset ratio, and the ratio of the number of second pixel points in the next column to the second preset quantity does not reach the second preset ratio, determine the column position where the number of second pixel points is currently located as the other side edge of the region to be measured along the second direction; Determine the first dimension of the region to be measured along the first direction according to the two side edges of the region to be measured along the first direction, and determine the second dimension of the region to be measured along the second direction according to the two side edges of the region to be measured along the second direction.
8. A dimension detection device, characterized in that, It includes a processor, a memory, a transceiver, and one or more programs. The one or more programs are stored in the memory and are configured to be executed by the processor. The programs include instructions for performing the steps in the method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, Store a computer program for electronic data exchange, wherein the computer program causes the computer to execute the method according to any one of claims 1-6.
Citation Information
Patent Citations
Banknote identification method and device
CN106340116A
Core wire size non-contact type visual detection device and method for automobile wire harness
CN109974582A
Computer imaging pre-processing for automated medication dispensing analysis
CN111432776A