Image Processing Method, Electronic Device, and Computer-Readable Storage Medium
By generating the corrected grayscale values of pixels and using the rolling average value and threshold comparison, the problem of low graphic boundary recognition accuracy in the image is solved, and a higher precision graphic size measurement is achieved.
Patent Information
- Application Number
- CN202411161673.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2044-08-22
AI Technical Summary
The prior art has the problem of low recognition accuracy when identifying the graphic boundaries in transmission electron microscopes and scanning electron microscope images, especially in the case of uneven background noise, which is difficult to accurately obtain measurement results.
By generating the corrected grayscale value for each pixel, the boundary point of the figure in the image is identified by using the scroll average value and the difference in the pixel grayscale value in a predetermined range, combined with the threshold comparison.
The signal strength of the graphic boundary area is improved, the recognition ability of the graphic boundary is enhanced, and thus the accuracy of graphic dimension measurement is improved.
Smart Images

Figure CN118674668B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure mainly relate to image processing, and more specifically, to an image processing method, an electronic device, and a computer-readable storage medium. Background Art
[0002] In semiconductor processes, it is often necessary to measure the thickness of patterns, the critical dimension (CD) of patterns in images captured by a transmission electron microscope (TEM), and the CD of patterns in images captured by a scanning electron microscope (SEM), etc. During the measurement process, it is necessary to identify the pattern boundaries to ensure the accuracy of the measurement. Different patterns have different gray-scale differences under SEM or TEM, and when there are multiple materials or the background noise in the picture is uneven, it has an adverse effect on accurately obtaining the measurement result.
[0003] Traditional solutions usually use some common filtering methods to process images. These solutions usually have defects such as low recognition accuracy. Summary of the Invention
[0004] According to an exemplary embodiment of the present disclosure, an image processing solution is provided to at least partially overcome the above or other potential defects.
[0005] According to one aspect of the present disclosure, an image processing method is provided. The method includes: respectively generating a corrected gray value for each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels in a predetermined adjacent range of each pixel in the set of pixels; respectively comparing the corrected gray values of the respective pixels in the set of pixels with a threshold value, where the threshold value is related to the gray values of the respective pixels in the set of pixels; and identifying the pixels having a corrected gray value greater than the threshold value among the respective pixels as the boundary points of the pattern in the image.
[0006] In a second aspect of the present disclosure, an electronic device is provided. The electronic device includes a processor; and a memory coupled to the processor, the memory having instructions stored therein that, when executed by the processor, cause the device to perform operations, the operations including: respectively generating a corrected gray value for each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels in a predetermined adjacent range of each pixel in the set of pixels; respectively comparing the corrected gray values of the respective pixels in the set of pixels with a threshold value, where the threshold value is related to the gray values of the respective pixels in the set of pixels; and identifying the pixels having a corrected gray value greater than the threshold value among the respective pixels as the boundary points of the pattern in the image.
[0007] In some embodiments, generating a corrected gray value for each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels within a predetermined adjacent range of each pixel in the set of pixels includes: determining a rolling average of the respective gray values of the individual pixels in the set of pixels; and generating the corrected gray value based on the difference between the rolling average of the respective gray values of the individual pixels and the rolling average of the pixels within the predetermined adjacent range of each pixel.
[0008] In some embodiments, determining a rolling average of the respective gray values of the individual pixels in a set of pixels in a predetermined direction includes: for each pixel within an edge range in the set of pixels, determining a first rolling average of the respective gray values of the individual pixels based on the gray values of the pixels within a first range related to a predetermined rolling step, where the length of the edge range is equal to the predetermined rolling step; and for each pixel within an intermediate range outside the edge range in the set of pixels, determining a second rolling average of the respective gray values of the individual pixels within the intermediate range based on the gray values of the pixels within the first range related to the predetermined rolling step.
[0009] In some embodiments, generating a corrected gray value for each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels within a predetermined adjacent range of each pixel in the set of pixels includes: using a predetermined constant as the corrected gray value for each pixel within an edge range in the set of pixels, where the length of the edge range is equal to the predetermined range; and for each pixel within an intermediate range outside the edge range in the set of pixels, generating the corresponding corrected gray value based on the average gray value of the pixels within the predetermined adjacent range of each pixel.
[0010] In some embodiments, generating the corresponding corrected gray value based on the average gray value of the pixels within the predetermined adjacent range of each pixel includes: using a predetermined constant as the corrected gray value for each pixel within an edge range in the set of pixels, where the length of the edge range is equal to the predetermined range; and determining the average gray value of the pixels within the intermediate range outside the edge range in the set of pixels based on the predetermined range, and using each average gray value as the corrected gray value for the corresponding pixel within the intermediate range.
[0011] In some embodiments, determining the average gray value of each pixel in the middle range except the edge range among a set of pixels in a predetermined direction based on a predetermined range includes: respectively determining a first average value of the gray values of the pixels in a predetermined range at the adjacent position on one side of each pixel in the middle range among the set of pixels; respectively determining a second average value of the gray values of the pixels in a predetermined range at the adjacent position on the other side of each pixel in the middle range among the set of pixels; respectively determining a first absolute value of the difference between the gray value of each pixel and the corresponding first average value; respectively determining a second absolute value of the difference between the gray value of each pixel and the corresponding second average value; and respectively taking the sum of the corresponding first absolute value and the corresponding second absolute value as the corrected gray value of each pixel in the middle range.
[0012] In some embodiments, the corrected gray value is determined using the following formula:
[0013]
[0014] Where represents the corrected gray value of the i-th pixel, i represents the i-th pixel in a set of pixels, represents the gray value of the i-th pixel, k is an integer greater than or equal to 1, and n represents the total number of pixels in a set of pixels.
[0015] In some embodiments, respectively comparing the corrected gray value of each pixel in a set of pixels with a threshold includes: determining the percentile of the gray value of each pixel based on the gray value of each pixel in a set of pixels; and taking the percentile as the threshold of the corresponding set of pixels.
[0016] In some embodiments, respectively generating the corrected gray value of each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels in a predetermined adjacent range of each pixel in the set of pixels further includes: determining the average value of the gray values of each set of pixels based on the gray values of a set of pixels in the image and the gray values of at least one set of adjacent pixels of the set of pixels; and determining the determined average value as the corrected gray value of the set of pixels.
[0017] In some embodiments, before generating the corrected gray value, it further includes: performing Gaussian filtering or median filtering on the image to generate a noise-reduced image.
[0018] In some embodiments, the image is a transmission electron microscope image or a scanning electron microscope image.
[0019] In a third aspect of the present disclosure, there is provided a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, it implements the method according to the first aspect of the present disclosure.
[0020] As will be understood from the following description, the technical solution of the present disclosure can effectively improve the signal strength in the boundary region of a pattern, making it easier to identify the boundaries of different pattern regions, thereby contributing to improving the measurement accuracy of pattern dimensions.
[0021] The Summary of the Invention section is provided to introduce a selection of concepts in a simplified form, which will be further described in the Detailed Description below. The Summary of the Invention section is not intended to identify the key features or essential features of the present disclosure, nor is it intended to limit the scope of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;
[0023] Figure 2 A flowchart showing an image processing method according to some embodiments of the present disclosure;
[0024] Figure 3 A schematic diagram showing an image to be processed according to an embodiment of the present disclosure;
[0025] Figure 4 Shows Figure 3 A schematic diagram showing the original gray value curve of the image to be processed shown;
[0026] Figure 5 Shows as Figure 4 A schematic diagram showing the gray value curve after the rolling average processing of the gray value curve shown;
[0027] Figure 6 A flowchart showing the optimized calculation of the pattern contour in an image according to some embodiments of the present disclosure;
[0028] Figure 7 Shows according to some embodiments of the present disclosure Figure 5 A schematic diagram showing the curve after optimizing the gray value curve shown;
[0029] Figure 8 Shows according to some embodiments of the present disclosure Figure 7 A schematic diagram showing the boundary position obtained after percentile extraction of the gray value curve shown;
[0030] Figure 9 A flowchart showing an image processing method according to some other embodiments of the present disclosure;
[0031] Figure 10 A schematic diagram showing the boundary position obtained by processing an image according to some embodiments of the present disclosure;
[0032] Figure 11shows a schematic diagram of a gray value curve corresponding to the boundary position of Figure 10 after the image is processed using an image processing method according to other embodiments of the present disclosure;
[0033] Figure 12 shows a block diagram of a computing device capable of implementing multiple embodiments of the present disclosure.
[0034] In each of the drawings, the same or corresponding reference numerals denote the same or corresponding parts. Detailed Embodiments
[0035] The principles of the present disclosure will be described below with reference to various exemplary embodiments shown in the drawings. It should be understood that the description of these embodiments is only for enabling those skilled in the art to better understand and further implement the present disclosure, and is not intended to limit the scope of the present disclosure in any way. It should be noted that where feasible, similar or identical reference numerals may be used in the figures, and similar or identical reference numerals may represent similar or identical functions. Those skilled in the art will readily recognize that alternative embodiments of the structures and methods described herein may be employed without departing from the principles of the invention described herein.
[0036] As used herein, the term "comprising" and its variations mean open inclusion, i.e., "including but not limited to". Unless specifically stated otherwise, the term "or" means "and / or". The term "based on" means "at least partially based on". The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. may refer to different or the same objects.
[0037] As mentioned previously, and when there are multiple materials or the background noise in the picture is uneven, it has an adverse effect on accurately obtaining the measurement result.
[0038] Traditional solutions usually process images using some common filtering methods. These solutions usually have defects such as low recognition accuracy. Therefore, a suitable noise reduction method is needed to reduce noise and increase the boundary gray intensity between the graphics / materials to be measured, that is, to increase the signal-to-noise ratio, in order to obtain accurate measurement results. In some traditional solutions, the gray value curve of image pixels is fitted by using common filtering and other curve smoothing methods, and then the peaks and valleys are found by calculating the curve calculus and derivatives to confirm the boundary position. However, it is difficult to find a suitable curve fitting method to increase the signal-to-noise ratio at the measurement position when there are multiple boundaries or the curve grays within different boundaries are different. Here, the boundary refers to the boundary of the same complete graphic, which is called a boundary. For example, there are multiple different rectangles in a picture, and the gray value levels within each rectangle are different. When moving from one rectangle to another, two boundaries will be passed, that is, the boundary from the first rectangle to the background and the boundary from the background to the second rectangle. In most cases, some regions with strong signal-to-noise ratio can be accurately identified, but it is difficult to use a threshold to distinguish different regions in regions with poor signal-to-noise ratio, resulting in low recognition accuracy.
[0039] In view of this, the present disclosure provides an improved solution.
[0040] Embodiments of the present disclosure provide an improved image processing method. The method includes: generating a corrected gray value for each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels in a predetermined adjacent range of each pixel in the set of pixels; comparing the corrected gray values of the respective pixels with a threshold, where the threshold is related to the gray values of the respective pixels in the set of pixels; and identifying the pixels with corrected gray values greater than the threshold as the boundary points of the graphics in the image. The implementation of the present disclosure adopts an improved image processing solution, which can effectively reduce the gray values of different gray regions, and at the same time increase the signal intensity in the graphic boundary region, making it easier to identify the boundaries of different graphic regions, thereby improving the measurement accuracy of graphic dimensions.
[0041] Hereinafter, embodiments of the present disclosure will be specifically described with reference to the accompanying drawings.
[0042] Figure 1 A schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented is shown. As Figure 1 shown, the example environment 100 includes a computing device 110 and a client 120.
[0043] In some embodiments, computing device 110 may interact with client 120. For example, computing device 110 may receive an input message from client 120 and output a feedback message to client 120. In some embodiments, the input message from client 120 may be a TEM image, an SEM image, etc. Computing device 110 may process the TEM image and the SEM image and output the corresponding operation results to client 120.
[0044] In some embodiments, computing device 110 may include, but is not limited to, a personal computer, a server computer, a handheld or laptop device, a mobile device (such as a mobile phone, a personal digital assistant PDA, a media player, etc.), a consumer electronic product, a minicomputer, a mainframe computer, cloud computing resources, etc.
[0045] It should be understood that describing the structure and function of the exemplary environment 100 only for illustrative purposes is not intended to limit the scope of the subject matter described herein. The subject matter described herein may be implemented in different structures and / or functions. This environment is merely illustrative and not used to limit the application environment of the embodiments of the present disclosure.
[0046] To more clearly explain the principle of the solution of the present disclosure, the following will refer to Figure 2 for a more detailed description.
[0047] Figure 2 A flowchart of an image processing method 200 according to some embodiments of the present disclosure is shown.
[0048] At block 202, a corrected gray value of each pixel is generated based on the gray value of each pixel in a set of pixels in a predetermined direction in the image to be processed and the gray values of the pixels in a predetermined range adjacent to each pixel in the set of pixels in the predetermined direction. The predetermined direction may be any direction in the image.
[0049] In some embodiments, a set of pixels in a predetermined direction may be a column of pixels or a row of pixels in the image to be processed (or the image to be measured). In some cases, only a part of the image in the image may need to be processed. Therefore, in some embodiments, a set of pixels in a predetermined direction may be a part of the pixels in a column of pixels or a part of the pixels in a row of pixels in the image to be processed. In the following, for the sake of convenience of description, a column or a row of pixels will be mainly used as an example for illustration. Obviously, the following description also applies to a part of the pixels in a column of pixels or a part of the pixels in a row of pixels. In addition, it should be noted that a column of pixels mentioned in the embodiments of the present disclosure refers to the pixels on a line extending in the first direction, and a row of pixels refers to the pixels on a line extending in the second direction perpendicular to the first direction. If the pixels in the first direction are called rows, then the pixels in the second direction perpendicular to it are called columns. For example, if the first direction is the horizontal direction, then the second direction is the vertical direction, and vice versa. The two have the same status.
[0050] In some embodiments, the gray values of each pixel in a set of pixels in a predetermined direction in the image to be processed may be obtained first. In some embodiments, the image to be processed may be any type of image. In some embodiments, the image to be processed is a semiconductor measurement image, such as a TEM image, an SEM image, etc. In some embodiments, the gray values of each pixel in the image may be obtained in advance and stored in a predetermined location, such as a memory, so that the gray values of each pixel can be directly used for subsequent processing.
[0051] An image usually includes a plurality of patterns with different gray-level regions. Generally speaking, the positions of the patterns in many images that need to be measured have a certain particularity, that is, only the boundaries of specific positions need to be measured. Specifically, the particularity means that in actual application scenarios, some specific measurement positions will be defined according to the different patterns to be measured. For example, there are multiple patterns, and it may be specified to measure only the length, width, etc. of a certain pattern. Specifically, for such a particular position, the measurement of the predetermined position can be achieved only by determining the points at the corresponding positions.
[0052] As Figure 3 shown, Figure 3 shows a schematic diagram of the image to be processed according to the embodiment of the present disclosure. Figure 3 The line L in it represents a row or a column of pixels in the image. The line L has three intersections with the pattern in the image, which are respectively indicated by 1, 2, and 3 in Figure 3 as Figure 3As can be seen, the figures in the image have different gray-scale regions. As mentioned before, in this case, it is usually very difficult to find a suitable curve fitting method to increase the signal-to-noise ratio of the measurement positions. Specifically, for figures with different gray-scale regions, it is sometimes difficult to accurately extract the boundaries of the figures using a single threshold. Therefore, how to set a suitable threshold to accurately extract the boundaries of the figures is a difficult problem in reality. Figure 3 The boundary positions indicated by 1, 2, and 3 in are the boundary positions to be recognized. In the embodiments of the present disclosure, by processing the image, the contours of the boundary positions are made clearer to facilitate the recognition of the boundary positions. Accurately recognizing the boundary positions can enable more accurate measurement results to be obtained during the subsequent measurement of the figure due to accurately recognizing the contour of the figure. This will be further described later.
[0053] In some embodiments, based on the gray-scale values of the region to be measured, a gray-scale value curve is generated, as Figure 4 shown. Figure 4 shows Figure 3 a schematic diagram of the original gray-scale value curve of the image to be processed shown. Figure 4 The curve shown in is formed with the position of a column or a row of pixels as the abscissa and the gray-scale value (0 - 255) of the pixels as the ordinate. Figure 4 The curve graph of shows that the gray-scale values of the pixels in different regions are not the same, which makes it difficult to use a unified gray-scale threshold to segment the boundaries of different gray-scale regions. For example, if the gray-scale threshold is set too high, the boundary positions of the regions with low gray-scale values will be missed; conversely, if the gray-scale threshold is set too low, non-boundary positions may be recognized as boundary positions.
[0054] Figure 4 The positions of the curves indicated by 1, 2, and 3 in the curve shown in respectively correspond to Figure 3 the boundary positions indicated by 1, 2, and 3 in. As can be seen from Figure 4 the difference between the gray-scale values corresponding to the three boundary positions and the gray-scale values of the adjacent positions is not very obvious. Therefore, there is a possibility of misrecognition during the contour recognition process.
[0055] In some embodiments, in order to reduce the influence of noise in the image, the rolling average values of the gray-scale values of each pixel in a group of pixels in a predetermined direction can be determined; and correction gray-scale values are generated based on the differences between the rolling average values of each pixel and the rolling average values of the pixels within a predetermined range adjacent to the pixel.
[0056] "Rolling average", also known as moving average, is to calculate the average of multiple consecutive sequences of m terms from a time series of n terms, where n and m are positive integers and m is less than n. Specifically, the rolling average mean refers to calculating the average of the data within a fixed-size window and using the result as the value of the current data point. As the window slides forward, each data point is calculated multiple times to obtain the rolling mean of the entire data sequence. Rolling averages can be used to smooth data, remove noise, find trends, etc.
[0057] It should be noted that the rolling average can be selected and used according to the specific image data situation. If there is basically no single-point noise in the image data, it can be not used; otherwise, it can be appropriately used.
[0058] In some embodiments, determining the respective rolling averages of the gray values of each pixel in a group of pixels may include: determining a first rolling average of the respective gray values of each pixel within the edge range in a group of pixels based on a predetermined rolling step and the gray values of each pixel within a first range related to the predetermined rolling step, where the length of the edge range is equal to the predetermined rolling step; and determining a second rolling average of the respective gray values of each pixel within the intermediate range other than the edge range in a group of pixels based on the predetermined rolling step and the gray values of each pixel within a first range related to the predetermined rolling step. This will be further described below in conjunction with specific calculation formulas.
[0059] In some embodiments, to calculate the rolling average, the rolling step can be set to s, where s is a value greater than 0 and its value can be adjusted according to actual needs. For example, in the example, s is 5, that is, 5 numerical values in the x direction (horizontal direction), which are 5 pixels in this example.
[0060] In some embodiments, the range from the starting point of the data (gray value data or image data) to s is called the boundary position, and the average value of the pixel data within a distance of 2s + 1 steps backward from each pixel point in this part of the data can be taken. See the following equation:
[0061] (1)
[0062] Where i represents the i-th pixel, which can be regarded as the abscissa of the curve, represents the gray value of the pixel, 2s + 1 represents the number of data points, represents the rolling average of the gray value of the i-th pixel.
[0063] In some embodiments, the average value of the gray values of the intermediate points in this row or column of pixels can be calculated using the following equation:
[0064] (2)
[0065] Where n is the total number of data points (or called pixel points), and the other parameters are the same as described above.
[0066] Here, the data start includes the start and end data, that is, [i - s, i + s]. For example, if i = 5 and s = 2, the data ranges from 3 to 7 (3, 4, 5, 6, 7), a total of 5 values: 2s + 1.
[0067] The last s data points in the data are the boundary positions on the other side, and the average value of the last 2s + 1 data can be taken:
[0068] (3)
[0069] In the above embodiments, the first s data points in the data are edge data. When calculating the moving average value, it is the average value calculated by taking s data points forward and backward from the currently selected point. Therefore, the average value of the first s data points can be approximately taken as the average value of 2s + 1 data. In this way, the value of the (s + 1)-th data ranges from 2 to 2s + 2. It should be understood that the specific value of the above step size is illustrative and can be varied according to actual needs.
[0070] By taking the rolling average value, the influence of too large or too small single points on the measurement result can be eliminated. Refer to the following Figure 5 , Figure 5 shows a schematic diagram of the curve after the gray value curve shown in Figure 4 is processed by the rolling average value. By comparing the curves shown in Figure 4 and Figure 5 , it can be seen that the curve after the rolling average value processing becomes smoother than the original gray value curve without the rolling average processing, thereby being able to eliminate the influence of too large or too small single points on the measurement result.
[0071] In some embodiments, the rolling-averaged grayscale value curve is further processed to reduce the signal intensity inside the graph while enhancing the signal at the boundary positions on the curve. This can be achieved in the following manner. In some embodiments, a predetermined constant can be used as the corrected grayscale value for each pixel within the edge range among a set of pixels in a predetermined direction, where the length of the edge range is equal to a predetermined range, and the predetermined constant can be 0, and the present disclosure does not limit this; and based on the predetermined range, the grayscale average value of each pixel within the intermediate range other than the edge range among a set of pixels in the predetermined direction is determined, and each grayscale average value is used as the corrected grayscale value for each pixel within the intermediate range. For example, the step size can be set to k, where k is a value greater than 0 and its value can be adjusted according to actual needs, and in the example, it is 5. The grayscale value of the data point to be processed can be read, and the average value of the grayscale values of k points on each of the left and right sides is taken. The absolute value of the difference between the grayscale value of the data point to be processed and these two average values is taken and then added together to obtain the processed value. Here, the points are taken starting from the position of k + 1, and the k points on the leftmost and rightmost sides are set to 0 because they do not meet the value-taking settings of this method, which belong to the image edge areas where calculations cannot be performed.
[0072] In some embodiments, determining the grayscale average value of each pixel within the intermediate range other than the edge range among a set of pixels based on the predetermined range may include: respectively determining the first average value of the grayscale values of the pixels within the predetermined range at the adjacent position on one side of each pixel within the intermediate range among a set of pixels; respectively determining the second average value of the grayscale values of the pixels within the predetermined range at the adjacent position on the other side of each pixel within the intermediate range among a set of pixels; respectively determining the first absolute value of the difference between the grayscale value of each pixel and the corresponding first average value; respectively determining the second absolute value of the difference between the grayscale value of each pixel and the corresponding second average value; and respectively taking the sum of the corresponding first absolute value and the corresponding second absolute value as the corrected grayscale value of each pixel within the intermediate range. The following is described in conjunction with Figure 6 specifically describes, that is, specifically describes the method of further processing the rolling-averaged grayscale value curve to reduce the signal intensity inside the graph while enhancing the signal at the boundary positions on the curve.
[0073] Figure 6 A flowchart showing the optimized calculation of the graph contour in an image according to some embodiments of the present disclosure is shown. As Figure 6 shown, at 602, the grayscale values of k pixels are read. At 604, the average value of the grayscale values of the k pixels on the left is calculated , specifically, the average value of the grayscale values of k pixel points on the left (or one side) of the i-th pixel is calculated. At 606, the average value of the grayscale values of the k pixels on the right is calculated , specifically, calculate the average grayscale value of k pixel points on the right (or the other side) of the i-th pixel. At 608, calculate the optimized result of the grayscale value of the pixel. Specifically, in some embodiments, the corrected grayscale value of each pixel can be calculated using the following formula:
[0074] (4);
[0075] where i represents the i-th pixel in a column of pixels or a row of pixels, represents the grayscale value of the i-th pixel, k is an integer greater than or equal to 1, n represents the total number of pixels in a column of pixels or a row of pixels, represents the corrected grayscale value. More specifically, it represents the result of calculating the absolute value and adding the difference between the average grayscale value within a certain step on the left and right of the grayscale value of the i-th pixel and the calculation of this pixel.
[0076] In the above formula, the area assigned a value of 0 belongs to the edge position of the curve. As mentioned before, it means that this is a boundary area that does not need to be recognized, that is, it is not used for calculating the boundary.
[0077] In the above embodiments, the purpose of using the above formula (4) for calculation is mainly to consider that the boundaries in the image are mostly positions with a certain change in grayscale slope. However, since there are also positions with a relatively large slope in the background grayscale of other regions to a certain extent, and the grayscale levels of different regions are also different, it is very difficult to confirm the position of the boundary only by curve fitting or derivative methods.
[0078] In addition, it should be understood that the embodiments of the present disclosure are not limited to calculating the rolling average using the above formula, but various changes can be made to the above formula. For example, adding some coefficients or retaining the positive and negative directions, etc., will make the values at the boundary positions larger; or taking the square, cube, etc. of the calculation result to widen the numerical gap of the result. In addition, in the above embodiments, the absolute value is taken after calculating the difference between the grayscale values of adjacent pixels, and the difference can also be calculated in one direction so that the result has a positive and negative direction. The specific process is not described in detail here.
[0079] In the above description, for the sake of distinction, the calculation step of the sliding average is represented by s, and the step of calculating the difference between adjacent gray levels is represented by k. Generally speaking, the larger the values of both, the weaker the signal intensity will be, and the smaller the values, the more background noise will be. The two can take the same value or different values. In actual use, it is generally relatively suitable to be around 3 - 7, and good noise reduction and contour enhancement effects can be obtained.
[0080] In addition, in the above embodiment, the above formula is used because the difference between the gray value of each point and the gray value of the adjacent position is considered as the signal feature. That is, both the slope change of the gray value curve and the gray value change are considered, so that the boundary position can be highlighted, that is, the signal enhancement of the boundary position on the curve is achieved.
[0081] For the optimized curve, see Figure 7 . Figure 7 The present invention shows some embodiments of the present invention. Figure 5 The gray value curve shown in FIG. is a schematic diagram of the curve after optimization processing. Figure 7 It can be seen that the grayscale values inside different graphics in the original grayscale curve are flattened to a similar level, and the grayscale signal intensity at the three boundary positions in the original curve is significantly higher than that at other background positions.
[0082] At block 204 , the corrected grayscale value of each pixel in the group of pixels is respectively compared with a threshold value, wherein the threshold value is associated with the grayscale value of each pixel in the group of pixels.
[0083] In some embodiments, comparing the corrected grayscale value of each pixel in a group of pixels with a threshold value may include: determining a percentile of the grayscale value of each pixel based on the grayscale value of each pixel in the group of pixels; and using the percentile as the threshold value. Regarding percentile, for example, 100 pixels have 100 grayscale values. Sort them from small to large according to the grayscale value. The grayscale value of the pixel ranked 90th corresponds to P90.
[0084] In some embodiments, the percentile of the grayscale value of each pixel may be determined based on the grayscale values of a group of pixels; and the percentile may be used as the threshold.
[0085] In some embodiments, the grayscale values of two or more adjacent rows of pixels or columns of pixels may also be determined, and their average value may be calculated, and then subsequent optimization processing may be performed based on the determined average value of the grayscale values.
[0086] In some embodiments, the image processing method is particularly suitable for processing one-dimensional graphic data, and the application scenario is, for example, to determine the length of a boundary in a certain direction (x or y). The noise in the value can be ensured to be small by taking an average of at least two columns or at least two rows of data.
[0087] In some embodiments, the average value of the grayscale values of each column or row of pixels can also be determined based on the grayscale values of a column or row of pixels in the image and the grayscale values of at least one column or row of pixels adjacent to the column or row of pixels; and the determined average value is determined as the corrected grayscale value of the column or row of pixels.
[0088] In some embodiments, the sum values obtained by respectively adding the gray-scale values of each pixel in adjacent columns of pixels or adjacent rows of pixels to the gray-scale values of adjacent pixels in the adjacent columns or adjacent rows can be determined respectively; and the quotient obtained by dividing each sum value by the number of adjacent columns or adjacent rows is determined as the average value of the gray-scale values of the columns of pixels or rows of pixels.
[0089] Determining the gray-scale values of adjacent two or more rows of pixels or columns of pixels can achieve better results than only determining the gray-scale values of one column of pixels or one row of pixels. Because when only taking the gray-scale values of one column or one row of pixels, if there is a strong gray-scale noise in the gray-scale value data of this column or row of pixels, it may be misidentified as a boundary. Taking multiple columns or rows and taking the corresponding average values can reduce this kind of noise, thereby avoiding misidentification.
[0090] As described above, in some embodiments, the boundary gray-scale signal is enhanced and the gray-scale in the internal area of the graph is reduced, so that the gray-scale value at the boundary position is relatively larger. By using the percentile as the threshold, the peak positions of a few boundaries can be retained, and other smaller background noise peak positions will be removed. The specific percentile can be verified according to the graph to be measured to select the best position, and this percentile value can distinguish the gray-scale value of the boundary from the gray-scale background in each area.
[0091] In some embodiments, the percentile is used as the threshold, and thus the boundary position can be extracted according to the percentile. For example, the percentile can be set to 97%, and the effect is as Figure 7 shown. Figure 7 shows the schematic diagram of the curve after percentile extraction of the Figure 5 gray-scale value curve shown according to some embodiments of the present disclosure. As can be seen from Figure 7 , its background gray-scale value is basically at a relatively low level, and at this time, all the peak positions of the boundaries can be segmented out by a threshold P90 (represented by the dashed line 702).
[0092] As described above, by comparing the gray-scale value of the pixel with a percentile threshold, all the boundary point positions can be separated. The embodiments of the present disclosure are not limited to the percentile method, and other methods can also be used, such as traditional methods, for example, using a fixed threshold method.
[0093] At block 206, the pixels having a corrected gray-scale value greater than the threshold in each pixel are identified as the boundary points of the graph in the image. Refer to Figure 8 for description. Figure 8 shows the schematic diagram of the boundary position obtained after percentile extraction of the Figure 7 gray-scale value curve shown according to some embodiments of the present disclosure.Figure 8 The positions pointed to by the lines indicated by the numbers 1, 2, and 3 in Figure 8 are the positions obtained by acquiring the peak of gray-scale enhancement, which are just located at the boundary. As can be seen from Figure 8 Figure 8 , through the method of the embodiments of the present disclosure, the boundary (or contour) position of the figure in the image can be accurately identified.
[0094] Next, in combination with Figure 9 Figure 9 , the image processing method 900 of some other embodiments of the present disclosure will be further described. Figure 9 Figure 9 shows a flowchart of an image processing method according to some other embodiments of the present disclosure.
[0095] As Figure 9 shown in Figure 9 , at block 902, the gray-scale values of a column of pixels in the image are read. It should be noted that reading a column of pixels is substantially the same as reading a row of pixels for the solution of the embodiments of the present disclosure. Here, a column of pixels and a row of pixels mean that they are perpendicular to each other.
[0096] At block 904, the rolling average of the gray-scale values of each point is calculated, and the specific calculation method can adopt the method in the previous embodiments.
[0097] At block 906, the sum of the absolute values of the gray-scale differences at adjacent positions of each point is calculated. The specific calculation method can adopt the method described in combination with Figure 2 Figure 2 in the previous embodiments.
[0098] At block 908, a percentile is dynamically selected as the threshold for denoising. As described in the previous embodiments, the threshold is determined based on the gray-scale values of a column of pixels or a row of pixels, that is, the threshold is not predetermined, but is related to the gray-scale values of a column of pixels or a row of pixels in the image to be measured, so it is dynamically selected. For example, the threshold is set in the way of percentile. The embodiments of the present disclosure are not limited thereto, and other ways of setting the threshold based on the gray-scale values of a column of pixels or a row of pixels can also be adopted.
[0099] In some embodiments, before generating the corrected gray-scale values, it further includes: performing Gaussian filtering or median filtering on the image to generate a denoised image.
[0100] In some embodiments, instead of performing rolling smoothing processing on the original gray-scale value curve, the contour enhancement method mentioned in the previous embodiments of the present disclosure can be directly implemented, that is, without calculating the rolling average, the average value is directly calculated by taking a certain range of widths before and after each pixel point, the gray-scale value of the pixel point is subtracted from the average value, the result is taken as the absolute value, and then added up to obtain the final corrected gray-scale value. The obtained figure boundary position is as Figure 10 shown in Figure 10 . Figure 10The white line L in the figure forms the gray curve of the boundary to be recognized at the positions of the gray value. The horizontal lines 1002, 1004, 1006, 1008 and 1018 in the figure are the boundary positions recognized by this method.
[0101] See Figure 11 , Figure 11 which shows the schematic diagram of the gray value curve corresponding to the boundary position obtained after processing the image to be processed using the image processing method according to other embodiments of the present disclosure. Figure 10 Figure 11 The curve 1102 in Figure 10 is the original gray value curve at the position of the white line in the SEM image of
[0102] In some embodiments of the present disclosure, a set of pixels (such as a row or a column of pixels or a part thereof) is processed to obtain a gray value curve, thereby determining the contour of the figure in the image. It should be understood that the embodiments of the present disclosure are not limited thereto, but can be variously changed. For example, in actual processing, several groups of pixels above and below the position to be measured can be taken together to calculate the average value or sum value as needed to process the image, so as to enhance the recognition of the contour.
[0103] In the above-mentioned some embodiments, it is described that the gray value curve after rolling average is further processed to reduce the signal intensity inside the figure, and at the same time, the signal at the boundary position on the curve is enhanced. It should be understood that the embodiments of the present disclosure are not limited thereto, but can be variously changed. For example, it is not necessary to smooth the original gray value curve before processing, but the original gray value curve can be directly processed to reduce the signal intensity inside the figure, and at the same time, the signal at the boundary position on the curve is enhanced.
[0104] Some embodiments of the present disclosure provide an image processing method. It should be understood that the embodiments shown in the drawings are only for schematically showing the solutions of some embodiments of the present disclosure, and are not used to limit the present disclosure. The embodiments of the present disclosure can also have various other forms.
[0105] The solutions of some embodiments of the present disclosure adopt an improved image processing scheme, which can effectively reduce the gray values in different gray regions, and at the same time improve the signal intensity in the boundary region of the figure, making it easier to identify the boundaries of different figure regions and improving the measurement accuracy of the figure size.
[0106] Embodiments of the present disclosure also disclose an electronic device. The electronic device includes: a processor; and a memory coupled to the processor, the memory having instructions stored therein that, when executed by the processor, cause the device to perform operations, the operations including: generating a corrected gray value for each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels in a predetermined adjacent range of each pixel in the set of pixels; comparing the corrected gray value of each pixel with a threshold, where the threshold is related to the gray values of the pixels in the set of pixels; and identifying the pixels having a corrected gray value greater than the threshold as boundary points of a graphic in the image.
[0107] Embodiments of the present disclosure also disclose a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements an image processing method according to an embodiment of the present disclosure.
[0108] The solution of the embodiments of the present disclosure can effectively reduce the gray values of different gray regions, while increasing the signal strength of the graphic boundary region, making it easier to identify the boundaries of different graphic regions and improving the measurement accuracy of graphic dimensions.
[0109] Figure 12 A schematic block diagram of an electronic device according to some exemplary embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as, for example, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as, for example, a personal digital processor, a cellular phone, a smartphone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementations of the present disclosure described and / or claimed herein.
[0110] As Figure 12 shown, the device 1200 includes a CPU 1201 which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1202 or a computer program loaded from a storage unit 1208 into a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the device 1200 can also be stored. The CPU 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0111] Multiple components in device 1200 are connected to I / O interface 1205. The multiple components include: an input unit 1206, such as a keyboard, a mouse, etc.; an output unit 1207, such as various types of displays, speakers, etc.; a storage unit 1208, such as a disk, an optical disc, etc.; and a communication unit 1209, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1209 allows device 1200 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0112] Each of the processes and treatments described above, such as method 400, may be executed by CPU 1201. For example, in some embodiments, method 400 may be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as storage unit 1208. In some embodiments, part or all of the computer program may be loaded and / or installed onto device 1200 via ROM 1202 and / or communication unit 1209. When the computer program is loaded into RAM 1203 and executed by CPU 1201, one or more steps of method 400 described above may be executed.
[0113] The solutions according to the embodiments of the present disclosure may be a method, an apparatus, a system, and / or a computer program product. The computer program product may include a computer-readable storage medium having thereon computer-readable program instructions for performing various aspects of the present disclosure. The computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. The computer-readable program instructions may be downloaded from the computer-readable storage medium to various computing / processing devices, or downloaded to an external computer or an external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network.
[0114] The embodiments of the present disclosure have been described above. The above description is exemplary and is only an optional embodiment of the present disclosure, not exhaustive, and is not used to limit the present disclosure. Although the claims in this application have been formulated for specific combinations of features, it should be understood that the scope of the present disclosure also includes any novel feature or any novel combination of features that are explicitly or implicitly disclosed herein or any generalization thereof, regardless of whether it relates to the same solution in any of the currently claimed claims. The applicant hereby informs that new claims may be formulated for these features and / or combinations of these features during the examination process of this application or in any further application derived therefrom.
[0115] The selection of the terms used in this document is intended to best explain the principles of the various embodiments, their practical applications, or the improvement of technologies in the market, or to enable other ordinary technicians in the technical field to understand the various embodiments disclosed in this document. For those skilled in the art, various changes and modifications can be made to the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included within the protection scope of the present disclosure.
Claims
1. An image processing method, comprising: generating a corrected gray value for each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels within a predetermined adjacent range of each pixel in the set of pixels, wherein the set of pixels is a column of pixels or a row of pixels, or a partial set of pixels in a column of pixels or a partial set of pixels in a row of pixels; comparing the corrected gray values of the respective pixels in the set of pixels with a threshold value, wherein the threshold value is related to the gray values of the respective pixels in the set of pixels; and identifying the pixels having corrected gray values greater than the threshold value among the respective pixels as boundary points of a graphic in the image.
2. The method according to claim 1, wherein generating a corrected gray value for each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels within a predetermined adjacent range of each pixel in the set of pixels comprises: determining a rolling average of the respective gray values of the respective pixels in the set of pixels; and generating the corrected gray value based on the difference between the rolling average of the respective gray values of the respective pixels and the rolling average of the pixels within the predetermined range adjacent to each pixel.
3. The method according to claim 2, wherein determining a rolling average of the respective gray values of the respective pixels in the set of pixels comprises: for each pixel within an edge range in the set of pixels, determining a first rolling average of the respective gray values of the respective pixels based on the gray values of the pixels within a first range related to a predetermined rolling step length, wherein the length of the edge range is equal to the predetermined rolling step length; and for each pixel within an intermediate range outside the edge range in the set of pixels, determining a second rolling average of the respective gray values of the respective pixels within the intermediate range based on the gray values of the pixels within the first range related to the predetermined rolling step length.
4. The method according to claim 1, wherein generating a corrected gray value for each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels within a predetermined adjacent range of each pixel in the set of pixels comprises: using a predetermined constant as the corrected gray value for each pixel within an edge range in the set of pixels, wherein the length of the edge range is equal to the predetermined range; and for each pixel within an intermediate range outside the edge range in the set of pixels, generating a corresponding corrected gray value based on the average gray value of the pixels within the predetermined range adjacent to each pixel.
5. The method according to claim 4, wherein generating a corresponding corrected gray value based on the average gray value of the pixels within the predetermined range adjacent to each pixel comprises: respectively determining a first average value of the gray values of the pixels within the predetermined range at an adjacent position on one side of each pixel within the intermediate range in the set of pixels; Determine the second average value of the gray values of the pixels within the predetermined range at the adjacent positions on the other side of each of the pixels within the middle range in the set of pixels respectively; Determine the first absolute value of the difference between the gray value of each pixel and the corresponding first average value respectively; Determine the second absolute value of the difference between the gray value of each pixel and the corresponding second average value respectively; And Use the sum of the corresponding first absolute value and the corresponding second absolute value as the corrected gray value of each of the pixels within the middle range respectively.
6. The method according to claim 5, wherein the corrected gray value is determined by the following formula: Among them, i represents the i-th pixel in the set of pixels, represents the corrected gray value of the i-th pixel, represents the gray value of the i-th pixel, k is an integer greater than or equal to 1, and n represents the total number of pixels in the set of pixels.
7. The method according to claim 1, wherein comparing the corrected gray value of each pixel in the set of pixels with a threshold respectively includes: Determine the percentile of the gray value of each pixel based on the gray value of each pixel in the set of pixels; And Use the percentile as the threshold of the corresponding set of pixels.
8. The method according to claim 1, generating the corrected gray value of each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels within a predetermined adjacent range of each pixel in the set of pixels respectively further includes: Determine the average value of the gray values of each set of pixels based on the gray value of the set of pixels in the image and the gray values of at least one set of pixels adjacent to the set of pixels; And Determine the determined average value as the corrected gray value of each set of pixels.
9. The method according to any one of claims 1 to 8, wherein before generating the corrected gray value, it further includes: Perform Gaussian filtering or median filtering on the image to generate a noise-reduced image.
10. An electronic device, comprising: A processor; And A memory coupled to the processor, the memory having instructions stored therein, the instructions when executed by the processor cause the device to perform actions, the actions including: Generate the corrected gray value of each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels within a predetermined adjacent range of each pixel in the set of pixels respectively, wherein the set of pixels is a column of pixels or a row of pixels, or a part of the pixels of a column of pixels or a part of the pixels of a row of pixels; Compare the corrected gray value of each pixel in the set of pixels with a threshold respectively, wherein the threshold is related to the gray value of each pixel in the set of pixels; and Identify the pixels having a corrected gray value greater than the threshold among the respective pixels as the boundary points of the graphics in the image.
11. The electronic device according to claim 10, wherein the image is a transmission electron microscope image or a scanning electron microscope image.
12. The electronic device according to claim 10, wherein generating the corrected gray value of each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels within a predetermined adjacent range of each pixel in the set of pixels respectively includes: Determine the rolling average value of the respective gray values of each pixel in the set of pixels; And Generate the corrected gray value based on the difference between the rolling average of the respective gray values of each pixel and the rolling average of the pixels within the predetermined range adjacent to each pixel.
13. The electronic device according to claim 12, wherein determining the rolling average of the respective gray values of each pixel in the set of pixels includes: For each pixel within the edge range in the set of pixels, determine a first rolling average of the respective gray values of each pixel based on the gray values of the pixels within a first range related to a predetermined rolling step, wherein the length of the edge range is equal to the predetermined rolling step; And For each pixel within the middle range outside the edge range in the set of pixels, determine a second rolling average of the respective gray values of each pixel within the middle range based on the gray values of the pixels within the first range related to the predetermined rolling step.
14. The electronic device according to claim 10, wherein generating the corrected gray value for each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels within a predetermined range adjacent to each pixel in the set of pixels includes: Use a predetermined constant as the corrected gray value for each pixel within the edge range in the set of pixels, wherein the length of the edge range is equal to the predetermined range; And For each pixel within the middle range outside the edge range in the set of pixels, determine the corresponding corrected gray value based on the gray average value of the pixels within the predetermined range adjacent to each pixel.
15. The electronic device according to claim 14, wherein determining the corresponding corrected gray value based on the gray average value of the pixels within the predetermined range adjacent to each pixel includes: Respectively determine a first average value of the gray values of the pixels within the predetermined range at the adjacent position on one side of each pixel within the middle range in the set of pixels; Respectively determine a second average value of the gray values of the pixels within the predetermined range at the adjacent position on the other side of each pixel within the middle range in the set of pixels; Respectively determine a first absolute value of the difference between the gray value of each pixel and the corresponding first average value; Respectively determine a second absolute value of the difference between the gray value of each pixel and the corresponding second average value; And Respectively use the sum of the corresponding first absolute value and the corresponding second absolute value as the corrected gray value for each pixel within the middle range.
16. The electronic device according to claim 15, wherein the corrected gray value is determined using the following formula: Among them, i represents the i-th pixel in the set of pixels, represents the corrected gray value of the i-th pixel, represents the gray value of the i-th pixel, k is an integer greater than or equal to 1, and n represents the total number of pixels in the set of pixels.
17. The electronic device according to claim 10, wherein comparing the corrected gray value of each pixel in the set of pixels with a threshold respectively includes: Determine the percentile of the gray value of each pixel based on the gray value of each pixel in the set of pixels; And Use the percentile as the threshold for the corresponding set of pixels.
18. The electronic device according to claim 10, wherein generating the corrected gray value of each pixel based on the gray value of each pixel in a set of pixels in a predetermined direction in the image and the gray values of the pixels in a predetermined adjacent range of the each pixel in the set of pixels further comprises: determining an average value of the gray values of each set of pixels based on the gray values of the set of pixels in the image and the gray values of at least one set of pixels adjacent to the set of pixels; and determining the determined average value as the corrected gray value of each set of pixels.
19. The electronic device according to any one of claims 10 to 18, wherein before generating the corrected gray value, it further comprises: performing Gaussian filtering or median filtering on the image to generate a noise-reduced image.
20. A computer-readable storage medium, on which machine-executable instructions are stored, and when the machine-executable instructions are executed by a processor, the processor is caused to implement the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Automobile glass sub-pixel contour extraction method and automobile glass detection method
CN111415376A