Image processing method and system, device and storage medium

CN117392044BActive Publication Date: 2026-08-11SKYVERSE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-01
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0004]但是,上述边缘提取和机械定位的精度有限,从而导致产品的对准无法达到所期望的精度范围

Benefits of technology

[0011]本发明实施例提供的图像处理方法中,通过先获取待测物的待分析图像,以便结合待分析图像的特征,对待分析图像进行边缘提取,从而有利于准确提取出待测物的边缘轮廓,同时,利用待测物的待分析图像来进行图像处理,以实现提取轮廓的目的,也有利于提高提取待测物的边缘轮廓的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117392044B_ABST
    Figure CN117392044B_ABST
Patent Text Reader

Abstract

An image processing method, system, device, and storage medium are disclosed. The method includes: acquiring an image to be analyzed, the image to be analyzed containing the edge contour of an object to be tested; and performing edge extraction on the image to be analyzed to obtain the edge contour of the object to be tested. This invention first acquires the image to be analyzed of the object to be tested, and then combines the features of the image to be analyzed to perform edge extraction, thereby facilitating accurate extraction of the edge contour of the object to be tested. Simultaneously, using the image to be analyzed of the object to be tested for image processing to achieve the purpose of contour extraction also helps to improve the efficiency of edge contour extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of optical detection technology, and in particular to an image processing method, system, device and storage medium. Background Technology

[0002] In the field of optical inspection technology, extracting the edge contour of a regularly shaped object to determine its center position is an important step, which is often used in applications such as target recognition and precise product positioning.

[0003] Taking precise product positioning as an example, most production equipment is currently automated. It typically controls the position of the product inside the equipment through mechanical control. For example, the production equipment uses a robotic arm to transport the product and uses sensors to detect the product's edges. A linear CCD sensor collects edge data when the product is rotating, and the center of the product is fitted using the collected edge data. The feedback data is then used to control the movement of the robotic arm, so that the product is placed on the chuck and positioned at the preset location.

[0004] However, the accuracy of the aforementioned edge extraction and mechanical positioning is limited, which results in the product alignment failing to achieve the desired accuracy range. Summary of the Invention

[0005] The problem solved by the embodiments of the present invention is to provide an image processing method, system, device and storage medium that is beneficial for accurately extracting the edge contour of the object to be measured.

[0006] To address the aforementioned problems, this invention provides an image processing method, comprising: acquiring an image to be analyzed, wherein the image to be analyzed contains the edge contour of an object to be tested; and performing edge extraction on the image to be analyzed to obtain the edge contour of the object to be tested.

[0007] Accordingly, this embodiment of the invention also provides an image processing system for executing the image processing method of this embodiment of the invention. The image processing system includes: an image acquisition module for acquiring an image to be analyzed, wherein the image to be analyzed contains the edge contour of the object to be tested; and an edge extraction module for performing edge extraction on the image to obtain the edge contour of the object to be tested.

[0008] Accordingly, embodiments of the present invention also provide an apparatus, including at least one memory and at least one processor, wherein the memory stores one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the image processing method described in the embodiments of the present invention.

[0009] Accordingly, embodiments of the present invention also provide a storage medium storing one or more computer instructions, which are used to implement the image processing method described in the embodiments of the present invention.

[0010] Compared with the prior art, the technical solution of the embodiments of the present invention has the following advantages:

[0011] In the image processing method provided by the embodiments of the present invention, an image of the object to be analyzed is first acquired so as to combine the features of the image to be analyzed to extract the edge of the image to be analyzed, thereby facilitating the accurate extraction of the edge contour of the object to be analyzed. At the same time, image processing is performed on the image of the object to be analyzed to achieve the purpose of contour extraction, which also helps to improve the efficiency of extracting the edge contour of the object to be analyzed.

[0012] In the optional scheme, the image to be analyzed is a weighted image. The image of the object to be tested at the edge position is obtained. The edge contour of the object to be tested extends along a preset direction range in the image to be tested. Multiple target feature maps of the image to be tested are obtained, and the target feature maps are weighted to obtain a weighted image representing the correspondence between the position of the first point in the image to be tested and the weighted value. The weighting is used to make the gradient magnitude of the weighted value of the first point at the edge of the object to be tested greater than the gradient magnitude of the weighted value of the first point adjacent to the first point at the edge. The weighting of the target feature map is beneficial to the noise reduction effect (for example, it is beneficial to reduce the probability of misjudging the pattern inside the object to be tested, the background pattern, or other noise pattern as the edge of the object to be tested). It is also beneficial to consider the various features corresponding to the edge while extracting the edge from the weighted image. At the same time, since the weighting is used to make the gradient magnitude of the weighted value of the first point at the edge of the object to be tested greater than the gradient magnitude of the weighted value of the first point adjacent to the first point at the edge, the edge of the object to be tested is more prominent, which is beneficial to accurately extract the edge contour of the object to be tested. Attached Figure Description

[0013] Figure 1 This is a flowchart of an embodiment of the image processing method of the present invention;

[0014] Figure 2 yes Figure 1 In step S1, a schematic diagram of an embodiment of the test object is shown;

[0015] Figure 3 yes Figure 1 Flowcharts of each step in step S1 according to an embodiment;

[0016] Figure 4 yes Figure 3 In step S10, a schematic diagram of an embodiment of the image to be tested is shown;

[0017] Figure 5 yes Figure 3In step S11, a schematic diagram of the image to be tested after rotation is shown.

[0018] Figure 6 This is a diagram illustrating how to obtain a continuous path from the start line to the end line.

[0019] Figure 7 This is a functional block diagram of an embodiment of the image processing system of the present invention;

[0020] Figure 8 yes Figure 7 A functional block diagram of an embodiment of the image acquisition module;

[0021] Figure 9 This is a hardware structure diagram of a device provided in an embodiment of the present invention. Detailed Implementation

[0022] As can be seen from the background technology, the accuracy of current edge extraction methods still needs to be improved.

[0023] Research has revealed that in current edge extraction processes, uneven lighting may occur for different lighting systems, product materials, and patterns. Furthermore, factors such as complex patterns inside the product, surface dirt, or low reflectivity can easily lead to poor edge contrast, resulting in incorrect edge contour extraction.

[0024] To address the technical problem, embodiments of the present invention provide an image processing method. (See reference...) Figure 1 The flowchart illustrates an embodiment of the image processing method of the present invention. This embodiment of the image processing method includes the following basic steps:

[0025] Step S1: Acquire the image to be analyzed, which contains the edge contour of the object to be tested;

[0026] Step S2: Perform edge extraction on the image to be analyzed to obtain the edge contour of the object to be tested.

[0027] By first acquiring the image of the object to be analyzed, and then combining the features of the image to be analyzed, edge extraction can be performed on the image to be analyzed, which is conducive to accurately extracting the edge contour of the object to be analyzed. At the same time, using the image of the object to be analyzed to perform image processing to achieve the purpose of contour extraction is also conducive to improving the efficiency of extracting the edge contour of the object to be analyzed.

[0028] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0029] Reference Figures 1 to 5 Execute step S1 to acquire the image to be analyzed (e.g., 300). Figure 6As shown), the image to be analyzed contains the edge contour of the object to be tested 100.

[0030] The edge contour of the object to be analyzed is then obtained by processing the image.

[0031] Specifically, the features of the image to be analyzed can be combined to extract the edge contour of the image to be analyzed, which is conducive to accurately extracting the edge contour of the object to be analyzed. At the same time, the image to be analyzed 300 of the object to be analyzed is used for image processing to extract the contour, which is also conducive to improving the efficiency of extracting the edge contour of the object to be analyzed 100.

[0032] In this embodiment, in the image 300 to be analyzed, the second attribute value of the first point at the edge of the object to be tested 100 has a minimum or maximum value.

[0033] The first point at the edge of the object to be tested 100 has a maximum value in the image to be analyzed 300, which makes the first point at the edge of the object to be tested 100 more prominent. Therefore, when performing edge extraction on the image to be analyzed 300, the edge contour of the object to be tested 100 can be obtained by extracting the second attribute value and the path with the third maximum value of the image to be analyzed 300.

[0034] In this embodiment, the test object 100 is circular. In other embodiments, depending on the specific type of the test object, it may be other shapes, such as square. As an example, the test object 100 is a wafer. In other embodiments, the test object may also be other products whose edge contours need to be extracted.

[0035] In this embodiment, acquiring the image to be analyzed 300 includes: acquiring the image to be analyzed of the object to be tested 100 at multiple different edge positions, wherein the number of edge positions is greater than or equal to 3.

[0036] To improve the accuracy of determining the actual center of the test object 100, at least 3 points are usually needed to determine the center. Therefore, the number of edge locations 100L is greater than or equal to 3.

[0037] In this embodiment, multiple edge positions 100L are evenly distributed along the edge of the object to be tested 100, which helps to further improve the accuracy of center determination. For example, if the object to be tested 100 has a preset initial center S1, taking a number of edge positions 100L of 3 as an example, the angle β between the lines connecting adjacent edge positions 100L and the preset initial center S1 of the object to be tested 100 is 120°. In other embodiments, when the number of edge positions is 4, the lines connecting each edge position and the preset initial center of the object to be tested form a 90° angle with each other.

[0038] Taking the shape of the object to be tested 100 as circular as an example, the preset initial center is the preset initial center of the circle. Specifically, in this embodiment, the position of the preset initial center S1 of the object to be tested 100 is the preset position of the mechanical positioning.

[0039] As an example, the image 300 to be analyzed is a weighted image. The weighted image is obtained by weighting the various target feature maps corresponding to the image of the object to be tested 100. This allows for a comprehensive consideration of the various features corresponding to the first point at the edge of the object to be tested 100, which in turn helps to further improve the accuracy of extracting the edge contour of the object to be tested 100.

[0040] In one specific embodiment, the image processing method is used to determine the center of the object under test 100 using the extracted edge contours of the object under test 100, thereby ensuring the positioning accuracy of the object under test 100 in the device. For example, in semiconductor manufacturing and metrology, determining the wafer center is an important step for accurately aligning various parts of the wafer, thereby ensuring that when the position of the pattern under test is further determined based on the known relative position vector relationship between the wafer center and the pattern under test, the positioning accuracy is controlled within a certain range.

[0041] The following combination Figures 3 to 5 The steps for acquiring the image to be analyzed are explained in detail.

[0042] Reference Figures 3 to 5 Execute step S10 to acquire the test image 200 of the test object 100 at the edge position 100L. The test image 200 contains the image of the edge contour of the test object 100. The edge contour of the test object 100 extends in the test image 200 along a preset direction range (not shown).

[0043] The image to be tested 200 contains an image of the edge contour of the object to be tested 100, so that the edge contour of the object to be tested 100 can be extracted by image processing of the image to be tested 200.

[0044] Among them, the image processing is performed using the image 200 of the object to be tested 100 to achieve the purpose of extracting the contour, which is also conducive to improving the efficiency of extracting the edge contour of the object to be tested 100, and correspondingly conducive to meeting the needs of large-scale automated processing of the machine, effectively improving the output of the machine.

[0045] In this embodiment, acquiring the test image 200 of the test object 100 at the edge position 100L includes: selecting the edge position 100L according to the preset initial center S1 and preset radius R of the test object 100, wherein the distance between the edge position 100L and the preset initial center S1 is the preset radius R; and acquiring the test image 200 of the test object 100 at the edge position 100L.

[0046] Therefore, acquiring the test image 200 of the object under test 100 at edge positions 100L includes: acquiring test images 200 of the object under test 100 at multiple different edge positions 100L. In this embodiment, the number of edge positions 100L is greater than or equal to 3.

[0047] As an example, the image under test 200 is rectangular in shape and is a dark field image. In other embodiments, the image under test may also be a bright field image.

[0048] In this embodiment, a detection system is used to acquire the image to be analyzed. Specifically, the detection system is used to acquire the image 200 of the object to be tested 100 at its edge position.

[0049] The detection system includes an image acquisition module and a motion platform. The motion platform supports the object under test 100 and enables relative movement between the image acquisition module and the object under test 100. Accordingly, after acquiring the image 200 of the object under test 100 at edge position 100L, the coordinates of each pixel of the image 200 at edge position 100L in the coordinate system of the motion platform can be obtained.

[0050] In this embodiment, before acquiring the target feature map of the image to be tested 200, the image processing method further includes: performing step S12 to acquire an initial feature map based on the image to be tested 200. The initial feature map includes at least one of the gradient map, gradient magnitude map, grayscale map, color map and the image to be tested of the image to be tested 200. The gradient map includes the grayscale gradient value of each first point.

[0051] If the target feature map obtained subsequently includes a binary map, then at least one of the above initial feature maps is used for binarization processing to obtain the corresponding binary map. When performing binarization processing, the threshold condition of the first attribute value corresponding to the selected initial feature map is used as the standard.

[0052] In particular, a binary image is used to distinguish the first point at the edge of the object to be tested 100 and the first point adjacent to the first point at the edge, so that the points at the edge of the object to be tested 100 become more prominent after the target feature map is weighted in the subsequent process.

[0053] Specifically, an initial feature map can be selected based on the actual characteristics of the object to be tested 100 (e.g., pattern or color) to make the points at the edges of the object to be tested 100 more prominent.

[0054] It is understandable that the first attribute value of the initial feature map is related to the pixel position of the image to be tested 200.

[0055] In one specific embodiment, the initial feature map includes a gradient map. Accordingly, the gradient map is subsequently binarized.

[0056] Since the grayscale gradient value of the first point at the edge of the object to be tested 100 is usually large, obtaining a binary image based on the gradient map is also helpful in distinguishing the first point at the edge of the object to be tested 100 from the first point adjacent to it, and makes the first point at the edge of the object to be tested 100 more prominent.

[0057] In this embodiment, the Sobel operator is used to calculate the pixel gradient of the image under test 200 to obtain the grayscale gradient value. Furthermore, the Sobel operator can also be used to obtain the gradient magnitude map and gradient angle map of the image under test 200.

[0058] By using the Sobel operator in both the X and Y directions, it is possible to simultaneously calculate the gradient magnitude and gradient angle information. This can be achieved by only determining the size of the convolution kernel, without the need for additional parameters, which facilitates the quick and convenient acquisition of gradient magnitude and gradient angle maps.

[0059] Accordingly, the Sobel operator has n*n convolution kernels in both the X and Y directions. Increasing the kernel size improves noise reduction; a larger kernel results in smoother texture, which helps filter out noise from individual pixels, reducing sensitivity to noise and making it easier to find wider edges. However, if n is too large, the edges of the object 100 in the image 200 may be mistaken for noise and filtered out, especially when the edges are thin. Therefore, in this embodiment, n is an integer from 7 to 9.

[0060] In the image 200 to be tested, for any pixel, the gray-level gradient value in the X direction is G. x The gray-level gradient value in the Y direction is G. y The gradient magnitude of the pixel is The gradient angle value of a pixel is arctan(G). x / G y ), where the X direction is orthogonal to the Y direction.

[0061] As an example, the gradient angle is defined as ranging from -180° to 180°. In other embodiments, other definitions may be used, such as defining it as ranging from 0° to 360°.

[0062] It should be noted that in other embodiments, binary maps can also be obtained based on other types of initial feature maps.

[0063] For example, in another embodiment, if the image to be tested is a color image and the edge contour of the object to be tested is a specific color (e.g., red), then the initial feature map can be a color image. Accordingly, when binarizing later, whether the first point is a first point related to the specific color is used as the screening criterion.

[0064] In other embodiments, when the edge contour of the object to be tested has a specific gray value, the initial feature map can be the original image (i.e., the image to be tested 200 itself). Correspondingly, the image to be tested is binarized using a gray threshold to obtain a binary image of the image to be tested.

[0065] Continue to refer to Figure 1 Step S13 is executed, and multiple target feature maps are obtained based on the image to be tested 200. Each target feature map includes the correspondence between the position of each first point and the first attribute value. The position of the first point of the target feature map corresponds one-to-one with the position of the pixel of the image to be tested. The types of first attribute values ​​of the multiple target feature maps are different. The first attribute value characterizes the attribute of the target feature map.

[0066] The target feature map is then weighted to obtain the weighted value of all first attribute values ​​for each first point, thus obtaining a weighted map related to the position of the first point in the image under test, so that edge extraction can be performed on the weighted map in the future.

[0067] In this embodiment, multiple types of target feature maps are used. By selecting multiple target feature maps, the weighting term is increased, allowing more types of features to be considered, which in turn helps to improve the accuracy of subsequent edge extraction.

[0068] In this embodiment, the first attribute values ​​of the various target feature maps include any combination of gradient magnitude, gradient angle, pixel grayscale value, binarization value, and color representation value.

[0069] Image processing methods can extract the edge contours of the object to be measured 100. Therefore, based on the actual characteristics of the object to be measured 100 (such as pattern or color), a suitable target feature map is selected so that, after weighting, the points at the edges of the object to be measured 100 become more prominent.

[0070] Specifically, the target feature map includes any of the following: gradient magnitude map, gradient angle map, gradient difference map, grayscale map, binary map, and color map. The gradient difference map includes the absolute value of the grayscale gradient difference between each of the first points in the first gradient direction and the second gradient direction, wherein the first gradient direction and the second gradient direction are different.

[0071] Specifically, the absolute value of the gray-level gradient difference between the first gradient direction and the second gradient direction refers to the absolute value of the difference between the gray-level gradient value in the first gradient direction and the gray-level gradient value in the second gradient direction.

[0072] In this embodiment, the first gradient direction is perpendicular to the extension direction of the edge of the object to be tested 100.

[0073] It should also be noted that the image processing method can extract the edge contour of the object to be tested 100. The gradient magnitude of the first point at the edge of the object to be tested 100 is usually large. Therefore, using the gradient magnitude map or gradient difference map as the target feature map is beneficial to make the first point at the edge of the object to be tested 100 more prominent.

[0074] Similarly, since the gradient angle corresponding to the first point at the edge of the test object 100 is relatively uniform and usually falls within a specific angle range, using a gradient angle diagram is also beneficial to make the first point at the edge of the test object 100 more prominent.

[0075] Similarly, based on the actual characteristics of the image 200 to be tested, other target feature maps that are beneficial for distinguishing the first point at the edge of the object 100 and the remaining first point can also be selected, such as grayscale images, binary images, and color images. For example, since the image to be tested is a dark field image or a bright field image, if the edge part has a specific grayscale range, a grayscale image can also be selected as the target feature map.

[0076] It should also be noted that the grayscale image here is the original grayscale image of the image to be tested.

[0077] In this embodiment, the target feature map includes a first target feature map and a second target feature map, and the first attribute value of the first point at the edge of the test object 100 in both the first and second target feature maps is either a maximum value or a minimum value. The fact that the first attribute value of the first point at the edge of the test object 100 in both the first and second target feature maps has extreme values ​​makes the first point at the edge more prominent.

[0078] Specifically, the first target feature map includes one or both of the gradient angle map and the binary map, the second target feature map is the gradient magnitude map or the image to be tested 200 itself, the gradient angle map includes the gradient angle value of the gray-level gradient of each first point, and the gradient angle value at the edge of the object to be tested 100 has a maximum or minimum value, and the gradient magnitude map includes the gradient magnitude of the gray-level gradient of each first point.

[0079] The gradient angle corresponding to the first point at the edge of the test object 100 is relatively uniform, usually within a specific angle range. Therefore, the gradient angle value at the edge of the test object 100 has a maximum or minimum value. Accordingly, using a gradient angle map for weighting helps to ensure that the gradient magnitude of the weighted value of the first point at the edge of the test object 100 is greater than the gradient magnitude of the weighted value of the first point adjacent to the first point at the edge. Consequently, when extracting edges from the weighted map, the directional features at the edges can be considered, which helps to further improve the accuracy, versatility, and robustness of extracting the edge contour of the test object 100.

[0080] Binary maps are also a way to highlight the first point at the edge of the object 100. Therefore, they can be used for weighting to distinguish the first point at the edge of the object 100 from its adjacent first points. A binary map typically contains two types of first points: one type with a first attribute value of 1 and the other with a first attribute value of 0. Therefore, using a binary map for weighting makes it easier to ensure that the binary value of a specific first point contributes 0 to the weighted value, thus making the edge points of the object 100 more prominent in the weighted map.

[0081] As an example, the second target feature map is a gradient magnitude map. Based on the aforementioned information, the gradient magnitude of the first point at the edge of the object 100 is usually large. Therefore, using a gradient magnitude map for weighting is beneficial for distinguishing the first point at the edge of the object 100 from its adjacent first points. Correspondingly, when extracting edges from the weighted map subsequently, the magnitude features at the edges can be considered, which helps to further improve the accuracy, versatility, and robustness of extracting the edge contour of the object.

[0082] In this embodiment, taking the target feature map including a binary map as an example, the binary map includes a first type of point with a first attribute value of a first type of attribute value and a second type of point with a first attribute value of a second type of attribute value, and the edge of the object to be tested 100 has a second type of point.

[0083] In other words, the second type of points are used as candidate points for edge processing of the object under test, and the first type of points are used as non-candidate points. The binary image is used to distinguish between the candidate points and the remaining first points of the edge contour of the object under test 100.

[0084] In one specific embodiment, the weighted image is then subjected to edge extraction to obtain the edge contour of the object to be tested. The weighted value of the first point through which the edge contour passes is the smallest. Therefore, the binary image includes a first type of point with a first attribute value of 1 and a second type of point with a first attribute value of 0. The edge of the object to be tested 100 has a second type of point.

[0085] It should be noted that setting the first attribute value of the candidate points of the edge contour to 0 will make the first attribute value of the first point at the edge of the test object 100 in the first target feature map to a minimum after the target feature map is weighted. This makes it easier to increase the probability of the second type of point being selected when the weighted map is extracted in the subsequent edge extraction by making the weight of the first target feature map greater than the weight of the second target feature map.

[0086] Therefore, by using a binary graph, it is easy to make the weight value of the first type of point in the weighted graph larger, which is beneficial to filtering out most of the first points that do not meet the requirements.

[0087] In this embodiment, the first target feature map is a binary map, and the first attribute value of the first point at the edge of the test object 100 in both the first target feature map and the second target feature map is a minimum value, so that the shortest path algorithm can be used for edge extraction in the future.

[0088] In this embodiment, a binary image is obtained based on the initial feature image. Obtaining the binary image includes: using the threshold condition of the first attribute value corresponding to the initial feature image as a standard, the initial feature image is binarized.

[0089] As an example, the initial feature map used to obtain the binary image is a gradient map, which includes the gray-level gradient values ​​of each first point. Accordingly, the gradient map is converted into a binary image by using the threshold condition of the gray-level gradient values ​​as a screening criterion.

[0090] In other embodiments, when the image to be tested is a color image and the edge contour of the object to be tested is a specific color (e.g., red), the initial feature map can be a color image. Accordingly, during binarization, whether the first point is related to the specific color is used as the filtering criterion. The first attribute value of the first point related to the specific color is set to 0, and the first attribute value of the other first points is set to 1.

[0091] Since the first attribute value of the first point at the edge of the object 100 in both the first target feature map and the second target feature map are extreme values, in this embodiment, the second target feature map is an inverse value amplitude map. The first attribute value of each first point in the inverse value amplitude map is negatively correlated with the gradient amplitude of the corresponding pixel in the image 200. The first target feature map is a binary map, which includes first-class points with first attribute values ​​of the first type of attribute value and second-class points with first attribute values ​​of the second type of attribute value. The object 100 has second-class points at its edge, and the second-class attribute value is less than the first-class attribute value.

[0092] In this process, since the gradient magnitude of the first point at the edge of the object 100 in the image 200 is usually large, an inverse magnitude map is obtained. This makes the first attribute value corresponding to the first point at the edge of the object 100 smaller in the inverse magnitude map, which in turn makes the weighted value corresponding to the first point at the edge smaller in the weighted map. Since the second attribute value is smaller than the first attribute value, the first attribute value of the first point at the edge of the object 100 in both the first target feature map and the second target feature map is minimized. This makes the second attribute value of the first point at the edge of the object 100 in the image to be analyzed have a minimum value, which is convenient for obtaining the first point of the edge contour of the object 100 based on the shortest path method.

[0093] Specifically, obtaining the target feature map from the image to be tested 200 includes: obtaining the gradient magnitude of each pixel in the image to be tested 200 to obtain a positive magnitude map; inverting the positive magnitude map to obtain an inverted magnitude map. The inversion process includes: subtracting the gradient magnitude of each first point in the positive magnitude map from a preset value to obtain the inverted magnitude value of each first point, thus obtaining an inverted magnitude map; the preset value is greater than or equal to the maximum value among the gradient magnitudes of each first point.

[0094] In this embodiment, taking the image to be tested, 200, as an 8-bit wide image (grayscale range from 0 to 255), as an example, the preset value is greater than or equal to 200. This preset value is close to the maximum grayscale value of the 8-bit wide image (i.e., grayscale value 255). By subtracting the gradient magnitude of each first point in the positive magnitude map from the preset value, a smaller inverse magnitude value can be obtained for the first point with a larger gradient magnitude.

[0095] In one specific embodiment, the preset value is equal to the maximum grayscale value of an 8-bit wide image, that is, the preset value is equal to 255.

[0096] It should be noted that in other embodiments, depending on the actual situation, the preset value may be less than the maximum value, or the preset value may be zero.

[0097] Based on the above mechanism, in other embodiments, it can also be: the second target feature map is a positive amplitude map, and the first attribute value of each first point in the positive amplitude map is positively correlated with the gradient amplitude of the corresponding first point in the image to be tested; the first target feature map is a binary map, which includes first-class points with first attribute values ​​of first-class attribute values ​​and second-class points with first attribute values ​​of second-class attribute values, and the edge of the object to be tested has second-class points, and the second-class attribute values ​​are greater than the first-class attribute values.

[0098] Reference Figure 5In this embodiment, before obtaining multiple target feature maps based on the image to be tested 200, obtaining the image to be analyzed 300 further includes: performing step S11 to rotate the image to be tested 200 so that the edge contour image of the object to be tested 100 extends along a preset direction range.

[0099] The edge contour image of the test object 100 extends along a preset direction range, making the grayscale of the pattern on both sides of the edge of the test object 100 more uniform and reducing the probability of noise in too many directions.

[0100] In addition, when performing edge extraction on the image 300 to be analyzed, the start row and end row are usually determined first. The direction from the start row to the end row is taken as the reference direction. Then the image 200 to be analyzed is rotated so that the same reference direction can be used for edge extraction in the future.

[0101] It should be noted that when the first target feature map includes a gradient angle map, by extending the edge contour image of the object to be tested 100 along a preset direction range, it is also convenient to use the same standard for screening.

[0102] In this embodiment, the image to be tested 200 includes multiple image edges, and among the multiple image edges, there is only one background image edge (not shown), and the background image edge is completely covered by the background image; rotating the image to be tested 200 so that the edge contour image of the object to be tested 100 extends along a preset direction range includes: acquiring the background image edge; rotating the background image edge so that the background image edge faces the preset direction.

[0103] like Figure 5 As shown, Figure 5 (a) is Figure 4 (a) Schematic diagram after rotation Figure 5 (b) is Figure 4 (b) Schematic diagram after rotation. Figure 5 (c) is Figure 4 (c) Schematic diagram after rotation: The image 200 to be tested is rotated so that the edge contour image of the object to be tested 100 is extended in the vertical direction.

[0104] By aligning the edges of the background image with a preset direction, the area of ​​the object under test 100 in the image under test 200 is located on a fixed side, thereby making the image of the object under test 100 in the area of ​​the image under test 200 more uniform, so as to reduce the influence of the inconsistency of the area position on the first attribute values ​​in the target feature map.

[0105] For example, in this embodiment, after rotation processing, the edge contour image of the object to be tested 100 is extended along the vertical direction, so that the edge of the background image faces to the left in the X direction, and the pattern area of ​​the object to be tested 100 in the image to be tested 200 is located to the right in the X direction of the image to be tested 200.

[0106] In other embodiments, after rotating the image to be tested, the edge contour image of the object to be tested is extended along the vertical direction, and the edge of the background image faces to the right in the X direction. In other embodiments, after rotating the image to be tested, the edge contour image of the object to be tested is extended along the horizontal direction, and the edge of the background image faces to the upper or lower side in the Y direction.

[0107] Specifically, obtaining the background image edge includes: obtaining the grayscale statistical values ​​of each image edge of the test image 200, wherein the grayscale statistical values ​​of the image edge include: the average grayscale value of each pixel on the image edge, or the sum of the average grayscale value of each pixel on the image edge and the first maximum value; obtaining the image edge with the second maximum value of the grayscale statistical value to obtain the background image edge; wherein, when the test image 200 is a dark field image, the first maximum value is the maximum value and the second maximum value is the minimum value; when the test image 200 is a bright field image, the first maximum value is the minimum value and the second maximum value is the maximum value.

[0108] The background image is usually located in the edge region of the image under test 200. Therefore, it is necessary to calculate the grayscale statistics of the first point in the preset width region of the outermost edge.

[0109] When the image under test is a dark field image, the background image is very dark. Therefore, the position corresponding to the minimum value in the grayscale statistics is selected as the position of the background image.

[0110] The grayscale statistics include the average grayscale value of the first point, which improves the robustness of the statistical method. For example, it reduces the impact of noise in a single pixel on the accuracy of the grayscale statistics, thereby improving the accuracy of the grayscale statistics.

[0111] Furthermore, when the image under test 200 is a dark field image, when the gray-scale statistics include the sum of the average gray-scale value and the first maximum value of each first point on the image edge, the first maximum value is the maximum value, that is, the maximum gray-scale value is included. In other words, for each image edge, the gray-scale value of the brightest first point is included. If the gray-scale statistics of a certain image edge is still the minimum, it means that the image edge is darker than the other image edges, which helps to improve the accuracy of determining the location of the background image.

[0112] Similarly, in other embodiments, when the image to be tested is a bright field image, the background image is very bright. Therefore, the position corresponding to the maximum value in the grayscale statistics is selected as the background image position. Specifically, when the grayscale statistics include the sum of the average grayscale value and the first maximum value of each first point on the image edge, the first maximum value is the minimum value. Including the minimum grayscale value in the statistics, if the grayscale statistics of a certain image edge are still the maximum, it indicates that the image edge is brighter than the other image edges, which helps improve the accuracy of determining the background image position.

[0113] It should be noted that the preset width of the image edge should not be too small or too large. If the preset width of the image edge is too small, the grayscale statistical values ​​are more susceptible to noise, which is detrimental to improving the accuracy of the grayscale statistical values. If the preset width of the image edge is too large, it is easy to include the pixels of the pattern of the object under test 100 in the statistics, which can easily reduce the accuracy of the grayscale statistical values. Therefore, in this embodiment, the preset width of the image edge is the sum of the widths of 5 to 10 pixels.

[0114] Continue to refer to Figure 3 After obtaining the binary image, before weighting the target feature map, the process further includes: executing step S14 to perform dilation processing on the binary image. The dilation processing includes: traversing all second-class points, and when there is a first-class point among the first points adjacent to the second-class point along the dilation direction, setting the first attribute value of the second-class point to the first-class attribute value. The angle between the dilation direction and the extension direction of the edge contour is less than 20°.

[0115] By performing dilation processing, it is beneficial to improve the accuracy of dividing the first point and the remaining first point at the edge of the object under test 100, reduce the interference of the internal pattern of the object under test 100, and thus reduce the probability of selecting the first point inside the object under test 100 according to the weight when the edge contour is subsequently based on the shortest path algorithm.

[0116] Furthermore, since the image processing method is used to extract the edge contour of the object to be tested 100, and the edge contour of the object to be tested 100 extends in the image to be tested 200 along a preset direction range, the dilation processing within the range of the edge contour extension direction is more important for reducing interference. Therefore, the angle between the dilation direction and the extension direction of the edge contour is less than 20°.

[0117] Specifically, the expansion direction of each second type of point is the same; the expansion direction of the second type of point can be parallel to the tangent direction at any position of the edge contour, or the expansion direction of the second type of point can be parallel to the tangent direction of the edge contour at the position of the second type of point.

[0118] In this embodiment, the convolution kernel used for dilation processing is rectangular in shape and has a size of m1*m2. That is, any vertex of the rectangle is taken as the origin, and two sides that pass through the origin and are perpendicular to each other are the first side and the second side, respectively. The lengths of the first side and the second side are m1 pixels and m2 pixels, respectively.

[0119] Correspondingly, taking any vertex of the rectangle as the origin, the vector corresponding to the first side is the first vector, the size of the first vector is m1 pixels, and the direction of the first vector is parallel to the first side. The vector corresponding to the second side is the second vector, the size of the second vector is m2 pixels, and the direction of the second vector is parallel to the second side. The expansion direction is the direction of the vector sum of the first vector and the second vector.

[0120] In one specific embodiment, the value of m1 can be 11, and the value of m2 can be 7.

[0121] It should be noted that for the first point at the true edge, the probability of having a first-class point around it is low. Therefore, even if dilation is performed, the impact on the first point at the edge is small.

[0122] It should also be noted that in other embodiments, depending on the characteristics of the image to be tested, a binary image may not be used, but other types of target feature maps may be weighted instead.

[0123] For example, if the edge contour of the image to be tested is brighter, while the first point at other locations is darker, the target feature map can be a grayscale image of the image to be tested. Accordingly, the grayscale image is then weighted only to give the brighter first point a smaller or larger weight value, so that the edge points at the edge of the object to be tested are more prominent in the weighted image.

[0124] Alternatively, the target feature map can be the gradient angle map of the image to be tested. Subsequently, only the gradient angle map is weighted to give the first point that meets the angle requirements corresponding to the edge a smaller or larger weight value, so that the edge points at the edge of the object to be tested are more prominent in the weighted map.

[0125] Alternatively, the target feature map can be the gradient magnitude map of the image to be tested. Subsequently, only the gradient magnitude map is weighted to give the first point that meets the gradient magnitude requirement corresponding to the edge a smaller or larger weight value, so that the edge points at the edge of the object to be tested are more prominent in the weighted map.

[0126] Alternatively, when the image to be tested is a color image, the target feature map can also be a color image of the image to be tested, thereby assigning different weight values ​​to the first point of different colors, and giving the first point that meets the color requirements of the edge contour a smaller or larger weight value, so that the edge points at the edge of the object to be tested are more prominent in the weighted map.

[0127] refer to Figure 1 Step S15 is executed to weight the target feature map to obtain the weighted value of all first attribute values ​​of each first point, so as to obtain a weighted map that represents the correspondence between the pixel position and the weighted value of the image 200 to be tested. The weighting is used to make the gradient magnitude of the weighted value of the first point at the edge of the object to be tested in the first gradient direction greater than the gradient magnitude of the weighted value of the first point adjacent to the first point at the edge in the first gradient direction. The first gradient direction is perpendicular to the extension direction of the edge of the object to be tested 100.

[0128] The weighted image is used as the image to be analyzed (300). Subsequently, edge extraction is performed on the weighted image to obtain the edge contour of the object to be tested (100).

[0129] The method of weighting the target feature map is adopted to comprehensively consider multiple features, which helps to reduce noise. When extracting edges from the weighted map, the various features corresponding to the edges can be considered at the same time, which is conducive to accurately extracting the edge contour of the object to be measured.

[0130] Specifically, by weighting the target feature map, it is beneficial to reduce noise (for example, it helps to reduce the probability of misjudging the pattern, background pattern or other noise pattern inside the test object 100 as the edge of the test object), and it is also beneficial to consider the various features corresponding to the edge while extracting the edge from the weighted map. At the same time, since the gradient magnitude of the weighted value of the first point at the edge of the test object 100 is greater than the gradient magnitude of the weighted value of the first point adjacent to the first point at the edge, the edge points of the test object are more prominent, which is beneficial to accurately extracting the edge contour of the test object.

[0131] In this embodiment, the image to be analyzed includes the correspondence between each second point and the second attribute value of the image to be analyzed. In the image to be analyzed, the second attribute value of the second point at the edge of the object to be analyzed has a minimum or maximum value. Thus, when the weighted image is subsequently extracted, the edge contour of the object to be analyzed can be obtained by extracting the path with the weighted value and the value of the third maximum value.

[0132] It should be noted that for any target feature map, the position of the first point in the target feature map has a one-to-one correspondence with the position of the second point in the image to be analyzed.

[0133] In this embodiment, weighting the target feature map includes: weighting the first target feature map and the second target feature map, and the weighting is used to make the gradient magnitude of the weighted value at the edge of the object to be tested 100 in the weighted map greater than the gradient magnitude of the first attribute value of the pixel at the edge of the object to be tested in the first target feature map.

[0134] Weighting is used to make the gradient magnitude of the weighted value at the edge of the test object 100 in the weighted image greater than the gradient magnitude of the first attribute value of the pixel at the edge of the test object in the first target feature image, thereby enhancing the prominence of the edge of the test object 100 in the weighted image, which facilitates subsequent edge extraction of the weighted image.

[0135] In one specific embodiment, the first attribute values ​​of the edge pixels of the test object 100 in both the first target feature map and the second target feature map are both minimum values, and the first target feature map is a binary map. Therefore, in the process of weighting the target feature maps, the weight of the first target feature map is greater than the weight of the second target feature map.

[0136] Specifically, when weighting the first target feature map and the second target feature map, the weighting is performed on the first target feature map and the binary map after dilation.

[0137] Since the binary image includes first-class points with first-class attribute values ​​and second-class points with second-class attribute values, the first-class attribute value is 1 and the second-class attribute value is 0. Since there are second-class points at the edge of the test object 100, the first target feature map is given a greater weight. The first attribute value of the first-class points contributes more to the weighted value, while the first attribute value of the second-class points contributes 0 to the weighted value. This makes the edge points of the test object 100 more prominent in the weighted image.

[0138] As an example, the weights of the first target feature map are 180 to 245, and the weights of the second target feature map are 0.1 to 0.3.

[0139] The weight of the first target feature map is much greater than the weight of the second target feature map, thus increasing the impact of the binary map filtering and thereby filtering out most of the first points.

[0140] Specifically, when the first attribute value of the first point in the second target feature map is small, and the first attribute value of the first point in the binary map is 0, then the weight value corresponding to the first point in the weighted map is small, and the first point is more likely to be the first point at the edge; when the first attribute value of the first point in the second target feature map is large, and the first attribute value of the first point in the binary map is 1, then the weight value corresponding to the first point in the weighted map is large; when the first attribute value of the first point in the second target feature map is small, and the first attribute value of the first point in the binary map is 0, the weight corresponding to the first point in the weighted map is large; when the first attribute value of the first point in the second target feature map is small, and the first attribute value of the first point in the binary map is 1, the weight value corresponding to the first point in the weighted map is large.

[0141] It should be noted that in other embodiments, the weight of the first target feature map can be changed, and the weight of the second target feature map can be changed proportionally.

[0142] As an example, weighting the first target feature map and the second target feature map includes: calculating the weighted value of each first point using the formula w(x,y)=w1*(255-mag(x,y))+w2*binary_orient(x,y), where w(x,y) is the weighted value corresponding to any pixel, 255-mag(x,y) is the first attribute value corresponding to the pixel in the inverse magnitude map, mag(x,y) is the gradient magnitude corresponding to the pixel in the gradient magnitude map, binary_orient(x,y) is the first attribute value corresponding to the pixel in the binary map, w1 is 0.1 to 0.3, and w2 is 180 to 245.

[0143] Therefore, in this embodiment, the weighted value of the first point at the edge of the object to be tested 100 has a minimum value.

[0144] In other embodiments, depending on the weighting method and / or the type of target feature map selected, the weighting value of the first point at the edge of the object to be measured may also have a maximum value.

[0145] refer to Figure 1 Step S2 is executed to extract the edge of the image 300 to be analyzed, and obtain the edge contour of the object 100 to be tested.

[0146] Specifically, edge extraction of the image 300 to be analyzed includes: determining a start row and an end row in the image 300 to be analyzed, with the direction from the start row to the end row as the reference direction; along the reference direction, obtaining a second point as a target point in each row from the start row to the end row, the sum of the second attribute values ​​of the target points having a third maximum value, and the target points constituting edge points at the edge of the object to be analyzed; wherein, when the second attribute value of the second point at the edge of the object to be analyzed has a minimum value in the image to be analyzed, the third maximum value is the minimum value; when the second attribute value of the second point at the edge of the object to be analyzed has a maximum value in the image to be analyzed, the third maximum value is the maximum value.

[0147] Since the second attribute value of the second point at the edge of the object 100 in the image 300 to be analyzed has a minimum or maximum value, the edge point of the edge contour of the object 100 can be extracted by obtaining a continuous path from the start row to the end row along the reference direction, and the sum of the second attribute values ​​of the second points passed through by the continuous path has a third maximum value.

[0148] It should be noted that, before determining the start and end rows in the image 300 to be analyzed, edge extraction of the image 300 may further include: obtaining the region to be extracted in the image 300, the region to be extracted comprising multiple rows of pixels, each row comprising multiple second points. By obtaining the region to be extracted, the area where edge extraction needs to be performed is determined, thereby improving the speed of edge extraction.

[0149] In this embodiment, the region to be extracted is the entire image to be analyzed. In other embodiments, depending on the actual situation, the region to be extracted may also be a local area of ​​the image to be analyzed.

[0150] It should also be noted that, in this embodiment, based on the extension direction of the edge contour of the object to be tested 100, the area to be extracted includes multiple rows of pixels, where the row direction is the X direction (e.g., ...). Figure 5 As shown), the arrangement direction of the multiple rows of pixels is the Y direction (e.g., Figure 5 (As shown). In other embodiments, the row direction can also be the Y direction.

[0151] Furthermore, the edge contours of the object under test 100 are obtained and used to subsequently determine the center of the object under test 100 using multiple edge contours obtained by edge extraction. Accordingly, edge extraction is performed on each image to be analyzed to obtain multiple edge contours.

[0152] In this embodiment, obtaining a second point as a target point in each row from the starting row to the ending row includes: using the second attribute value of each second point in the starting row as the accumulated value of the corresponding second point; sequentially traversing each row from the second row to the ending row, and performing pathfinding processing on the current row to obtain the position pointer table and the accumulated value of each second point in the ending row. The pathfinding processing includes: repeatedly obtaining the accumulated relationship of each second point in the current row, wherein the accumulated relationship obtaining processing includes: obtaining each second point within the search range of the previous row of the current second point as candidate points, the search range covering multiple candidate points in the previous row that are closest to the current second point; obtaining the relationship between each candidate point and the current second point. The second attribute value and the third maximum value of two points are used to obtain the cumulative maximum value; the cumulative maximum value is used as the cumulative value of the current second point, and the positional relationship between the candidate point corresponding to the cumulative maximum value and the current second point is recorded as the position pointer of the current second point; the cumulative relationship acquisition process is repeated for all second points in the current row to obtain the cumulative value and positional relationship of each second point, and the correspondence between each second point and the positional relationship forms a position pointer table; the second point in the ending row with the third maximum value of the cumulative value is obtained as the ending position; the target point is obtained according to the position pointer table and the ending position, and the target point passes through the ending position and the sum of the second attribute values ​​of the target point is equal to the cumulative value of the ending position.

[0153] In this embodiment, the second attribute value of the second point at the edge of the object to be analyzed in the image has a minimum value, therefore, the third maximum value is the minimum value.

[0154] In other embodiments, if the second attribute value of the second point at the edge of the object to be analyzed has a maximum value, the third maximum value is also the maximum value.

[0155] The starting and ending rows are determined in the image to be analyzed, thereby determining the direction of the pathfinding process.

[0156] By determining the starting row, the second attribute value of each second point in the starting row is used as the cumulative value of the corresponding second point, thus preparing for subsequent updates of the cumulative value.

[0157] As an example, the shortest path algorithm is used for edge extraction, including Dijkstra's algorithm. Based on Dijkstra's algorithm, a unique edge represented by a single pixel can be obtained. Furthermore, Dijkstra's algorithm can obtain a globally optimal solution, which is less affected by local noise, thereby improving the accuracy of edge contour extraction.

[0158] In this embodiment, during the process of repeatedly accumulating the relationship of each second point in the current row, the search range of the i-th current second point covers the candidate points including the i-2 to i+2 second points in the previous row, where i represents the position of the current second point in the arrangement direction, which is perpendicular to the reference direction.

[0159] For any given second point, its search range not only includes one second point belonging to its four-neighborhood and two second points belonging to its diagonal neighborhood, but also one second point adjacent to each of the second points in its diagonal neighborhood, thus covering a total of five second points. This increases the search range and is beneficial for obtaining the path with the weighted sum of values ​​as the third maximum. Furthermore, for any given second point, the candidate points covered by its search range are located in adjacent pixel rows along the reference direction, and the number of candidate points is five. Therefore, the number of candidate points covered by the search range of any given second point will not be excessive, thereby improving computational efficiency.

[0160] The following combination Figure 6 The steps for obtaining a continuous path are explained in detail. Figure 6 (a) is a schematic diagram of an embodiment of the image to be analyzed. Figure 6 (b) is a schematic diagram illustrating an embodiment of the process for obtaining and processing the cumulative relationship. Figure 6 (c) shows a schematic diagram of an embodiment of a position pointer table. Figure 6 (d) is a schematic diagram of an embodiment of obtaining the edge based on the position pointer table and the end position.

[0161] It should be noted that in this embodiment, the image to be analyzed, 300, is the weighted image.

[0162] like Figure 6 As shown in (a), the second attribute values ​​of each second point in the starting row are 24, 35, 255, 255 and 230 respectively. Then, the second attribute values ​​of each second point in the starting row are used as the cumulative values ​​of the corresponding second points.

[0163] In the process of obtaining the continuous path from the starting line to the ending line, each line from the second line to the ending line is traversed in turn, and the path finding process is performed on the current line. The path finding process includes: obtaining the repeated accumulation relationship of each second point in the current line. Therefore, the second line is used as the current line for the first path finding process.

[0164] like Figure 6 (b) and Figure 6As shown in (c), the search range of the i-th current second point covers the candidate points from the (i-2)th to the (i+2)th second point in the previous row. Taking the second second point in the current row as an example, the second attribute value of the current second point is 12. The second attribute values ​​of the candidate points of the current second point are 24, 35, 255, and 255, respectively. Therefore, the sum of the second attribute values ​​of each candidate point and the current second point are 36, 47, 267, and 267, respectively. The maximum and minimum sum value is 36, and this maximum and minimum sum value of 36 is used as the sum value of the current second point. Similarly, taking the current row... When the third second point in the current row is used as the current second point, the second attribute value of the current second point is 26. The second attribute values ​​of the candidate points of the current second point are 24, 35, 255, 255 and 230 respectively. Therefore, the sum of the second attribute values ​​of each candidate point and the current second point are 50, 61, 281, 281 and 256 respectively, resulting in a maximum value of 50. This maximum value of 50 is used as the sum of the maximum value of the current second point. When the fourth second point in the current row is used as the current second point, the first attribute value of the current second point is 255. The second attribute values ​​of the candidate points of the current second point are 35, 255, 255 and 230 respectively. Therefore, the sum of the second attribute values ​​of each candidate point and the current second point are 290, 510, 510 and 485 respectively, resulting in a maximum value of 290.

[0165] Similarly, each row from the second row to the end row is traversed sequentially. Path finding is performed on the current row. During the path finding process, the cumulative relationship of each second point in the current row is repeatedly obtained and processed. The positional relationship between the candidate point corresponding to the maximum and minimum cumulative value and the current second point is recorded as the position pointer of the current second point. This continues until the second point in the end row with the third maximum or minimum cumulative value is obtained as the end position. Then, the target point is obtained according to the position pointer table and the end position. The target point passes through the end position and the sum of the second attribute values ​​of the target point is equal to the cumulative value of the end position.

[0166] Here, the search range of the i-th current second point includes the candidate points from the (i-2)-th to the (i+2)-th second points in the previous row, where i represents the position of the current second point in the arrangement direction. Therefore... Figure 6 The numbers in (c) represent the relative positional relationship between the candidate point corresponding to the cumulative maximum and minimum values ​​and the current second point. The numbers 0, 1 and 2 all represent the relative positional deviation.

[0167] Continue to refer to Figure 1 The image processing method further includes: performing step S3 to determine the center of the object to be measured 100 using multiple edge contours obtained by edge extraction.

[0168] Determine the center of the test object 100 in order to accurately control its position in the device.

[0169] Specifically, determining the center of the object under test 100 using multiple edge contours obtained by edge extraction includes: obtaining the coordinates of multiple pixels of the edge contours based on the coordinate information of the pixels of the image under test 200; and fitting the coordinates of the multiple pixels of the edge contours to obtain the center coordinates of the object under test 100.

[0170] Specifically, obtaining the coordinates of the pixels of the edge contour includes: obtaining the first coordinates of each pixel corresponding to the edge contour in the image coordinate system; converting the first coordinates into second coordinates in the motion platform coordinate system, and using the second coordinates as the coordinates of the pixels of the edge contour. Accordingly, based on the second coordinates, the center coordinates of the object under test 100 are fitted.

[0171] The position of the first point in the target feature map corresponds one-to-one with the position of the pixel in the image to be tested. Therefore, after obtaining the edge points of the edge contour, the coordinates of the pixel points of the edge contour can be obtained.

[0172] After acquiring the test image 200 of the test object 100 at edge position 100L, the coordinates of each pixel in the test image 200 at edge position 100L in the motion platform coordinate system are known. The coordinates in the image coordinate system and the coordinates in the motion platform coordinate system have a corresponding relationship. Therefore, the first coordinates of each pixel corresponding to the edge contour in the image coordinate system can be transformed into second coordinates in the motion platform coordinate system. Here, the test object 100 is located on a motion platform, and the motion platform coordinate system is the world coordinate system of the test object 100, which can represent the true position of the test object 100. Therefore, it is necessary to transform the first coordinates into the second coordinates.

[0173] In this embodiment, the shape of the object to be tested 100 is circular. Then, the second coordinates of all pixels are substituted into the general equation of a circle: x^2+y^2+a1*x+a2*y+a3=0. The values ​​of a1, a2 and a3 are solved by solving the least squares matrix, thereby fitting the center coordinates of the object to be tested.

[0174] It should be noted that the general equation of a circle can be used to obtain not only the coordinates of the center but also the radius. Therefore, the radius obtained by the general equation of a circle can be compared with the preset radius R of the object to be measured 100, thereby evaluating the accuracy of edge extraction.

[0175] Specifically, the general equation of a circle can be transformed into the standard equation of a circle, namely (X+a1 / 2)^2+(Y+a2 / 2)^2=(a1^2+a2^2-4*a3) / 4. Thus, after the values ​​of a1, a2, and a3, the corresponding coordinates of the center of the circle and the radius of the circle can be obtained.

[0176] Accordingly, embodiments of the present invention also provide an image processing system. (See reference) Figure 7 The diagram illustrates a functional block diagram of an embodiment of the image processing system of the present invention. The following is in conjunction with reference to... Figures 2 to 6 The image processing system of this embodiment will be described below.

[0177] The image processing system described in this embodiment is used in the image processing method of the foregoing embodiments. The image processing system includes: an image acquisition module 10, used to acquire an image 300 to be analyzed (e.g., ...). Figure 6 As shown, the image to be analyzed contains the edge contour of the object to be tested 100; the edge extraction module 20 is used to extract the edge of the image to obtain the edge contour of the object to be tested 100.

[0178] In this embodiment, in the image to be analyzed, the second attribute value of the second point at the edge of the object to be analyzed 100 has a minimum or maximum value, which makes the second point at the edge of the object to be analyzed 100 more prominent. Thus, when the image to be analyzed 300 is subsequently subjected to edge extraction, the edge contour of the object to be analyzed 100 can be obtained by extracting the second attribute value and the path with the extreme value of the image to be analyzed.

[0179] For a detailed description of the test object 100, please refer to the corresponding description in the foregoing embodiments, which will not be repeated here.

[0180] As an example, the image 300 to be analyzed is a weighted image. The weighted image is obtained by weighting the various target feature maps corresponding to the image of the object to be tested 100. This allows for a comprehensive consideration of the various features corresponding to the first point at the edge of the object to be tested 100, which in turn helps to further improve the accuracy of extracting the edge contour of the object to be tested.

[0181] In one specific embodiment, the image processing method is used to determine the center of the object under test 100 using its edge contour, thereby ensuring the positioning accuracy of the object under test 100 in the device. For example, in semiconductor manufacturing and metrology, determining the wafer center is a crucial step for accurately aligning various parts of the wafer, thereby ensuring that when the position of the pattern under test is further determined based on the known relative position vector relationship between the wafer center and the pattern under test, the positioning accuracy is controlled within a certain range.

[0182] In this embodiment, the image acquisition module 10 uses a detection system to acquire the image to be analyzed.

[0183] The detection system includes an image acquisition module and a motion platform. The motion platform supports the object under test 100 and enables relative movement between the image acquisition module and the object under test 100. Accordingly, after acquiring the image 200 of the object under test 100 at edge position 100L, the coordinates of each pixel of the image 200 at edge position 100L in the coordinate system of the motion platform can be obtained.

[0184] The following combination Figures 3 to 5 The image acquisition module 10 is described in detail below.

[0185] Reference Figures 3 to 5 ,as well as Figure 8 , Figure 8 This is a functional block diagram of an embodiment of the image acquisition module 10. The image acquisition module 10 includes: a test image acquisition unit 10, used to acquire a test image 200 of the test object 100 at the edge position 100L. The test image 200 contains an image of the edge contour of the test object 100, and the edge contour of the test object 100 extends in the test image 200 along a preset direction range.

[0186] In this embodiment, the number of edge positions 100L is greater than or equal to 3.

[0187] As an example, the image under test 200 is rectangular in shape and is a dark field image. In other embodiments, the image under test may also be a bright field image.

[0188] Specifically, the detection system is used to acquire the image 200 of the object to be tested 100 at the edge position.

[0189] In this embodiment, the image acquisition module 10 further includes an initial feature map acquisition unit 12, which is used to acquire an initial feature map based on the image to be tested 200 before acquiring the target feature map of the image to be tested 200. The initial feature map includes at least one of the gradient map, gradient magnitude map, grayscale map, color map and the image to be tested of the image to be tested 200. The gradient map includes the grayscale gradient value of each first point.

[0190] Subsequently, at least one of the above initial feature maps is used for binarization to obtain the corresponding binary map. When performing binarization, the threshold condition of the first attribute value corresponding to the selected initial feature map is used as the standard.

[0191] Specifically, an initial feature map can be selected based on the actual characteristics of the object to be tested 100 (e.g., pattern or color) to make the first point at the edge of the object to be tested 100 more prominent.

[0192] In one specific embodiment, the initial feature map includes a gradient map. Accordingly, the gradient map is subsequently binarized.

[0193] Since the grayscale gradient value of the first point at the edge of the object to be tested 100 is usually large, obtaining a binary image based on the gradient map is also helpful in distinguishing the first point at the edge of the object to be tested 100 from the first point adjacent to it, and makes the first point at the edge of the object to be tested 100 more prominent.

[0194] In this embodiment, the Sobel operator is used to calculate the pixel gradient of the image under test 200 to obtain the grayscale gradient value. Furthermore, the Sobel operator can also be used to obtain the gradient magnitude map and gradient angle map of the image under test 200.

[0195] In this embodiment, the size of the Sobel operator's convolution kernel in the X direction and the convolution kernel in the Y direction are both n*n, where n is an integer from 7 to 9.

[0196] In the image 200 to be tested, for any pixel, the gray-level gradient value in the X direction is G. x The gray-level gradient value in the Y direction is G. y The gradient magnitude of the pixel is The gradient angle value of a pixel is arctan(G). x / G y ), where the X direction is orthogonal to the Y direction.

[0197] As an example, the gradient angle is defined as ranging from -180° to 180°. In other embodiments, other definitions may be used, such as defining it as ranging from 0° to 360°.

[0198] It should be noted that in other embodiments, binary images can also be obtained based on other types of initial feature maps. For example, in another embodiment, when the image to be tested is a color image and the edge contour of the object to be tested is a specific color (e.g., red), the initial feature map can be a color image. Accordingly, during subsequent binarization, whether the first point is related to the specific color is used as the filtering criterion. In other embodiments, when the edge contour of the object to be tested has a specific grayscale value, the initial feature map can be the original image (i.e., the image to be tested 200 itself). Accordingly, the image to be tested is subsequently binarized using a grayscale threshold to obtain the binary image of the image to be tested.

[0199] The image acquisition module 10 further includes a target feature map acquisition unit 13, which is used to acquire multiple target feature maps based on the image to be tested 200. Each target feature map includes the correspondence between the position of each first point and the first attribute value, and the position of the first point of the target feature map corresponds one-to-one with the position of the pixel point of the image to be tested. The types of first attribute values ​​of the multiple target feature maps are different, and the first attribute value characterizes the attribute of the target feature map.

[0200] The target feature map is then weighted to obtain the weighted value of all first attribute values ​​for each first point, thus obtaining a weighted map related to the position of the first point in the image under test, so that edge extraction can be performed on the weighted map in the future.

[0201] In this embodiment, multiple types of target feature maps are used. By selecting multiple target feature maps, the weighting term is increased, allowing more types of features to be considered, which in turn helps to improve the accuracy of subsequent edge extraction.

[0202] In this embodiment, the first attribute values ​​of the various target feature maps include any combination of gradient magnitude, gradient angle, pixel grayscale value, binarization value, and color representation value.

[0203] Based on the actual characteristics (e.g., pattern or color) of the object to be tested 100, a suitable target feature map is selected so that, after weighting, the edge points at the edges of the object to be tested 100 are more prominent.

[0204] The target feature map includes any combination of gradient magnitude maps, gradient angle maps, gradient difference maps, grayscale maps, binary maps, and color maps. The gradient difference map includes the absolute value of the grayscale gradient difference between each of the first points along a first gradient direction and a second gradient direction. The first gradient direction and the second gradient direction are different. In this embodiment, the first gradient direction is perpendicular to the extension direction of the edge of the object under test 100.

[0205] Specifically, the absolute value of the gray-level gradient difference between the first gradient direction and the second gradient direction refers to the absolute value of the difference between the gray-level gradient value in the first gradient direction and the gray-level gradient value in the second gradient direction.

[0206] In this embodiment, the target feature map includes a first target feature map and a second target feature map, and the first attribute value of the first point at the edge of the test object 100 in both the first and second target feature maps is either a maximum value or a minimum value. The fact that the first attribute value of the first point at the edge of the test object 100 in both the first and second target feature maps has extreme values ​​makes the first point at the edge more prominent.

[0207] Specifically, the first target feature map includes one or both of the gradient angle map and the binary map, the second target feature map is the gradient magnitude map or the image to be tested 200 itself, the gradient angle map includes the gradient angle value of the gray-level gradient of each first point, and the gradient angle value at the edge of the object to be tested 100 has a maximum or minimum value, and the gradient magnitude map includes the gradient magnitude of the gray-level gradient of each first point.

[0208] As an example, the second target feature map is a gradient magnitude map.

[0209] In this embodiment, taking the target feature map including a binary map as an example, the binary map includes a first type of point with a first attribute value of a first type of attribute value and a second type of point with a first attribute value of a second type of attribute value, and the edge of the object to be tested 100 has a second type of point.

[0210] In one specific embodiment, the weighted image is then subjected to edge extraction to obtain the edge contour of the object to be tested 100. The weighted value of the first point through which the edge contour passes is the smallest. Therefore, the binary image includes a first type of point with a first attribute value of 1 and a second type of point with a first attribute value of 0. The edge of the object to be tested 100 has a second type of point.

[0211] In this embodiment, the first target feature map is a binary map, and the first attribute value of the first point at the edge of the test object 100 in both the first target feature map and the second target feature map is a minimum value, so that the shortest path algorithm can be used for edge extraction in the future.

[0212] In this embodiment, the target feature map acquisition unit 13 acquires a binary map based on the initial feature map, wherein the threshold condition of the first attribute value corresponding to the initial feature map is used as the standard to perform binarization processing on the initial feature map.

[0213] As an example, the initial feature map used to obtain the binary image is a gradient map, which includes the gray-level gradient values ​​of each first point. Accordingly, the gradient map is converted into a binary image by using the threshold condition of the gray-level gradient values ​​as a screening criterion.

[0214] In other embodiments, when the image to be tested is a color image and the edge contour of the object to be tested is a specific color (e.g., red), the initial feature map can be a color image. Accordingly, during binarization, whether the first point is related to the specific color is used as the filtering criterion. The first attribute value of the first point related to the specific color is set to 0, and the first attribute value of the other first points is set to 1.

[0215] Since the first attribute value of the first point at the edge of the object 100 in both the first target feature map and the second target feature map are extreme values, in this embodiment, the second target feature map is an inverse value amplitude map. The first attribute value of each first point in the inverse value amplitude map is negatively correlated with the gradient amplitude of the corresponding pixel in the image 200. The first target feature map is a binary map, which includes first-class points with first attribute values ​​of the first type of attribute value and second-class points with first attribute values ​​of the second type of attribute value. The object 100 has second-class points at its edge, and the second-class attribute value is less than the first-class attribute value.

[0216] Specifically, the target feature map acquisition unit 13 includes: a positive amplitude map acquisition subunit (not shown), used to acquire the gradient amplitude of each pixel in the 200 pixels of the image to be tested, to obtain a positive amplitude map; and an inversion processing subunit (not shown), used to invert the positive amplitude map to obtain an inverted amplitude map. The inversion processing includes: subtracting the gradient amplitude of each first point in the positive amplitude map from a preset value to obtain the inverted amplitude value of each first point, to obtain the inverted amplitude map; the preset value is greater than or equal to the maximum value among the gradient amplitudes of each first point.

[0217] In this embodiment, taking the image to be tested, 200, as an 8-bit wide image (grayscale range from 0 to 255), the preset value is greater than or equal to 200. In a specific embodiment, the preset value is equal to 255.

[0218] In other embodiments, the preset value may be less than the maximum value, or the preset value may be zero.

[0219] In other embodiments, the second target feature map may be a positive amplitude map, wherein the first attribute value of each first point in the positive amplitude map is positively correlated with the gradient amplitude of the corresponding first point in the image to be tested; the first target feature map is a binary map, which includes first-class points whose first attribute value is a first-class attribute value and second-class points whose first attribute value is a second-class attribute value, and second-class points are present at the edge of the object to be tested, wherein the second-class attribute value is greater than the first-class attribute value.

[0220] The image acquisition module 10 further includes a rotation processing unit 11, which is used to rotate the image 200 to be tested before acquiring various target feature maps based on the image 200 to be tested, so that the edge contour image of the object to be tested 100 extends along a preset direction range.

[0221] like Figure 5 As shown, Figure 5 (a) is Figure 4 (a) Schematic diagram after rotation Figure 5 (b) is Figure 4 (b) Schematic diagram after rotation. Figure 5 (c) is Figure 4 (c) Schematic diagram after rotation: The image 200 to be tested is rotated so that the edge contour image of the object to be tested 100 is extended in the vertical direction.

[0222] In this embodiment, the image to be tested 200 includes multiple image edges, and among the multiple image edges, there is only one background image edge (not shown), and the background image edge is completely covered by the background image; the rotation processing unit 11 includes: an edge acquisition subunit (not shown) for acquiring the background image edge; and a rotation subunit (not shown) for rotating the background image edge so that the background image edge faces a preset direction.

[0223] By aligning the edges of the background image with a preset direction, the area of ​​the object under test 100 in the image under test 200 is located on a fixed side, thereby making the image of the object under test 100 in the area of ​​the image under test 200 more uniform, so as to reduce the influence of the inconsistency of the area position on the first attribute values ​​in the target feature map.

[0224] Specifically, the edge acquisition subunit is used to acquire the grayscale statistical values ​​of each image edge of the test image 200, and to acquire the image edge with the second maximum value of the grayscale statistical value, thereby obtaining the background image edge. The grayscale statistical values ​​of the image edges include: the average grayscale value of each pixel on the image edge, or the sum of the average grayscale value of each pixel on the image edge and the first maximum value. When the test image 200 is a dark field image, the first maximum value is the maximum value, and the second maximum value is the minimum value. When the test image 200 is a bright field image, the first maximum value is the minimum value, and the second maximum value is the maximum value.

[0225] Image acquisition module 10 further includes: dilation processing unit 14, used to dilate the binary image before weighting the target feature map. The dilation processing includes: traversing all second-class points, and when there is a first-class point among the first points adjacent to the second-class point along the dilation direction, setting the first attribute value of the second-class point to the first-class attribute value, and the angle between the dilation direction and the extension direction of the edge contour is less than 20°.

[0226] By performing dilation processing, it is beneficial to improve the accuracy of dividing the first point and the remaining first point at the edge of the object under test 100, reduce the interference of the internal pattern of the object under test 100, and thus reduce the probability of selecting the first point inside the object under test 100 according to the weight when the edge contour is subsequently based on the shortest path algorithm.

[0227] Specifically, the expansion direction of each second type of point is the same; the expansion direction of the second type of point can be parallel to the tangent direction at any position of the edge contour, or the expansion direction of the second type of point can be parallel to the tangent direction of the edge contour at the position of the second type of point.

[0228] It should be noted that in other embodiments, depending on the characteristics of the image to be tested, a binary image may not be used, but other types of target feature maps may be weighted instead.

[0229] The image acquisition module 10 further includes a weighting unit 15, which is used to weight the target feature map to obtain the weighted value of all first attribute values ​​of each first point, so as to obtain a weighted map representing the correspondence between the pixel position and the weighted value of the image to be tested 200. The weighting is used to make the gradient magnitude of the weighted value of the first point at the edge of the object to be tested in the first gradient direction greater than the gradient magnitude of the weighted value of the first point adjacent to the first point at the edge in the first gradient direction. The first gradient direction is perpendicular to the extension direction of the edge of the object to be tested 100.

[0230] The weighted image is used as the image to be analyzed. Edge extraction is then performed on the weighted image to obtain the edge contour of the object under test 100. The method of weighting the target feature map comprehensively considers multiple features, which helps to reduce noise. Therefore, when extracting edges from the weighted image, all features corresponding to the edges can be considered simultaneously, which is beneficial for accurately extracting the edge contour of the object under test.

[0231] In this embodiment, the weighted value of the first point at the edge of the object to be tested 100 has a minimum or maximum value, so that when the weighted image is subsequently extracted, the edge contour of the object to be tested 100 can be obtained by extracting the path with the sum of the weighted values ​​being the third maximum value.

[0232] In this embodiment, the weighting unit weights the first target feature map and the second target feature map. The weighting is used to make the gradient magnitude of the weighted value at the edge of the object to be tested 100 in the weighted map greater than the gradient magnitude of the first attribute value of the pixel at the edge of the object to be tested in the first target feature map.

[0233] In one specific embodiment, the first attribute values ​​of the edge pixels of the object to be tested 100 in both the first target feature map and the second target feature map are both minimum values, and the first target feature map is a binary map. Therefore, the weight of the first target feature map is greater than the weight of the second target feature map.

[0234] Specifically, a weighted average is applied to the first target feature map and the dilated binary map.

[0235] Since the binary image includes first-class points with first-class attribute values ​​and second-class points with second-class attribute values, the first-class attribute value is 1 and the second-class attribute value is 0. Since there are second-class points at the edge of the test object 100, the first target feature map is given a greater weight. The first attribute value of the first-class points contributes more to the weighted value, while the first attribute value of the second-class points contributes 0 to the weighted value. This makes the edge points of the test object 100 more prominent in the weighted image.

[0236] As an example, the weights of the first target feature map are 180 to 245, and the weights of the second target feature map are 0.1 to 0.3.

[0237] It should be noted that in other embodiments, the weight of the first target feature map can be changed, and the weight of the second target feature map can be changed proportionally.

[0238] As an example, the weighted value of each first point is calculated using the formula w(x, y) = w1 * (255 - mag(x, y)) + w2 * binary_orient(x, y), where w(x, y) is the weighted value corresponding to any pixel, 255 - mag(x, y) is the first attribute value of the pixel in the inverse magnitude map, mag(x, y) is the gradient magnitude of the pixel in the gradient magnitude map, binary_orient(x, y) is the first attribute value of the pixel in the binary map, w1 is 0.1 to 0.3, and w2 is 180 to 245.

[0239] Therefore, in this embodiment, the weighted value of the first point at the edge of the object to be tested 100 has a minimum value.

[0240] In other embodiments, depending on the weighting method and / or the type of target feature map selected, the weighting value of the first point at the edge of the object to be measured may also have a maximum value.

[0241] In this embodiment, the edge extraction module 20 includes: a direction definition unit, used to determine a start row and an end row in the image 300 to be analyzed, wherein the direction from the start row to the end row is a reference direction; and a target point acquisition unit, used to acquire a second point as a target point in each row from the start row to the end row along the reference direction, wherein the sum of the second attribute values ​​of the target points has a third maximum value, and the target points constitute edge points at the edge of the object to be tested; wherein, when the second attribute value of the second point at the edge of the object to be tested 100 in the image 300 to be analyzed has a minimum value, the third maximum value is the minimum value; and when the second attribute value of the second point at the edge of the object to be tested 100 in the image 300 to be analyzed has a maximum value, the third maximum value is the maximum value.

[0242] Since the second attribute value of the second point at the edge of the object 100 in the image 300 to be analyzed has a minimum or maximum value, the edge point of the edge contour of the object 100 can be extracted by obtaining a continuous path from the start row to the end row along the reference direction, and the sum of the second attribute values ​​of the second points passed through by the continuous path has a third maximum value.

[0243] The edge extraction module 20 may further include a region definition unit, used to acquire a region to be extracted in the image to be analyzed 300 before determining the start and end rows. The region to be extracted includes multiple rows of pixels, and each row of pixels includes multiple second points. By acquiring the region to be extracted, the area where edge extraction needs to be performed is determined, thereby improving the speed of edge extraction.

[0244] In this embodiment, the region to be extracted is the entire image 300 to be analyzed. In other embodiments, depending on the actual situation, the region to be extracted may also be a local area of ​​the image to be analyzed.

[0245] It should also be noted that the edge contour of the object under test 100 is obtained and used to determine the center of the object under test by using multiple edge contours obtained from edge extraction. Accordingly, edge extraction is performed on each image to be analyzed to obtain multiple edge contours.

[0246] In this embodiment, the target point acquisition unit includes: a preset subunit, used to use the second attribute value of each second point in the starting row as the cumulative value of the corresponding second point; and a search subunit, used to traverse each row from the second row to the end row in sequence, and perform path finding processing on the current row to obtain the position pointer table and the cumulative value of each second point in the end row. The path finding processing includes: repeatedly performing cumulative relationship acquisition processing on each second point in the current row, wherein the cumulative relationship acquisition processing includes: obtaining each second point located within the search range of the previous row of the current second point as candidate points, the search range covering multiple candidate points in the previous row that are closest to the current second point; and obtaining the second attribute value and the value of each candidate point relative to the current second point. The three extreme values ​​are calculated to obtain the cumulative extreme value. This cumulative extreme value is used as the cumulative value of the current second point, and the positional relationship between the candidate point corresponding to the cumulative extreme value and the current second point is recorded as the position pointer of the current second point. The cumulative relationship acquisition process is repeated for all second points in the current row to obtain the cumulative value and positional relationship of each second point. The correspondence between each second point and the positional relationship forms a position pointer table. The end position acquisition sub-unit is used to acquire the second point in the end row whose cumulative value has the third extreme value as the end position. The extraction sub-unit is used to acquire the target point according to the position pointer table and the end position. The target point passes through the end position and the sum of the second attribute values ​​of the target point is equal to the cumulative value of the end position.

[0247] In this embodiment, the second attribute value of the second point at the edge of the object 100 in the image 300 to be analyzed has a minimum value; therefore, the third maximum value is the minimum value. In other embodiments, when the second attribute value of the second point at the edge of the object in the image to be analyzed has a maximum value, the third maximum value is the maximum value.

[0248] As an example, the target point acquisition unit uses the shortest path algorithm for edge extraction, including Dijkstra's algorithm.

[0249] In this embodiment, during the process of repeatedly accumulating the relationship of each second point in the current row, the search range of the i-th current second point covers the candidate points including the i-2 to i+2 second points in the previous row, where i represents the position of the current second point in the arrangement direction, which is perpendicular to the reference direction.

[0250] In this embodiment, the image processing system includes a center extraction module 30, which is used to determine the center of the object to be measured 100 by using multiple edge contours obtained by edge extraction.

[0251] Determine the center of the test object 100 in order to accurately control its position in the device.

[0252] Specifically, the center extraction module 30 includes: a coordinate acquisition unit, used to acquire the coordinates of multiple pixels of the edge contour based on the coordinate information of the pixels of the image to be tested 200; and a fitting unit, used to fit the coordinates of the multiple pixels of the edge contour to acquire the center coordinates of the object to be tested 100.

[0253] Fitting the center requires multiple points, so the coordinates of multiple pixels on the edge contour need to be obtained in advance.

[0254] Specifically, the coordinate acquisition unit includes: a first coordinate acquisition unit, used to acquire the first coordinates of each pixel point corresponding to the edge contour in the image coordinate system; and a second coordinate acquisition unit, used to convert the first coordinates into second coordinates in the motion platform coordinate system, with the second coordinates serving as the coordinates of the pixel points of the edge contour. Correspondingly, the fitting unit is used to fit the center coordinates of the object under test 100 based on the second coordinates.

[0255] After acquiring the test image 200 of the test object 100 at edge position 100L, the coordinates of each pixel in the test image 200 at edge position 100L in the motion platform coordinate system are known. The coordinates in the image coordinate system and the coordinates in the motion platform coordinate system have a corresponding relationship. Therefore, the first coordinates of each pixel corresponding to the edge contour in the image coordinate system can be transformed into second coordinates in the motion platform coordinate system. Here, the test object 100 is located on a motion platform, and the motion platform coordinate system is the world coordinate system of the test object 100, which can represent the true position of the test object 100. Therefore, it is necessary to transform the first coordinates into the second coordinates.

[0256] In this embodiment, the shape of the object to be tested 100 is circular. Then, the second coordinates of all pixels are substituted into the general equation of a circle: x^2+y^2+a1*x+a2*y+a3=0. The values ​​of a1, a2 and a3 are solved by solving the least squares matrix, thereby fitting the center coordinates of the object to be tested.

[0257] It should be noted that the general equation of a circle can be used to obtain not only the coordinates of the center but also the radius. Therefore, the radius obtained by the general equation of a circle can be compared with the preset radius R of the object to be measured 100, thereby evaluating the accuracy of edge extraction.

[0258] Specifically, the general equation of a circle can be transformed into the standard equation of a circle, namely (X+a1 / 2)^2+(Y+a2 / 2)^2=(a1^2+a2^2-4*a3) / 4. Thus, after the values ​​of a1, a2, and a3, the corresponding coordinates of the center of the circle and the radius of the circle can be obtained.

[0259] This invention also provides a device that can implement the image processing method provided in this invention by loading a program in the form of the above-described image processing method.

[0260] refer to Figure 9 The diagram illustrates the hardware structure of a device according to an embodiment of the present invention. The device of this embodiment includes: at least one processor 01, at least one communication interface 02, at least one memory 03, and at least one communication bus 04.

[0261] In this embodiment, the number of processor 01, communication interface 02, memory 03 and communication bus 04 is at least one, and processor 01, communication interface 02 and memory 03 communicate with each other through communication bus 04.

[0262] Communication interface 02 can be an interface for a communication module used for network communication, such as the interface for a GSM module.

[0263] Processor 01 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the image processing method of this embodiment.

[0264] The memory 03 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device. The memory 03 stores one or more computer instructions, which are executed by the processor 01 to implement the image processing method provided in the foregoing embodiments.

[0265] It should be noted that the aforementioned terminal device may also include other devices (not shown) that may not be essential to understanding the content disclosed in the embodiments of the present invention; given that these other devices may not be essential for understanding the content disclosed in the embodiments of the present invention, the embodiments of the present invention will not describe them one by one.

[0266] This invention also provides a storage medium storing one or more computer instructions for implementing the image processing method provided in the foregoing embodiments.

[0267] In the image processing method provided by the embodiments of the present invention, an image of the object to be analyzed is first acquired so as to combine the features of the image to be analyzed to extract the edge of the image to be analyzed, thereby facilitating the accurate extraction of the edge contour of the object to be analyzed. At the same time, image processing is performed on the image of the object to be analyzed to achieve the purpose of contour extraction, which also helps to improve the efficiency of extracting the edge contour of the object to be analyzed.

[0268] The embodiments of the present invention described above are combinations of elements and features of the present invention. Unless otherwise stated, elements or features may be considered optional. Individual elements or features may be practiced without combination with other elements or features. Furthermore, embodiments of the present invention may be constructed by combining some elements and / or features. The order of operations described in the embodiments of the present invention may be rearranged. Some constructions of any embodiment may be included in another embodiment and may be replaced by corresponding constructions of another embodiment. It will be apparent to those skilled in the art that claims in the appended claims that are not expressly referenced in each other may be combined to form embodiments of the present invention, or may be included as new claims in amendments made after the filing of this application.

[0269] Embodiments of the present invention can be implemented by various means, such as hardware, firmware, software, or combinations thereof. In a hardware configuration, the method according to an exemplary embodiment of the present invention can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, etc.

[0270] In firmware or software configuration, embodiments of the present invention can be implemented in the form of modules, processes, functions, etc. Software code can be stored in a memory unit and executed by a processor. The memory unit is located inside or outside the processor and can send data to and receive data from the processor via various known means.

[0271] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is accorded the widest scope consistent with the principles and novel features disclosed herein.

[0272] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.

Claims

1. An image processing method, characterized in that, include: Acquire an image to be analyzed, wherein the image to be analyzed contains the edge contour of the object to be tested; Edge extraction is performed on the image to be analyzed to obtain the edge contour of the object under test; The image to be analyzed is a weighted image of multiple target feature maps. Obtaining the image to be analyzed includes: Acquire a test image of the object to be tested at the edge position, the test image containing the edge contour of the object to be tested, the edge contour of the object to be tested extending along a preset direction range in the test image; Multiple target feature maps are obtained based on the image to be tested. Each target feature map includes the correspondence between the position of each first point and the first attribute value. The position of the first point of the target feature map corresponds one-to-one with the position of the pixel in the image to be tested. The types of first attribute values ​​of the multiple target feature maps are different. The first attribute value characterizes the attribute of the target feature map. The target feature maps are weighted to obtain a weighted value of all first attribute values ​​of each first point, so as to obtain a weighted map that represents the correspondence between the pixel position and the weighted value of the image under test. The weighting is used to make the gradient magnitude of the weighted value of the first point at the edge of the object under test in the first gradient direction greater than the gradient magnitude of the weighted value of the first point adjacent to the first point at the edge in the first gradient direction. The first gradient direction is perpendicular to the extension direction of the edge of the object under test.

2. The image processing method as described in claim 1, characterized in that, The first attribute value of the multiple target feature maps includes any multiple of the following: gradient magnitude, gradient angle, pixel grayscale value, binarization value, and color representation value; Multiple target feature maps are obtained from the image to be tested. The target feature maps include any of the following: gradient magnitude map, gradient angle map, gradient difference map, grayscale map, binary map, and color map. The gradient difference map includes the absolute value of the grayscale gradient difference between each of the first points in the first gradient direction and the second gradient direction. The first gradient direction and the second gradient direction are different.

3. The image processing method as described in claim 1, characterized in that, The target feature map obtained from the image to be tested includes a first target feature map and a second target feature map. The first attribute value of the first point at the edge of the object to be tested in both the first and second target feature maps is either a maximum or a minimum value. The first target feature map includes one or both of a gradient angle map and a binary map. The second target feature map is a gradient magnitude map or the image to be tested. The gradient angle map includes the gradient angle value of the gray-level gradient at each first point. The gradient angle value at the edge of the object to be tested has a maximum or a minimum value. The gradient magnitude map includes the gradient magnitude of the gray-level gradient at each first point. Weighting the target feature map includes: weighting the first target feature map and the second target feature map, wherein the weighting is used to make the gradient magnitude of the weighted value at the edge of the object to be measured in the weighted map greater than the gradient magnitude of the first attribute value of the pixel at the edge of the object to be measured in the first target feature map.

4. The image processing method as described in claim 2 or 3, characterized in that, The target feature map includes a binary map; Before obtaining the target feature map of the image to be tested, the method further includes: obtaining an initial feature map based on the image to be tested, wherein the initial feature map includes at least one of the gradient map, gradient magnitude map, grayscale map, color map, and the image to be tested, wherein the gradient map includes the grayscale gradient values ​​of each of the first points; Obtaining the binary image based on the initial feature image includes: performing binarization processing on the initial feature image using a threshold condition of the first attribute value corresponding to the initial feature image as a standard.

5. The image processing method as described in claim 3, characterized in that, The second target feature map has a positive amplitude. The figure shows that the first attribute value of each first point in the positive amplitude graph is positively correlated with the gradient amplitude of the corresponding pixel in the image under test. Close; the first target feature map is a binary map, the binary map includes first-class points with first attribute value of first-class attribute value and second-class points with first attribute value of second-class attribute value, and the edge of the object to be tested has second-class points, the second-class attribute value is greater than the first-class attribute value; or, The second target feature map is an inverse amplitude map, wherein the first attribute value of each first point in the inverse amplitude map is negatively correlated with the gradient amplitude of the corresponding pixel in the image to be tested; the first target feature map is a binary map, wherein the binary map includes first-class points with first attribute values ​​of first-class attribute values ​​and second-class points with first attribute values ​​of second-class attribute values, and the edge of the object to be tested has second-class points, wherein the second-class attribute values ​​are less than the first-class attribute values.

6. The image processing method as described in claim 3, characterized in that, The second target feature map is an inverse magnitude map, and the first attribute value of each first point in the inverse magnitude map is negatively correlated with the gradient magnitude of the corresponding pixel in the image under test; Obtaining a target feature map from the image under test includes: obtaining the gradient magnitude of each pixel in the image under test to obtain a positive magnitude map; inverting the positive magnitude map to obtain an inverted magnitude map, wherein the inversion process includes: subtracting the gradient magnitude of each first point in the positive magnitude map from a preset value to obtain the inverted magnitude value of each first point, thereby obtaining the inverted magnitude map; wherein the preset value is greater than or equal to the maximum value among the gradient magnitudes of each first point.

7. The image processing method as described in claim 3 or 6, characterized in that, In both the first target feature map and the second target feature map, the first attribute value of the first point at the edge of the object to be measured is a minimum value; the first target feature map is a binary map. During the weighting process of the target feature map, the weight of the first target feature map is greater than the weight of the second target feature map.

8. The image processing method as described in claim 6, characterized in that, The first target feature map is a binary map, which includes a first type of points with a first attribute value of 1 and a second type of points with a first attribute value of 0. The edge of the object to be measured has the second type of points. The weight of the first target feature map is 180 to 245, the weight of the second target feature map is 0.1 to 0.3, and when the second target feature map is an inverse value amplitude map, the preset value is greater than or equal to 200.

9. The image processing method as described in claim 2 or 3, characterized in that, The target feature map includes a binary map, which includes first-class points with first-class attribute values ​​and second-class points with second-class attribute values, and the edge of the object to be measured has second-class points; Before weighting the target feature map, the method further includes: performing dilation processing on the binary map. The dilation processing includes: traversing all second-class points, and when a first point adjacent to a second-class point along the dilation direction contains a first-class point, setting the first attribute value of the second-class point to the first-class attribute value. The angle between the dilation direction and the extension direction of the edge contour is less than 20°.

10. The image processing method as described in claim 9, characterized in that, The expansion directions of all second-type points are the same; the expansion direction of the second-type points is parallel to the tangent direction at any position of the edge contour, or the expansion direction of the second-type points is parallel to the tangent direction of the edge contour at the position of the second-type points.

11. The image processing method as described in claim 1, characterized in that, Before acquiring multiple target feature maps based on the image to be tested, acquiring the image to be analyzed also includes: rotating the image to be tested so that the edge contour image of the object to be tested extends along a preset direction range.

12. The image processing method as described in claim 11, characterized in that, The image to be tested includes multiple image edges. The edges are such that only one of the multiple image edges is a background image edge, and the background image edge is completely covered by the background image; Rotating the image to be tested to extend the edge contour image of the object to be tested along a preset direction range includes: acquiring the edge of the background image; Rotate the edges of the background image so that they face a preset direction.

13. The image processing method as described in claim 12, characterized in that, Obtaining the background image edge includes: obtaining the grayscale statistical value of each image edge of the image to be tested, wherein the grayscale statistical value of the image edge includes: the mean grayscale value of each pixel on the image edge, or the sum of the mean grayscale value of each pixel on the image edge and the first maximum value; The image edge with the second maximum value of the grayscale statistical value is obtained to obtain the background image edge; Specifically, when the image to be tested is a dark field image, the first maximum value is the maximum value and the second maximum value is the minimum value; when the image to be tested is a bright field image, the first maximum value is the minimum value and the second maximum value is the maximum value.

14. The image processing method as described in claim 1, characterized in that, The image to be analyzed includes the correspondence between each second point and the second attribute value of the image to be analyzed. In the image to be analyzed, the second attribute value of the second point at the edge of the object to be analyzed has a minimum value or a maximum value. Edge extraction of the image to be analyzed includes: determining a start row and an end row in the image to be analyzed, with the direction from the start row to the end row as the reference direction; Along the reference direction, a second point is obtained as a target point in each row from the starting row to the ending row. The sum of the second attribute values ​​of the target points has a third maximum value, and the target points constitute the edge points at the edge of the object to be measured. Wherein, in the image to be analyzed, if the second attribute value of the second point at the edge of the object to be measured has a minimum value, the third maximum value is the minimum value; if the second attribute value of the second point at the edge of the object to be measured has a maximum value, the third maximum value is the maximum value.

15. The image processing method as described in claim 14, characterized in that, In each row from the starting row to the ending row, a second point is obtained as the target point, including: The second attribute value of each second point in the starting row is respectively used as the cumulative value of the corresponding second point; Iterate through each row from the second row to the end row, and perform path finding processing on the current row to obtain the position pointer table and the accumulated value of each second point in the end row. The path finding processing includes: obtaining the repeated accumulation relationship of each second point in the current row. The cumulative relationship acquisition process includes: acquiring each second point within the search range of the previous row of the current second point as candidate points, wherein the search range covers multiple candidate points in the previous row that are closest to the current second point; acquiring the third maximum value among the second attribute values ​​and values ​​of each candidate point and the current second point, respectively, to obtain the maximum and minimum value cumulative value; using the maximum and minimum value cumulative value as the cumulative value of the current second point, and recording the positional relationship between the candidate point corresponding to the maximum and minimum value cumulative value and the current second point as the position pointer of the current second point; Repeat the accumulation relationship acquisition process for all second points in the current row to obtain the accumulated value of each second point and the bit. The position pointer table is formed by the correspondence between each second point and the position relationship. The second point in the ending row whose accumulated value has the third maximum value is taken as the ending position; The target point is obtained according to the position pointer table and the end position. The target point passes through the end position and... The sum of the second attribute values ​​of the target point is equal to the accumulated value of the ending position.

16. The image processing method as described in claim 15, characterized in that, During the process of repeatedly accumulating the relationship of each second point in the current row, the search range of the i-th current second point covers the candidate points including the i-2nd to i+2nd second points in the previous row, where i represents the position of the current second point in the arrangement direction, which is perpendicular to the reference direction.

17. The image processing method as described in claim 1, characterized in that, Acquiring the image to be analyzed includes: acquiring the image of the object to be analyzed at multiple different edge locations, wherein the number of edge locations is greater than or equal to 3; The image processing method further includes: determining the center of the object under test using multiple edge contours obtained by the edge extraction.

18. The image processing method as described in claim 17, characterized in that, Determining the center of the object under test using multiple edge contours obtained by the edge extraction includes: obtaining the coordinates of multiple first points of the edge contours based on the coordinate information of the first point of the image under test; and fitting the coordinates of the multiple first points of the edge contours to obtain the center coordinates of the object under test.

19. An image processing system, characterized in that, The image processing system is used to perform the image processing method according to any one of claims 1 to 18, the image processing system comprising: An image acquisition module is used to acquire an image to be analyzed, wherein the image to be analyzed contains the edge contour of the object to be tested; an edge extraction module is used to extract the edge of the image to obtain the edge contour of the object to be tested. The image to be analyzed is a weighted image of multiple target feature maps, and the image acquisition module is specifically used for: Acquire a test image of the object to be tested at the edge position, the test image containing the edge contour of the object to be tested, the edge contour of the object to be tested extending along a preset direction range in the test image; Multiple target feature maps are obtained based on the image to be tested. Each target feature map includes the correspondence between the position of each first point and the first attribute value. The position of the first point of the target feature map corresponds one-to-one with the position of the pixel in the image to be tested. The types of first attribute values ​​of the multiple target feature maps are different. The first attribute value characterizes the attribute of the target feature map. The target feature maps are weighted to obtain a weighted value of all first attribute values ​​of each first point, so as to obtain a weighted map that represents the correspondence between the pixel position and the weighted value of the image under test. The weighting is used to make the gradient magnitude of the weighted value of the first point at the edge of the object under test in the first gradient direction greater than the gradient magnitude of the weighted value of the first point adjacent to the first point at the edge in the first gradient direction. The first gradient direction is perpendicular to the extension direction of the edge of the object under test.

20. A device, characterized in that, It includes at least one memory and at least one processor, the memory storing one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the image processing method as described in any one of claims 1 to 18.

21. A storage medium, characterized in that, The storage medium stores one or more computer instructions for implementing the image processing method as described in any one of claims 1 to 18.

Citation Information

Patent Citations

  • Remote sensing image information extraction method based on FCN-8s and improved Canny edge detection

    CN111985329A