Image processing method, electronic equipment and computer readable storage medium

By generating and correcting grayscale values ​​and dynamic thresholds to identify image boundary points, the problem of insufficient contour signal intensity in image processing is solved, and precise extraction and measurement of the graphical contour is achieved.

CN119130884APending Publication Date: 2024-12-13QUANXIN INTELLIGENT MFG TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411162275.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The prior art is difficult to effectively reduce noise and extract graphic profiles in image processing, especially in cases where image shooting quality is poor or grayscale discrimination is low, conventional methods may not be able to effectively improve image profile signal strength.

Method used

By generating a corrected grayscale value for each pixel, using the rolling average and absolute difference calculation, the threshold is dynamically set to identify the image boundary points, and the boundary points are identified in the image to enhance the contour signal.

Benefits of technology

It effectively improves the signal strength of the image contour boundary, helps to extract the graph contour more accurately, thereby achieving accurate measurement of the graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119130884A_ABST
    Figure CN119130884A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to an image processing method, electronic equipment and a computer readable storage medium. The method comprises the steps of generating a first corrected gray value of each pixel based on a gray value of each pixel in each group of pixels in a predetermined direction in an image and a gray value of each pixel in adjacent predetermined ranges in each group of pixels; respectively comparing the corresponding first corrected gray value of each pixel in each group of pixels with a corresponding first threshold, wherein the corresponding first threshold is respectively related to the gray value of each pixel in the corresponding column of pixels; identifying the pixels with the first corrected gray value greater than the corresponding first threshold value in each group of pixels as first boundary points of the graph in the image; and identifying each first boundary point of the graph identified in each group of pixels as a first boundary of the graph. According to the technical scheme provided by the embodiment of the invention, the signal intensity of the contour boundary in the image can be effectively improved, so that the image contour can be more effectively extracted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure generally relate to image processing, and more particularly, to an image processing method, an electronic device, and a computer-readable storage medium. Background Art

[0002] In the semiconductor field, it is often necessary to extract the contours of graphics on wafer layouts. In the image processing process, it is necessary to reduce the noise of the image, and at the same time, it is hoped that the signal at the contour position of the graphic can be enhanced. Due to differences in image shooting quality, there are situations where the grayscale distinction between different graphics is low or there are grayscale changes in the overall image, so it may be necessary to use multiple methods to reduce the noise of the image.

[0003] The conventional method is to perform overall smoothing and noise reduction on the image, and then extract the contour by giving a grayscale threshold. However, the conventional method may not be able to effectively reduce noise. Summary of the invention

[0004] According to an exemplary embodiment of the present disclosure, an image processing scheme is provided to at least partially overcome the above or other potential drawbacks.

[0005] According to one aspect of the present disclosure, an image processing method is provided. The method includes: generating a first corrected grayscale value of each pixel based on the grayscale value of each pixel in each group of pixels in a predetermined direction in the image and the grayscale value of each pixel in each group of pixels within a predetermined range adjacent to each pixel; comparing the corresponding first corrected grayscale value of each pixel in each group of pixels with a corresponding first threshold value, wherein the corresponding first threshold value is respectively related to the grayscale value of each pixel in a corresponding group of pixels; respectively identifying the pixels in each group of pixels having a first corrected grayscale value greater than the corresponding first threshold value as the first boundary point of the figure in the image; and identifying each first boundary point of the figure respectively identified in each group of pixels as the first boundary of the figure.

[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, and when the instructions are executed by the processor, the device performs an action, the action including: generating a first corrected gray value of each pixel based on the gray value of each pixel in each group of pixels in a predetermined direction in the image and the gray value of each pixel within a predetermined range adjacent to each pixel in each group of pixels; respectively comparing the corresponding first corrected gray value of each pixel in each group of pixels with a corresponding first threshold, wherein the corresponding first threshold is respectively related to the gray value of each pixel in a corresponding group of pixels; respectively identifying the pixels in each group of pixels having a first corrected gray value greater than the corresponding first threshold as the first boundary point of the figure in the image; and identifying each first boundary point of the figure respectively identified in each group of pixels as the first boundary of the figure.

[0007] In some embodiments, generating a first corrected grayscale value for each pixel based on the grayscale value of each pixel in each group of pixels in the image and the grayscale values ​​of pixels within a predetermined range adjacent to each pixel in each group of pixels includes: determining the rolling average of the respective grayscale values ​​of each pixel in each group of pixels; and generating each first corrected grayscale value based on the difference between the rolling average of the respective grayscale values ​​of each pixel and the rolling average of pixels within a predetermined range adjacent to each pixel.

[0008] In some embodiments, respectively determining the rolling average of the respective grayscale values ​​of each pixel in each group of pixels includes: for each pixel in the edge range of each group of pixels, respectively determining the first rolling average of the respective grayscale values ​​of each pixel based on the grayscale values ​​of each pixel in a first range associated with a predetermined rolling step, wherein the length of the edge range is equal to the predetermined rolling step; and for each pixel in the middle range outside the edge range of each group of pixels, respectively determining the second rolling average of the respective grayscale values ​​of each pixel based on the respective grayscale values ​​of the pixels in the first range associated with the predetermined rolling step.

[0009] In some embodiments, generating a first corrected grayscale value for each pixel based on the grayscale value of each pixel in each group of pixels in the image and the grayscale values ​​of pixels within a predetermined range adjacent to each pixel in each group of pixels includes: using a predetermined constant as the first corrected grayscale value for each pixel within an edge range in each group of pixels, wherein the length of the edge range is equal to the predetermined range; and for each pixel within a middle range outside the edge range in each group of pixels, determining a corresponding first corrected grayscale value based on the grayscale average value of each pixel within the predetermined range adjacent to each pixel.

[0010] In some embodiments, determining the grayscale average values ​​of each pixel in the middle range excluding the edge range in each group of pixels based on the first predetermined range includes: determining the first average value of the grayscale values ​​of each pixel in the middle range within the predetermined range at an adjacent position on one side of each group of pixels; determining the second average value of the grayscale values ​​of each pixel in the middle range within the predetermined range at an adjacent position on the other side of each group of pixels; determining the first absolute value of the difference between the grayscale value of each pixel and the corresponding first average value; determining the second absolute value of the difference between the grayscale value of each pixel and the corresponding second average value; and taking the sum of the corresponding first absolute value and the corresponding second average value as the first corrected grayscale value of each pixel in the middle range.

[0011] In some embodiments, the first corrected grayscale value is determined using the following formula:

[0012]

[0013] Where i represents the i-th pixel in each group of pixels, represents the first corrected gray value of the i-th pixel, x i represents the grayscale 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 each group of pixels.

[0014] In some embodiments, comparing the corresponding first corrected grayscale value of each pixel in each group of pixels with the corresponding first threshold value includes: determining the percentile of the grayscale value of each pixel in each group of pixels based on the grayscale value of each pixel in each group of pixels; and using the percentile as the corresponding first threshold value of each group of pixels.

[0015] In some embodiments, it also includes: generating a second corrected grayscale value for each pixel based on the grayscale value of each pixel in each row of pixels perpendicular to each group of pixels in the image and the grayscale values ​​of pixels within a predetermined range adjacent to each pixel in each row of pixels; comparing the second corrected grayscale value of each pixel in each row of pixels with a corresponding second threshold value, wherein the corresponding second threshold value is respectively related to the grayscale value of each pixel in a corresponding row of pixels; identifying the pixels in each row of pixels having a second corrected grayscale value greater than the corresponding second threshold value as second boundary points of the graphic in the image; and determining each second boundary point of the graphic identified in each row of pixels as the second boundary of the graphic.

[0016] In some embodiments, the method further includes: superimposing the first image including the first boundary and the second image including the second boundary to generate an image with an enhanced boundary.

[0017] In some embodiments, superimposing the image including the first boundary with the image including the second boundary includes: respectively adding grayscale values ​​of pixels of the image including the first boundary and grayscale values ​​of corresponding pixels in the image including the second boundary to generate enhanced grayscale values.

[0018] In some embodiments, before generating the first corrected grayscale value, the method further includes: performing Gaussian filtering or median filtering on the image to generate a noise-reduced image.

[0019] In some embodiments, the image is a transmission electron microscope image or a scanning electron microscope image.

[0020] In a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method according to the first aspect of the present disclosure is implemented.

[0021] It will be understood from the following description that the technical solution of the embodiment of the present disclosure can effectively improve the signal strength of the image contour boundary, thereby helping to more effectively extract the graphic contour and further achieve accurate measurement of the graphic.

[0022] This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the disclosure, nor is it intended to limit the scope of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;

[0024] Figure 2 A flowchart of an image processing method according to some embodiments of the present disclosure is shown;

[0025] Figure 3 A schematic diagram showing an original image of an embodiment of the present disclosure;

[0026] Figure 4 A schematic diagram of grayscale calculation direction when performing X-direction noise reduction on an original image according to some embodiments of the present disclosure is shown;

[0027] Figure 5 The embodiment of the present disclosure shows a column of pixels selected along the X direction. Figure 3 A schematic diagram of a portion of an original image is shown;

[0028] Figure 6 The present invention shows some embodiments of the present invention. Figure 5 The schematic diagram of the image obtained after the image shown is subjected to X-direction noise reduction;

[0029] Figure 7 Shows Figure 5 A schematic diagram of a grayscale value curve of an image after X-direction noise reduction is shown in FIG.

[0030] Figure 8 A schematic diagram of grayscale calculation direction when performing Y-direction noise reduction on an image according to some embodiments of the present disclosure is shown;

[0031] Fig. 9 A schematic diagram showing an original image of a row of pixels selected along the Y direction according to an embodiment of the present disclosure;

[0032] Fig.10 The embodiment of the present disclosure is shown Fig. 9 Schematic diagram of an image after Y-direction noise reduction is performed on the image;

[0033] Fig.11 Shows Fig. 9 A curve diagram of the grayscale value of the image after Y-direction noise reduction shown in ;

[0034] Fig.12 A schematic diagram showing a flow chart of an image processing method according to some other embodiments of the present disclosure;

[0035] Fig.13 The present invention shows some embodiments of the present invention. Figure 3 Schematic diagram of the image obtained after Gaussian filtering of the original image shown;

[0036] Fig.14 The present invention shows some embodiments of the present invention. Figure 3 The schematic diagram of the image obtained after the original image is subjected to median filtering;

[0037] Fig.15 A flowchart of an image processing method according to some other embodiments of the present disclosure is shown;

[0038] Fig.16 A schematic diagram showing an image after performing X-direction noise reduction on an image according to an embodiment of the present disclosure is shown;

[0039] Fig.17 A schematic diagram showing an image after Y-direction noise reduction is performed on the image according to an embodiment of the present disclosure;

[0040] Fig.18 A schematic diagram of an image after superimposing an image after denoising in the X direction and an image after denoising in the Y direction according to an embodiment of the present disclosure is shown.

[0041] Fig.19 A block diagram of a computing device capable of implementing various embodiments of the present disclosure is shown.

[0042] In the various drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0043] The principles of the present disclosure will be described below with reference to the various exemplary embodiments shown in the accompanying drawings. It should be understood that the description of these embodiments is only to enable 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 similar or identical reference numerals may be used in the figures where feasible, and similar or identical reference numerals may represent similar or identical functions. Those skilled in the art will readily recognize from the following description that alternative embodiments of the structures and methods described herein may be adopted without departing from the principles of the present invention described herein.

[0044] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part 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.

[0045] As mentioned earlier, in the traditional solution, the image is first smoothed and denoised as a whole, for example, some common methods such as Gaussian and median are used to smooth and denoise the image as a whole, and then the image is binarized by giving a grayscale threshold before extracting the contour. Conventional methods usually use a combination of multiple means to reduce noise, but it is difficult to meet the requirements by combining one or several methods in different usage scenarios. Therefore, an improved method is needed to effectively reduce noise while increasing the grayscale value of the area of ​​interest to facilitate contour extraction. Clear contours help to achieve accurate measurement of the graphics later.

[0046] In view of this, the present disclosure provides an improved image processing solution.

[0047] The embodiments of the present disclosure provide an improved image processing method. The method includes: generating a first corrected grayscale value for each pixel based on the grayscale value of each pixel in each group of pixels in a predetermined direction in the image and the grayscale value of each pixel within a predetermined range adjacent to each pixel in each group of pixels; comparing the corresponding first corrected grayscale value of each pixel in each group of pixels with a corresponding first threshold value, wherein the corresponding first threshold value is respectively related to the grayscale value of each pixel in a corresponding column of pixels; identifying the pixels in each group of pixels having a first corrected grayscale value greater than the corresponding first threshold value as the first boundary point of the graphic in the image; and identifying the first boundary points of the graphics respectively identified in each group of pixels as the first boundary of the graphics. The technical solution of the embodiments of the present disclosure can effectively improve the signal strength of the image contour boundary, thereby facilitating more effective extraction of the graphic contour.

[0048] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.

[0049] Figure 1 1 is a schematic diagram of an example environment 100 in which embodiments according to the present disclosure can be implemented. Figure 1 As shown, the example environment 100 includes a computing device 110 and a client 120 .

[0050] In some embodiments, the computing device 110 may interact with the client 120. For example, the computing device 110 may receive an input message from the client 120 and output a feedback message to the client 120. In some embodiments, the input message from the client 120 may be a TEM image, a SEM image, etc. The computing device 110 may process the TEM and SEM images and output the corresponding operation results to the client 120.

[0051] 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.), consumer electronics, a minicomputer, a mainframe computer, cloud computing resources, etc.

[0052] It should be understood that the structure and function of the example environment 100 are described for exemplary purposes only and are not intended to limit the scope of the subject matter described herein. The subject matter described herein can be implemented in different structures and / or functions. The environment is merely illustrative and is not intended to limit the application environment of the embodiments of the present disclosure.

[0053] In order to explain the principle of the present disclosure more clearly, the following will refer to Figure 2 Let's describe it in more detail. Figure 2 A flowchart of an image processing method 200 according to some embodiments of the present disclosure is shown.

[0054] At box 202, a first corrected gray value of each pixel is generated based on the gray value of each pixel in each group of pixels in a predetermined direction in the image to be processed and the gray value of each pixel in a predetermined range adjacent to each pixel in each group of pixels. The predetermined direction can be any direction in the image. In some embodiments, a group of pixels in a predetermined direction can be any column of pixels in the image to be processed. In some cases, only part of the image may need to be processed. Therefore, in some embodiments, a group of pixels in a predetermined direction can be part of the pixels in a column of pixels in the image to be processed. Hereinafter, for ease of description, one column (or row) of pixels is mainly used as an example for explanation.

[0055] In some embodiments, an original image may be imported for processing. The original image to be processed may be any type of image, which is not limited in the present disclosure.

[0056] It should be noted that in the embodiments of the present disclosure, expressions such as "pixels in each column", "pixels in a column", "pixels in each row", and "pixels in a row" are involved, where the column pixels represent pixels on a line extending along a first direction, and the row pixels represent pixels on a line extending in a second direction perpendicular to the first direction. If the pixels in the first direction are called rows, the pixels in the second direction perpendicular thereto are called columns. For example, if the first direction is a horizontal direction, the second direction is a vertical direction, and vice versa, and the two have the same status.

[0057] In some embodiments, the grayscale value of each pixel in each group of pixels in a predetermined direction in the image to be processed may be first obtained. 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, a SEM image, etc. In some embodiments, the grayscale value of each pixel in the image may be pre-acquired and stored in a predetermined location, such as a memory, so that the grayscale value of each pixel may be directly used for subsequent processing.

[0058] An image usually includes multiple graphics with different grayscale areas. Generally speaking, the positions of graphics in many images that need to be measured have certain particularities, 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 graphics that need to be measured. For example, if there are multiple graphics, it may be specified that only the length and width of one of the graphics should be measured. For such a position with particularity, the measurement of the predetermined position can be achieved simply by determining the point at the corresponding position. In other cases, it may be necessary to obtain the entire boundary of the graphic.

[0059] like Figure 3 As shown, Figure 3A schematic diagram of an original image according to an embodiment of the present disclosure is shown. Figure 3 A plurality of graphics are shown in FIG. 3 , the graphics having a plurality of outlines 302 .

[0060] See also Figure 4 , Figure 4 FIG. 2 shows a schematic diagram of grayscale calculation direction when performing X-direction (also referred to as first direction) noise reduction on an image according to some embodiments of the present disclosure. Figure 4 As shown, 9 pixels are shown, with the middle pixel being X i,j Performing X-direction noise reduction on an image refers to calculating the grayscale value of pixels along the direction indicated by the arrow, that is, calculating the column of pixels indicated by the arrow. The specific calculation method will be described later.

[0061] See below Figures 5 to 7 . Figure 5 A schematic diagram of an original image of a column of pixels selected along a first direction according to an embodiment of the present disclosure is shown. Figure 6 A schematic diagram of an image after X-direction noise reduction according to an embodiment of the present disclosure is shown. Figure 7 Shows Figure 5 Schematic diagram of the grayscale value curve of the image after X-direction noise reduction is shown in FIG. Figure 5 The image in Figure 3 The part of the image is circled in the dashed line. Line L represents a column of pixels in the image. Figure 5 The line L in the image has two intersection points P1 and P2 with the figure in the image. As mentioned earlier, the figure in the image may have different grayscale areas. In this case, it is usually difficult to find a suitable curve fitting method to increase the signal-to-noise ratio of the measured position. Specifically, for figures with different grayscale areas, it is sometimes difficult to accurately extract the boundary of the figure using a single threshold for extraction. Therefore, how to set a suitable threshold to accurately extract the boundary of the figure is a difficulty in reality. Figure 5 The boundary positions indicated by points P1 and P2 in the image are the boundary positions to be identified. Sometimes, it is only necessary to measure the distance between the boundary positions indicated by points P1 and P2, which can be accurately achieved by performing X-direction noise reduction on the image and optimizing the contours of the boundaries indicated by P1 and P2, which will be described in detail later.

[0062] In the embodiments of the present disclosure, the image is processed to make the outline of the boundary position clearer, so as to facilitate the identification of the boundary position. Accurate identification of the boundary position can enable more accurate measurement results to be obtained in the subsequent measurement process of the graphic due to accurate identification of the outline of the graphic.

[0063] In some embodiments, based on the grayscale value of the area to be measured (e.g., a column of pixels), a grayscale value curve (not shown) of the column of pixels is generated. Generally speaking, the grayscale value levels of pixels in different areas are different, which makes it difficult to use a unified grayscale threshold to segment the boundaries of different grayscale areas. For example, if the grayscale threshold is set too high, the boundary position of the area with low grayscale value will be missed; conversely, if the grayscale threshold is set too low, it may cause non-boundary positions to be identified as boundary positions. In some embodiments of the present disclosure, a dynamic threshold method is adopted. The dynamic threshold means that for each column of pixels, the threshold is determined according to the pixel value of the column of pixels, rather than a pre-set fixed value.

[0064] In some embodiments, in order to reduce the impact of noise in the image, the rolling averages of the grayscale values ​​of each pixel in each column of pixels can be determined; and a corrected grayscale value can be generated based on the difference between the rolling averages of each pixel and the rolling averages of pixels within a predetermined range adjacent to the pixel.

[0065] The "rolling mean", also known as the sliding mean, is the average of multiple consecutive m-item sequences from a time series with n items, where n and m are positive integers and m is less than n. Specifically, the rolling mean means calculating the average of the data in a window of fixed size 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 series. The rolling mean can be used to smooth data, remove noise, find trends, etc.

[0066] It should be pointed out that the rolling mean value 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 used appropriately.

[0067] In some embodiments, determining the rolling averages of the grayscale values ​​of each pixel in each column of pixels may include: determining the first rolling averages of the grayscale values ​​of each pixel in the edge range of each column of pixels based on the predetermined rolling step length and the grayscale values ​​of each pixel in the first range associated with the predetermined rolling step length, wherein the length of the edge range is equal to the predetermined rolling step length; and determining the second rolling averages of the grayscale values ​​of each pixel in the middle range excluding the edge range in each column of pixels based on the predetermined rolling step length and the grayscale values ​​of each pixel in the first range associated with the predetermined rolling step length. This is further described below in conjunction with a specific calculation formula.

[0068] In some embodiments, to calculate the rolling average, the rolling step size can be set to s, where s is a value greater than 0 and can be adjusted according to actual needs. For example, in the example, s is 5, which means 5 values ​​in the x direction (horizontal direction), which is 5 pixels in this example.

[0069] In some embodiments, the data (gray value data or image data) from the endpoint to the range of s is called the boundary position, and this part of the data can be the average value of the pixel data within the distance of 2s+1 from each pixel point backward, see the following equation:

[0070]

[0071] Where i represents the i-th pixel, which can be regarded as the horizontal coordinate of the curve, x i represents the gray value of the pixel, 2s+1 represents the number of data points, Represents the rolling mean of the grayscale value of the i-th pixel.

[0072] In some embodiments, the average grayscale value of each middle point in the column of pixels can be calculated using the following equation:

[0073]

[0074] Where n is the total number of data points (or pixels), and the other parameters are the same as described above.

[0075] Here, the data start includes the start and end data, that is, [is,i+s]. For example, if i=5 and s=2, the data is from 3 to 7 (3,4,5,6,7), a total of 5 data: 2s+1.

[0076] 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:

[0077]

[0078] In the above embodiment, the first s data points are edge data. When calculating the sliding average, the average value is calculated by taking s data points forward and backward from the current selected point. Therefore, the average value of the first s data points can be approximately the average value of 2s+1 data points. In this way, the value of the s+1th data point is from 2 to 2s+2. It should be understood that the specific values ​​of the above step sizes are schematic and can be changed in various ways according to actual needs.

[0079] By taking the rolling average, the influence of a single point being too large or too small on the measurement result can be eliminated. The curve processed by the rolling average becomes smoother than the original gray value curve without the rolling average processing, thus eliminating the influence of a single point being too large or too small on the measurement result.

[0080] In some embodiments, the grayscale value curve after rolling average is further processed to reduce the signal strength inside the graph and enhance the signal at the boundary position on the curve. This can be achieved in the following way. In some embodiments, a predetermined constant can be used as the corrected grayscale value of each pixel in the edge range of each column of pixels, wherein the length of the edge range is equal to the predetermined range, and the predetermined constant can be 0, which is not limited by the present disclosure; based on the predetermined range, the grayscale average value of each pixel in the middle range of each column of pixels except the edge range is determined, and each grayscale average value is used as the corrected grayscale value of each pixel in the middle range. For example, the step size can be set to k, k is a value greater than 0, and its value can be adjusted according to actual needs, and is 5 in the example. The grayscale value of the data point to be processed can be read, and the grayscale values ​​of k points on the left and right sides are averaged. This is described in detail in conjunction with formula (4) below. The grayscale value of the data point to be processed is subtracted from the two average values, and then the absolute value is taken and added to obtain the processed value. Here, points are taken starting from the k+1 position. The leftmost and rightmost k points are set to 0 because they do not satisfy this method and belong to the edge area of ​​the image that cannot be calculated.

[0081] In some embodiments, determining the grayscale average of each pixel in the middle range excluding the edge range in each column of pixels based on the predetermined range may include: respectively determining the first average of the grayscale values ​​of each pixel in the middle range at the adjacent position on one side of each column of pixels within the predetermined range; respectively determining the second average of the grayscale values ​​of each pixel in the middle range at the adjacent position on the other side of each column of pixels within the predetermined range; 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 using the sum of the corresponding first absolute value and the corresponding second average value as the corrected grayscale value of each pixel in the middle range. The following is a detailed description in conjunction with formula (4).

[0082] In some embodiments, by further processing the gray value curve after rolling average, the signal strength inside the graph can be reduced, and the signal at the boundary position on the curve can be enhanced. This is described in detail below.

[0083] In some embodiments, the grayscale values ​​of k pixels may be read. The average grayscale value of the left k pixels is calculated. Specifically, the average grayscale value of the k pixels on the left side (or one side) of the i-th pixel is calculated. The average grayscale value of the k pixels on the right side is calculated. Specifically, the average grayscale value of k pixels on the right side (or the other side) of the ith pixel is calculated. Specifically, in some embodiments, the corrected grayscale value of each pixel can be calculated using the following formula:

[0084]

[0085] Where i represents the i-th pixel in each column, x i represents the grayscale 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 each column of pixels. Represents the corrected grayscale value, more specifically, represents the result of calculating the difference between the grayscale average value of i pixels within a certain step length and the pixel, and then calculating the absolute value and adding them together.

[0086] The area assigned a value of 0 in the above formula belongs to the edge of the curve. As mentioned above, this means that there is no boundary area that needs to be identified, that is, it is not used to calculate the boundary.

[0087] The purpose of using the above formula (4) for calculation in the above embodiment is mainly to take into account that the boundaries in the image are mostly locations where there is a certain change in the grayscale slope. However, since the background grayscale of other areas also has locations with a large slope to a certain extent, and the grayscale levels of different areas are also different, it is difficult to confirm the location of the boundary only by curve fitting or derivative. In addition, the difference between the grayscale value of each point and the grayscale value of the adjacent position is also considered as a signal feature. In other words, both the slope change of the grayscale value curve and the grayscale value change are taken into account, so that the boundary position can be highlighted, that is, the signal enhancement of the boundary position on the curve is achieved.

[0088] In addition, it should be understood that the embodiments of the present disclosure are not limited to using the above formula to calculate the rolling average, but various changes can be made to the above formula. For example, adding some coefficients or retaining the positive and negative directions can make the values ​​at the boundary positions larger; or taking the square or cube of the calculated results to widen the numerical difference of the results. In addition, the above embodiment uses the grayscale values ​​of adjacent pixels to calculate the difference and then takes the absolute value. 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.

[0089] In the above description, for the sake of distinction, the calculation step size of the sliding average is represented by s, and the calculation step size of the adjacent grayscale difference is represented by k. Generally speaking, the larger the value of the two, the weaker the signal strength will be, and the smaller the value, 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, which can achieve good noise reduction and contour enhancement effects.

[0090] The optimized gray value curve is as follows Figure 7 shown. Figure 7 Show Figure 5 The schematic diagram of the gray value curve of the image after the gray value curve is optimized. Figure 7It can be seen that the grayscale value inside the graph is flattened to a similar level, and the grayscale signal intensity of the two peaks 702 in the curve is significantly higher than that of other backgrounds.

[0091] Back to Figure 2 At box 204, the corresponding first corrected grayscale value of each pixel in each group of pixels is compared with the corresponding first threshold value, wherein the corresponding first threshold value is respectively related to the grayscale value of each pixel in the corresponding group of pixels.

[0092] In some embodiments, comparing the corrected grayscale value of each pixel in each column of pixels with the first threshold value may include: determining the percentile of the grayscale value of each pixel based on the grayscale value of each pixel in each column of pixels; and using the percentile as the threshold value.

[0093] In some embodiments, the percentile of the grayscale value of each pixel can be determined based on the grayscale value of each column of pixels; and the percentile is used as the threshold. Regarding percentile, for example, 100 pixels have 100 grayscale values. They are sorted from small to large according to the grayscale value. The grayscale value of the pixel ranked 90th corresponds to P90.

[0094] In some embodiments, the percentile is used as a threshold, so that the boundary position can be extracted according to the percentile. For example, the percentile can be 97%, and the effect is as follows Figure 7 shown. Figure 7 Figure 2 shows a schematic diagram of the curve after percentile extraction. Figure 7 It can be seen that the background grayscale values ​​are basically at a low level. For example, a threshold value P90 can be used to segment the peak positions of all boundaries.

[0095] As described above, in some embodiments, the grayscale signal of the boundary is enhanced and the grayscale of the internal area of ​​the graphic is reduced, so that the grayscale value of the boundary position is relatively larger. By using the percentile as a threshold, the peak positions of a few boundaries can be retained, and other smaller background noise peaks will be removed. The specific percentile can be verified based on the graphics to be measured to select the best position, and the percentile value can distinguish the grayscale value of the boundary from the grayscale background inside each area. The embodiments of the present disclosure are not limited to the percentile method, and other methods may also be used, such as traditional methods, such as using a fixed threshold method.

[0096] Back to Figure 2At block 206, the pixels in each group of pixels having a first corrected grayscale value greater than the corresponding first threshold are identified as the first boundary points of the graphics in the image. By comparing the grayscale value of the pixel with a percentile threshold, the pixels in each group of pixels having a first corrected grayscale value greater than the corresponding first threshold are identified as the first boundary points of the graphics in the image, and all boundary point positions can be separated. For example, in this way, the Figure 5 Points P1 and P2 are shown in .

[0097] At block 208, each first boundary point of the graphic identified in each group of pixels is identified as a first boundary of the graphic. That is, the corresponding boundary points are obtained by identifying a group of pixels, and each group of pixels is identified column by column (of course, each group of pixels can also be identified simultaneously), and the respectively identified boundary points are combined together to form the corresponding boundary.

[0098] Refer to the following Figure 6 Give a description. Figure 6 The present invention shows some embodiments of the present invention. Figure 5 The image shown is a schematic diagram of an image obtained after X-direction noise reduction is performed on the image. Figure 6 The images shown can be viewed by Figure 7 The gray value curve shown in FIG. 1 is obtained, in which the boundary positions on both sides (the longitudinally extending contours) are more clearly shown. Figure 6 The longitudinal profile 302 is obtained by obtaining the position of the grayscale enhancement peak. Figure 6 It can be seen that the method of the embodiment of the present disclosure can accurately identify the position of the boundary (or contour) of the graphic in the image. That is, each first boundary point of the graphic identified in each column of pixels can be identified as the first boundary of the graphic.

[0099] In some embodiments, the original gray value curve may not be subjected to rolling smoothing, and the contour enhancement method mentioned in the previous embodiments of the present disclosure may be directly implemented, that is, instead of calculating the rolling average, a certain range of widths is directly taken before and after each pixel to calculate the average value, and the average value is subtracted from the gray value of the pixel, and the absolute value is taken, and then the final corrected gray value is added. For example, formula (6) is used for calculation. At this time, the gray value processed in formula (6) is the original gray value (or after preliminary overall noise reduction) rather than the gray value after rolling average.

[0100] Some of the above embodiments describe a method for linearly denoising an image along a predetermined direction, that is, a method for linearly denoising each column of pixels. Linear denoising and boundary signal enhancement in the column direction will make the boundary signal in the row direction (perpendicular to the column) stronger. Therefore, the boundary in the row direction can be made clearer. The above method is particularly suitable for some specific application scenarios, such as for identifying graphics with multiple contour lines in one direction.

[0101] The embodiments of the present disclosure are not limited to performing linear noise reduction on an image along a predetermined direction (first direction). In some embodiments, noise reduction is also performed on the image along a second direction perpendicular to the first direction, for example, noise reduction is performed in the row direction. This is further described below.

[0102] See also Figure 8 , Figure 8 A schematic diagram of grayscale calculation direction when performing second direction (or Y direction) noise reduction on an image according to some embodiments of the present disclosure is shown. Figure 4 Similar, such as Figure 8 As shown, 9 pixels are shown, with the middle pixel being X i,j In this embodiment, performing Y-direction noise reduction on the image refers to calculating the pixel grayscale value along the direction indicated by the arrow.

[0103] Reference Figures 9 to 11 Give a description. Fig. 9 A schematic diagram showing an original image of a row of pixels selected along the Y direction according to an embodiment of the present disclosure; Fig.10 The embodiment of the present disclosure is shown Fig. 9 A schematic diagram of an image after Y-direction noise reduction is performed on the graphics; Fig.11 Shows Fig. 9 The grayscale value curve diagram of the image after Y-direction noise reduction is shown in FIG. Figure 5 The difference is, Fig. 9 Select a row of pixels along the Y direction in the original image. Figure 5 In the case where the pixels along the X direction are called column pixels, Fig. 9 The line L in may represent a row of pixels in the image. The line L has two intersection points P1 and P2 with the graphics in the image. As mentioned above, the graphics in the image may have different grayscale areas. Fig.10 The images shown in Fig.11 The gray value curve shown is obtained.

[0104] In some embodiments, a second corrected grayscale value for each pixel can be generated based on the grayscale value of each pixel in each row of pixels perpendicular to each column of pixels in the image and the grayscale values ​​of pixels within a predetermined range adjacent to each pixel in each row of pixels; the second corrected grayscale value of each pixel in each row of pixels is compared with a corresponding second threshold value, wherein the corresponding second threshold value is respectively related to the grayscale value of each pixel in a corresponding row of pixels; the pixels in each row of pixels having a second corrected grayscale value greater than the corresponding second threshold value are respectively identified as second boundary points of the graphic in the image; and the respective second boundary points of the graphic identified in each row of pixels are determined as the second boundary of the graphic.

[0105] In some embodiments of the present disclosure, the noise reduction in the Y direction may be performed in exactly the same manner as that in the X direction. In other words, each row of pixels may be processed in exactly the same manner as that in each column of pixels.

[0106] In some embodiments, linear noise reduction is performed on the image along the X and Y directions respectively to obtain images image_x (which may be referred to as the first image) and image_y (which may be referred to as the second image).

[0107] Refer to the following Fig.12 The image processing methods of other embodiments of the present disclosure are further described. Fig.12 A schematic diagram of an image processing method according to some other embodiments of the present disclosure is shown.

[0108] At block 1202, an original image is input.

[0109] At box 1204, the image is subjected to overall noise reduction using Gaussian filtering or median filtering. Gaussian filtering is a process of weighted averaging the entire image. The value of each pixel is obtained by weighted averaging the value of itself and other pixels in the neighborhood. The specific operation of Gaussian filtering is: use a template (or convolution, mask) to scan each pixel in the image, and replace the value of the central pixel of the template with the weighted average gray value of the pixels in the neighborhood determined by the template. Median filtering is a nonlinear smoothing technique that sets the gray value of each pixel to the median of the gray values ​​of all pixels in a neighborhood window of the point. Median filtering is a nonlinear signal processing technique based on sorting statistics theory that can effectively suppress noise. The basic principle of median filtering is to replace the value of a point in a digital image or digital sequence with the median of the values ​​of each point in a neighborhood of the point, so that the surrounding pixel values ​​are close to the true value, thereby eliminating isolated noise points.

[0110] See also Fig.13 and Fig.14 , Fig.13 The present invention shows some embodiments of the present invention. Figure 3Schematic diagram of the image obtained after Gaussian filtering of the original image shown; Fig.14 The present invention shows some embodiments of the present invention. Figure 3 Schematic diagram of an image obtained after median filtering is performed on the original image shown. After Gaussian filtering or median filtering, the noise in the original image can be removed. In the above embodiment, Gaussian filtering and median filtering are performed on the original image to obtain a denoised image. It should be understood that the embodiments of the present disclosure are not limited to this, and the overall denoising step of performing Gaussian filtering and median filtering on the original image is not necessary, but it can be determined whether to perform overall denoising based on the image quality.

[0111] At block 1206, the image is subjected to X-direction noise reduction using a linear noise reduction method to obtain an X-direction noise reduction image. When noise reduction optimization is performed along the X direction, the boundary signal in the Y direction will be enhanced, that is, after the linear noise reduction and boundary signal enhancement processing in the X direction, the boundary signal in the Y direction will be stronger, and the grayscale value of the internal area of ​​the image in the X direction will be weakened. Fig.16 , Fig.16 A schematic diagram of an image after performing X-direction noise reduction according to an embodiment of the present disclosure is shown.

[0112] At block 1208, the image is subjected to Y-direction noise reduction using a linear noise reduction method to obtain a Y-direction noise reduction image. Fig.17 , Fig.17 A schematic diagram of an image after Y-direction noise reduction according to an embodiment of the present disclosure is shown. Linear noise reduction and boundary signal enhancement processing in the Y direction will make the boundary signal in the X direction stronger.

[0113] By performing noise reduction in one direction, the boundary in one direction can be made clearer. This solution is particularly suitable for identifying graphics with multiple contour lines in one direction.

[0114] By optimizing the X / Y direction, the boundary signals in the Y direction and the X direction can be further highlighted, and finally image_x and image_y are superimposed to obtain a complete image. That is, the first image including the first boundary and the second image including the second boundary are superimposed to generate an image with an enhanced boundary. Specifically, the image including the first contour and the image including the second contour can be superimposed by adding the grayscale values ​​of the pixels of the image including the first contour to the grayscale values ​​of the corresponding pixels in the image including the second contour to generate an enhanced grayscale value.

[0115] At block 1210, the image subjected to X-direction noise reduction and the image subjected to Y-direction noise reduction are combined into a new image. Fig.18 , Fig.18FIG. 1 is a schematic diagram showing an image obtained by superimposing an image after denoising in the X direction and an image after denoising in the Y direction according to an embodiment of the present disclosure. Fig.18 It can be seen that after the image is subjected to noise reduction in both the X direction and the Y direction, the graphic outline 302 becomes clearer.

[0116] Fig.15 FIG. 1 is a flowchart of an image processing method 1500 according to some other embodiments of the present disclosure. Fig.15 As shown, at block 1502, the grayscale value of a column of pixels in the image is read. It should be noted that reading a column of pixels and reading a row of pixels are substantially the same for the solution of the embodiment of the present disclosure. A column of pixels and a row of pixels represent that the two are perpendicular to each other.

[0117] At box 1504, the rolling average of the grayscale values ​​of each point is calculated. The specific calculation method can adopt the method in the previous embodiment.

[0118] At block 1506, the sum of the absolute values ​​of the grayscale differences between adjacent positions of each point is calculated. The specific calculation method may adopt the method described in the previous embodiment.

[0119] At box 1508, percentiles are dynamically selected as thresholds for denoising. As described in the previous embodiments, the threshold is determined based on the grayscale value of a column of pixels or a row of pixels, that is, the threshold is not predetermined, but is related to the grayscale value of a column of pixels or a row of pixels in the image to be measured, and is therefore dynamically selected. For example, the threshold is set by percentile. The embodiments of the present disclosure are not limited thereto, and other methods of setting the threshold based on the grayscale value of a column of pixels or a row of pixels may also be used.

[0120] After the noise reduction process (or optimization process), the grayscale values ​​of the remaining positions of the image become significantly darker than the original image except that the border is still relatively bright; in addition, the peak in the curve is the border position, and its signal strength is relatively greater than the background next to it. Signal strength refers to the contrast of the grayscale value at the border relative to the grayscale value of other areas. In some embodiments of the present disclosure, after the noise reduction process, the grayscale values ​​of other areas are close to black (grayscale values ​​are close to 0), while the grayscale values ​​of the border area are highlighted.

[0121] The principle of one aspect of the image processing method of some embodiments of the present disclosure is that: according to the method used for enhancing the boundary signal, the area with similar grayscale values ​​will be processed as the background, and the grayscale value is close to 0. That is, after the operation processing along the X direction, the grayscale value in this X direction will be treated as a region, and the grayscale value after processing is close to 0. The boundary in the Y direction has obvious grayscale changes, and the grayscale is highlighted after processing, thereby achieving the effect of signal enhancement.

[0122] In some embodiments of the present disclosure, linear noise reduction and boundary enhancement methods are used to process images. In some embodiments, the grayscale value of each line is optimized for noise reduction and the grayscale signal at the boundary position is improved. At the same time, a dynamic percentile is set as a threshold for denoising for each linear grayscale value, so that denoising in each direction is more reasonable. As mentioned above, for each column of pixels, the threshold is set according to the column, such as P90, and the pixel values ​​of each column of pixels are different, so the thresholds are different, which is a dynamic setting.

[0123] An electronic device is also disclosed in an embodiment of the present disclosure. The electronic device includes: a processor; and a memory coupled to the processor, the memory having instructions stored therein, and the instructions, when executed by the processor, cause the device to perform actions, the actions including: generating a first corrected grayscale value for each pixel based on the grayscale value of each pixel in each group of pixels in a predetermined direction in the image and the grayscale value of each pixel within a predetermined range adjacent to each pixel in each group of pixels; comparing the corresponding first corrected grayscale value of each pixel in each group of pixels with a corresponding first threshold value, respectively, wherein the corresponding first threshold value is respectively related to the grayscale value of each pixel in a corresponding column of pixels; respectively identifying pixels in each group of pixels having a first corrected grayscale value greater than the corresponding first threshold value as first boundary points of a graphic in the image; and identifying each first boundary point of the graphic respectively identified in each group of pixels as a first boundary of the graphic.

[0124] An embodiment of the present disclosure further discloses a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the image processing method according to the embodiment of the present disclosure is implemented.

[0125] The solutions of some embodiments of the present disclosure propose improved image processing solutions. Specifically, the embodiments of the present disclosure propose improved methods for image noise reduction and contour feature enhancement. The technical solutions of the embodiments of the present disclosure can effectively improve the signal strength of the image contour boundary, thereby facilitating more effective extraction of the graphic contour.

[0126] In the scheme of the embodiments of the present disclosure, the grayscale value of the original image can be optimized by performing linear noise reduction and enhancing the boundary signal in the X / Y direction of the image, and the grayscale value on each line can be de-noised by using the percentile threshold method, so that the noise reduction method is more targeted, and the interference of the overall grayscale change of the image on the result is avoided, and the signal strength of the image contour boundary is effectively improved. In addition, the scheme of some embodiments of the present disclosure can also be combined with other noise reduction methods to more effectively extract the contour of the graphic.

[0127] It should be understood that the embodiments shown in the drawings are only for schematically illustrating the solutions of some embodiments of the present disclosure and are not intended to limit the present disclosure. The embodiments of the present disclosure may also have various other forms.

[0128] Fig.19 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 laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0129] like Fig.19 As shown, the device 1900 includes a CPU 1901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1902 or a computer program loaded from a storage unit 1908 into a random access memory (RAM) 1903. In the RAM 1903, various programs and data required for the operation of the device 1900 can also be stored. The CPU 1901, the ROM 1902, and the RAM 1903 are connected to each other via a bus 1904. An input / output (I / O) interface 1905 is also connected to the bus 1904.

[0130] Multiple components in the device 1900 are connected to the I / O interface 1905, including: an input unit 1906, such as a keyboard, a mouse, etc.; an output unit 1907, such as various types of displays, speakers, etc.; a storage unit 1908, such as a disk, an optical disk, etc.; and a communication unit 1909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1909 allows the device 1900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0131] The various processes and processing described above, such as method 200, may be executed by CPU 1901. For example, in some embodiments, method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 1908. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1900 via ROM 1902 and / or communication unit 1909. When the computer program is loaded into RAM 1903 and executed by CPU 1901, one or more steps in method 200 described above may be performed.

[0132] The scheme according to the embodiment 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 on which computer-readable program instructions for executing various aspects of the present disclosure are loaded. 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 external storage device via a network, such as the Internet, a local area network, a wide area network and / or a wireless network.

[0133] Various embodiments of the present disclosure have been described above, and the above descriptions are exemplary and are only optional embodiments of the present disclosure, not exhaustive, and are not intended 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 features or any novel combination of features disclosed herein, whether or not it relates to the same scheme in any claim currently claimed for protection. The applicant hereby informs that new claims may be formulated into these features and / or combinations of these features during the examination of this application or in any further application derived therefrom.

[0134] The terms used in this article are selected to best explain the principles of each embodiment, practical application or technical improvement in the market, or to enable other ordinary technicians in the field to understand the embodiments disclosed herein. For those skilled in the art, the present disclosure may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the scope of protection of the present disclosure.

Claims

1. An image processing method, comprising: Generate a first corrected grayscale value of each pixel based on the grayscale value of each pixel in each group of pixels in a predetermined direction in the image and the grayscale values ​​of pixels within a predetermined range adjacent to each pixel in each group of pixels; Comparing the first corrected grayscale value of each pixel in each group of pixels with a first threshold value, wherein the first threshold value is related to the grayscale value of each pixel in the group of pixels; Respectively identifying pixels in each group of pixels having a first corrected grayscale value greater than the corresponding first threshold as first boundary points of a graphic in the image; as well as Each first boundary point of the graphic identified in each group of pixels is identified as a first boundary of the graphic.

2. The method according to claim 1, wherein generating the first corrected grayscale value of each pixel based on the grayscale value of each pixel in each group of pixels in the image and the grayscale values ​​of pixels within a predetermined range adjacent to each pixel in each group of pixels comprises: Determine the rolling average of the respective grayscale values ​​of each pixel in each group of pixels; as well as Each of the first corrected grayscale values ​​is generated based on the difference between the rolling average of the grayscale values ​​of each pixel and the rolling average of pixels within the predetermined range adjacent to the pixel.

3. The method according to claim 2, wherein determining the rolling average of the respective grayscale values ​​of each pixel in each group of pixels comprises: For each pixel in the edge range of each group of pixels, determining a first rolling average of the grayscale values ​​of each pixel based on the grayscale values ​​of each pixel in a first range associated with a predetermined rolling step, wherein the length of the edge range is equal to the predetermined rolling step; as well as For each pixel in the middle range outside the edge range in each group of pixels, a second rolling average of the respective grayscale values ​​of the respective pixels is determined based on the respective grayscale values ​​of the pixels in the first range associated with the predetermined rolling step.

4. The method according to claim 1, wherein generating the first corrected grayscale value of each pixel based on the grayscale value of each pixel in each group of pixels in the image and the grayscale values ​​of pixels within a predetermined range adjacent to each pixel in each group of pixels comprises: Using a predetermined constant as a first corrected grayscale value of each pixel within an edge range in each group of pixels, wherein the length of the edge range is equal to the predetermined range; as well as For each pixel in the middle range outside the edge range in each group of pixels, the corresponding first corrected grayscale value is determined based on the grayscale average value of each pixel in the predetermined range adjacent to the each pixel.

5. The method according to claim 4, wherein determining the grayscale average of each pixel in the middle range excluding the edge range in each group of pixels based on the first predetermined range comprises: Respectively determining a first average value of grayscale values ​​of pixels within the predetermined range at adjacent positions on one side of each pixel group of pixels within the intermediate range; Respectively determining a second average value of the grayscale values ​​of pixels within the predetermined range at adjacent positions on the other side of each group of pixels for each of the pixels within the middle range; Determine respectively a first absolute value of a difference between a gray value of each pixel and a corresponding first average value; Determine the second absolute value of the difference between the gray value of each pixel and the corresponding second average value; as well as The sum of the corresponding first absolute value and the corresponding second average value is respectively used as the first corrected grayscale value of each of the pixels in the intermediate range.

6. The method according to claim 5, wherein the first corrected grayscale value is determined using the following formula: Where i represents the i-th pixel in each group of pixels, represents the first corrected gray value of the i-th pixel, x i represents the grayscale value of the ith pixel, k is an integer greater than or equal to 1, and n represents the total number of pixels in each group of pixels.

7. The method according to claim 1, wherein comparing the first corrected grayscale value of each pixel in each group of pixels with the first threshold value comprises: Determining a percentile of a grayscale value of each pixel in each group of pixels based on the grayscale value of each pixel in each group of pixels; as well as The percentile is used as the first threshold of each corresponding group of pixels.

8. The method according to any one of claims 1 to 7, further comprising: Generate a second corrected grayscale value for each pixel based on the grayscale value of each pixel in each row of pixels perpendicular to each group of pixels in the image and the grayscale values ​​of pixels within the predetermined range adjacent to each pixel in each row of pixels; Comparing the second corrected grayscale value of each pixel in each row of pixels with a corresponding second threshold value, respectively, wherein the corresponding second threshold value is respectively related to the grayscale value of each pixel in a corresponding row of pixels; Respectively identifying pixels in each row of pixels having a second corrected grayscale value greater than the corresponding second threshold as second boundary points of the graphic in the image; as well as The respective second boundary points of the graphic identified in each row of pixels are determined as the second boundary of the graphic.

9. The method according to claim 8, further comprising: A first image including the first boundary and a second image including the second boundary are superimposed to generate an image with an enhanced boundary.

10. The method of claim 9, wherein superimposing the image including the first boundary with the image including the second boundary comprises: Grayscale values ​​of pixels in the image including the first boundary are added to grayscale values ​​of corresponding pixels in the image including the second boundary to generate enhanced grayscale values.

11. The method according to any one of claims 1 to 7, wherein before generating the first corrected grayscale value, it also includes: A Gaussian filter or a median filter is applied to the image to generate a noise-reduced image.

12. An electronic device comprising: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, the instructions causing the device to perform actions when executed by the processor, the actions comprising: Generate a first corrected grayscale value of each pixel based on the grayscale value of each pixel in each group of pixels in a predetermined direction in the image and the grayscale values ​​of pixels within a predetermined range adjacent to each pixel in each group of pixels; Comparing the first corrected grayscale value of each pixel in each group of pixels with a first threshold value, wherein the first threshold value is related to the grayscale value of each pixel in the group of pixels; Respectively identifying pixels in each group of pixels having a first corrected grayscale value greater than the corresponding first threshold as first boundary points of a graphic in the image; and Each first boundary point of the graphic identified in each group of pixels is identified as a first boundary of the graphic.

13. The electronic device of claim 12, wherein the image is a transmission electron microscope image or a scanning electron microscope image.

14. A computer-readable storage medium having machine-executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Automatic detection method and device for roughness light-incision profile curve

    CN104697476A

  • Image processing method and apparatus and electronic device

    CN106651777A

  • Image processing method and device, electronic equipment and computer readable storage medium

    CN111080550A

  • Automobile glass sub-pixel contour extraction method and automobile glass detection method

    CN111415376A

  • Image processing method, electronic equipment and computer readable storage medium

    CN118674668A