Edge position detection method and apparatus

By obtaining the orientation of the periodic structure image in the edge location detection method, performing interpolation processing and calculating the normalized cross-correlation result, the problem of inaccurate detection in the prior art is solved, and low-cost edge location detection is achieved.

CN115937235BActive Publication Date: 2026-04-07SHANGHAI JINGJI SEMICON TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-02
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing edge location detection methods cannot accurately detect the edge location between two different periodic structures, and machine learning methods have high training costs and slow computation speed.

Method used

By acquiring the target region, selecting the direction of the periodic structure image, selecting the periodic image and performing interpolation processing, and calculating the normalized cross-correlation result, the edge position can be obtained.

Benefits of technology

Accurate detection of the edges of two different periodic structures and the edges of periodic and non-periodic structures was achieved with low training cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115937235B_ABST
    Figure CN115937235B_ABST
Patent Text Reader

Abstract

The application provides an edge position detection method and device, and relates to the technical field of image processing. The edge position detection method comprises the following steps: obtaining a target region, wherein the target region comprises at least two kinds of structure images and an edge position; selecting at least one periodic structure as a target structure image, and determining a direction in which the target structure image periodically changes; selecting a plurality of periodic images in sequence along the direction in which the target structure image periodically changes; selecting a first contrast image in the target structure image; performing interpolation processing on the first contrast image to obtain a second contrast image which is consistent with the periodic images in phase and size; and obtaining a normalized cross-correlation result of the periodic images and the corresponding second contrast images to obtain the edge position. The application can obtain an accurate detection result of the edge position between two kinds of different periodic structures or between a periodic structure and a non-periodic structure.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and in particular to an edge position detection method and device. BACKGROUND

[0002] Edge position detection is a basic problem in image processing, and is usually detected by using the feature that the brightness changes obviously near the edge position, or by using the method of searching different pattern structures in machine learning to distinguish the edge position between two different periodic structures. The common method is to detect the edge position by using an edge position detection template, such as Sobel operator, Prewitt operator, Roberts operator, Canny operator, and Laplacian operator.

[0003] The common steps of edge position detection include: using a smoothing filter (such as a Gaussian filter) to perform a filtering operation on the image to obtain a smoothed image; using an edge position detection operator to perform a filtering operation on the smoothed image to calculate the derivative of the brightness change of the image, so that the brightness of the edge position of the image is enhanced; and the position where the absolute value of the brightness change exceeds a set threshold is the edge of the image.

[0004] Since the existing edge position detection method can only detect the area where the lightness changes obviously, i.e., can only detect all the structure areas where the lightness changes obviously in the image, it is not applicable to the edge position at the junction of two different periodic structures, or the junction of a periodic structure and a non-periodic structure.

[0005] Figure 1 To detect the edge of a periodic structure using the existing edge position detection method: the edge position in (a) is enhanced using a Sobel operator to obtain (b) in (a); the edge position in (b) is filtered using a set threshold to obtain (c) in (b). Figure 1 Figure 1 Figure 1 Figure 1

[0006] If it is desired to distinguish the boundary between one periodic structure and another periodic structure, as shown in (a), the existing edge position detection method will obtain an image as shown in (b); or if it is desired to obtain the boundary between a periodic structure and a non-periodic structure, as shown in (c), the existing edge position detection method will obtain an image as shown in (d). Figure 2 Figure 2 Figure 2 Figure 2 ​​​​​​​The edge position detection method cannot accurately detect the edge position between the two structures as shown in (d) of FIG. 1.

[0007] The machine learning method based on texture and shape features can be used to distinguish the edge positions of the two different periodic structures, but has the disadvantages of high training cost and slow calculation speed.

[0008] Therefore, the present application provides an edge position detection method and device to well realize the detection of the edges of the two different periodic structures or the edge position between the periodic structure and the non-periodic structure. SUMMARY

[0009] The present application provides an edge position detection method and device to solve the technical problem that the prior art cannot distinguish the edges of the two different periodic structures or the edge between the periodic structure and the non-periodic structure, thereby resulting in inaccurate detection results.

[0010] In a first aspect, the present application provides an edge position detection method, comprising: S1, acquiring a target region, the target region containing at least two structure images and an edge position, the edge position being a boundary line between different structure images, at least one side of the edge position being an image of a periodic structure, and the periodic structure comprising a plurality of periodically arranged periodic units; S2, selecting at least one periodic structure image in the structure images as a target structure image, and determining a direction in which the periodic structure in the target structure image periodically changes; S3, sequentially selecting a plurality of periodic images in the target region along the direction in which the periodic structure periodically changes, the periodic image comprising at least one periodic unit in the target structure image; S4, selecting a first contrast image in the target structure image, the length of the first contrast image along the direction in which the periodic structure periodically changes being greater than the length of the periodic image along the direction in which the periodic structure periodically changes; S5, performing interpolation processing on the first contrast image to obtain a second contrast image consistent with the periodic image in phase and size; S6, acquiring a normalized cross-correlation result of the periodic image and the corresponding second contrast image; and S7, acquiring the edge position according to the normalized cross-correlation result.

[0011] The edge position detection method provided by the present application can obtain accurate detection results of the edge positions between the two different periodic structures or the periodic structure and the non-periodic structure under the premise of low training cost.

[0012] Optionally, in the S3, a first initial position is selected in the target structure image; a plurality of periodic images are selected from the first initial position along the periodically varying direction at a first preset length, the first preset length being less than or equal to the length of the periodic image along the periodically varying direction. The beneficial effect is that by the first preset length being less than or equal to the length of the periodic image along the periodically varying direction, each corner of the target region can be detected, and the accuracy of the detection result is ensured.

[0013] Optionally, in the S4, the length of the first contrast image along the periodically varying direction is obtained by rounding up the length of the periodic image along the periodically varying direction and adding 1. The beneficial effect is that by ensuring that the length of the first contrast image along the periodically varying direction is equal to or slightly greater than the length of the periodic image along the periodically varying direction, interpolation processing can be performed on the first contrast image in any case to obtain a second contrast image with the same phase and size as the periodic image.

[0014] Optionally, in the S6, the normalized cross-correlation result of the periodic image and the corresponding second contrast image is obtained by the following formula: wherein γ is the normalized cross-correlation result of the periodic image and the corresponding second contrast image, f(x, y) is the pixel value of the periodic image at any coordinate position, is the average value of all pixel values of the periodic image, and t(x, y) is the pixel value of the second contrast image at the corresponding coordinate position, is the average value of all pixel values of the second contrast image. The beneficial effect is that because the phase and size of the second contrast image and the periodic image are consistent, the normalized cross-correlation result can be obtained by the above algorithm.

[0015] Optionally, in the S7, the position of the normalized cross-correlation result satisfying the preset condition in the target region is the edge position. The beneficial effect is that by setting the preset condition to screen the normalized cross-correlation result, the method is simple, easy to operate, and the preset condition can be adjusted according to the actual situation.

[0016] Optionally, when the corresponding normalized cross-correlation result at the adjacent position in the target region suddenly changes from close to 1 to far from 1, the normalized cross-correlation result far from 1 satisfies the preset condition, the close to 1 includes that the normalized cross-correlation result is 0.8-1, and the far from 1 includes that the normalized cross-correlation result is 0-0.3 or below 0. The beneficial effect is that when the normalized cross-correlation result is closer to 1, it means that the second contrast image is more similar to the periodic image; when the normalized cross-correlation result is farther from 1, it means that the second contrast image is less similar to the periodic image. Therefore, when the normalized cross-correlation result suddenly changes from close to 1 to far from 1, the position corresponding to the result of the sudden change is the edge position.

[0017] Optionally, before the S6 is performed, the method further comprises: when the target structure image has only one direction of periodic variation, performing dimension reduction processing on the target region; dividing the target region into N equal parts along a direction perpendicular to the direction of periodic variation, and obtaining the gray average value of each equal part, wherein N is equal to the number of pixels of the target region along the direction of periodic variation. The beneficial effect is that this processing can obtain a more intuitive gray average value distribution result, improving the efficiency.

[0018] Optionally, in the S6, the normalized cross-correlation result of the periodic image and the corresponding second contrast image is obtained by the following formula: wherein γ is the normalized cross-correlation result of the periodic image and the corresponding second contrast image, f(a) is the gray average value of the periodic image at any equal part, is the gray average value of the periodic image, t(a) is the gray average value of the second contrast image at the corresponding equal part, is the gray average value of the second contrast image. The beneficial effect is that when a more intuitive gray average value distribution result is obtained, the calculation formula of the normalized cross-correlation result will also be correspondingly simplified.

[0019] In a second aspect, the present application provides an edge position detection device for performing the edge position detection method according to any one of the above embodiments, comprising: an acquisition module, an interpolation processing module, a normalization processing module and an edge position acquisition module; the acquisition module comprises a first acquisition unit, a second acquisition unit, a third acquisition unit and a fourth acquisition unit; the first acquisition unit is configured to acquire a target region, the target region comprising at least two structural images and an edge position, the edge position being a boundary line between different structural images, at least one side of the edge position being a periodic structure image, the periodic structure comprising a plurality of periodically arranged periodic units; the second acquisition unit is configured to select at least one periodic structure image in the structural images as a target structural image, and determine a direction in which the periodic structure in the target structural image periodically changes; the third acquisition unit is configured to sequentially select a plurality of periodic images in the target region along the direction in which the periodic structure periodically changes, the periodic image comprising at least one periodic unit in the target structural image; the fourth acquisition unit is configured to select a first contrast image in the target structural image, the first contrast image having a length along the direction in which the periodic structure periodically changes greater than that of the periodic image along the direction in which the periodic structure periodically changes; the interpolation processing module is configured to perform interpolation processing on the first contrast image to obtain a second contrast image having the same phase and size as the periodic image; the normalization processing module is configured to obtain a normalized cross-correlation result of the periodic image and the corresponding second contrast image; and the edge position acquisition module is configured to obtain the edge position according to the normalized cross-correlation result.

[0020] The edge position detection device provided by the present application can obtain an accurate detection result of the edge position under the premise of low training cost. BRIEF DESCRIPTION OF DRAWINGS

[0021] Figure 1 An edge position diagram of a periodic structure detected by the prior art;

[0022] Figure 2 An edge position diagram of a periodic structure detected by the prior art;

[0023] Figure 3 An edge position detection method provided by the present application;

[0024] Figure 4 A structural diagram of a target region provided by the present application;

[0025] Figure 5 A distribution diagram of a normalized cross-correlation result provided by the present application;

[0026] Figure 6 A distribution diagram of normalized cross-correlation results provided by the present application;

[0027] Figure 7 An edge position distribution diagram provided by the present application;

[0028] Figure 8 An embodiment diagram of a target region gray scale average value distribution provided by the present application;

[0029] Figure 9 Another distribution diagram of normalized cross-correlation results provided by the present application;

[0030] Figure 10 Another target region distribution diagram provided by the present application;

[0031] Figure 11 Another target region structure embodiment diagram provided by the present application;

[0032] Figure 12 Still another distribution diagram of normalized cross-correlation results provided by the present application;

[0033] Figure 13 An edge position detection device structure embodiment diagram provided by the present application. DETAILED DESCRIPTION

[0034] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings. In the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing the specific embodiments of the present application, and are not intended to be limiting on the present application. As used in the specification and the appended claims of the present application, the singular forms "a", "an" and "the" are intended to include, for example, the expression "one or more", unless the context clearly indicates to the contrary. It should also be understood that in the following embodiments of the present application, "at least one" and "one or more" refer to one or more than two (including two). The term "and / or" is used to describe the association relationship of the associated objects, which means that there can be three relationships; for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it.

[0035] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes direct connections and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.

[0036] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0037] Existing edge location detection operators cannot distinguish edges at the boundaries of periodic structure images, and existing machine learning methods for edge location detection are costly to train and slow to compute. To address these issues, this invention proposes an edge location detection method and apparatus that can effectively detect edges between two different periodic structures or between periodic and non-periodic structures.

[0038] This invention provides an edge location detection method, the process of which is as follows: Figure 3 As shown, it includes:

[0039] S1. Obtain a target region, the target region containing at least two structural images and edge positions, the edge positions being the boundary lines between different structural images, and at least one side of the edge position being an image of a periodic structure, the periodic structure including a plurality of repeating periodic units;

[0040] S2. Select at least one periodic structure image from the structure images as the target structure image, and determine the direction in which the periodic structure in the target structure image changes periodically;

[0041] S3. Within the target area, along the direction of the periodic change, a number of periodic images are selected sequentially, each periodic image including at least one periodic unit in the target structure image;

[0042] S4. Select a first comparison image from the target structure image, wherein the length of the first comparison image along the direction of the periodic change is greater than the length of the periodic image along the direction of the periodic change.

[0043] S5. Interpolate the first comparison image to obtain a second comparison image that is consistent with the phase and size of the periodic image;

[0044] S6. Obtain the normalized cross-correlation result between the periodic image and the corresponding second comparison image;

[0045] S7. Obtain the edge position based on the normalized cross-correlation result.

[0046] The edge location detection method provided by this invention can obtain the detection result of the edge location with low training cost.

[0047] In some embodiments, in step S3, a first initial position is selected within the target structure image; starting from the first initial position, several periodic images are sequentially selected at intervals of a first preset length along the direction of periodic change, where the first preset length is less than or equal to the length of the periodic images along the direction of periodic change. The advantage is that by ensuring the first preset length is less than or equal to the length of the periodic images along the direction of periodic change, it can be guaranteed that every corner of the target area can be detected, thus ensuring the accuracy of the detection results.

[0048] In some embodiments, in S4, the length of the first comparison image along the direction of periodic change is obtained by rounding up the numerical value of the length of the periodic image along the direction of periodic change and then adding 1. The advantage is that by ensuring that the length of the first comparison image along the direction of periodic change is equal to or slightly greater than the length of the periodic image along the direction of periodic change, interpolation processing can be performed on the first comparison image under any circumstances to obtain a second comparison image that has the same phase and size as the periodic image.

[0049] In some embodiments, in S6, the normalized cross-correlation result of the periodic image and the corresponding second contrast image is obtained by the following formula: Wherein, γ is the result of normalized cross-correlation processing between the periodic image and the corresponding second contrast image, and f(x,y) is the pixel value of the periodic image at any coordinate position. t(x,y) is the average value of all pixel values ​​in the periodic image, and t(x,y) is the pixel value of the second comparison image at the corresponding coordinate position. This is the average value of all pixel values ​​in the second comparison image. In this embodiment, the corresponding coordinate position refers to the position in the second comparison image where the phase difference between the pixel values ​​in the two images is 0, used for difference calculation. Its advantage is that because the phase and size of the second comparison image and the periodic image are consistent, the normalized cross-correlation result can be obtained through the above algorithm.

[0050] In some embodiments, in step S7, the position in the target region corresponding to the normalized cross-correlation result that satisfies the preset conditions is the edge position. Its advantages are: filtering the normalized cross-correlation results by setting preset conditions is simple, easy to implement, and convenient to operate; the preset conditions can also be adjusted according to actual conditions.

[0051] In some embodiments, when the normalized cross-correlation result corresponding to an adjacent position within the target area abruptly drops from close to 1 to far from 1, the normalized cross-correlation result far from 1 satisfies the preset condition. "Close to 1" includes a normalized cross-correlation result with a value between 0.8 and 1, and "far from 1" includes a normalized cross-correlation result with a value between 0 and 0.3 or below 0. The beneficial effect is that: the closer the normalized cross-correlation result is to 1, the more similar the second comparison image is to the periodic image; the further the normalized cross-correlation result is from 1, the less similar the second comparison image is to the periodic image. Therefore, when the normalized cross-correlation result abruptly changes from close to 1 to far from 1, the position corresponding to this abrupt change is the edge position.

[0052] In some embodiments, before performing S6, the method further includes: when the target structure image exhibits only one direction of periodic change, performing dimensionality reduction processing on the target region; dividing the target region into N equal parts along the direction perpendicular to the periodic change, and obtaining the average grayscale value of each part, where N is equal to the number of pixels in the target region along the direction of periodic change. The beneficial effect is that this processing can obtain a more intuitive grayscale average value distribution result, improving efficiency.

[0053] In some embodiments, in S6, the normalized cross-correlation result of the periodic image and the corresponding second contrast image is obtained by the following formula: Wherein, γ is the normalized cross-correlation result between the periodic image and the corresponding second contrast image, and f(a) is the average gray level of the periodic image at any equal division. t(a) is the average gray level of the periodic image, and t(a) is the average gray level of the second contrast image at the corresponding equal divisions. Let be the average grayscale value of the second comparison image. Its advantage lies in the fact that when a more intuitive distribution of the average grayscale value is obtained, the calculation formula for the normalized cross-correlation result also becomes correspondingly simpler.

[0054] To illustrate the edge position detection method provided by this invention in more detail, examples are given below.

[0055] Example 1:

[0056] When the target area contains, for example Figure 4 When considering the two periodic structures shown in (a), namely the first periodic structure 301 and the second periodic structure 302, with the first periodic structure 301 as the target structure image, by... Figure 4 It can be seen that the direction in which the target structure image changes periodically is the direction indicated by y, which is parallel to the edge of the target region. Along the direction indicated by y, periodic images f with a length Trow of 159.1102 pixels are sequentially acquired every 20 pixels along the periodically changing direction. The periodic images f are as follows... Figure 4 As shown in (c) in the diagram. A first comparison image m is selected from the first periodic structure 301. The length Trow_C of the first comparison image m along the direction of the periodic change is ceil(Trow), which is the floor of Trow, equal to 160. The first comparison image m is as follows... Figure 4 As shown in (b) of the diagram. The first contrast image m is interpolated to obtain a second contrast image t that has the same phase and size as the periodic image f. The second contrast image t is as follows: Figure 4 As shown in (d) in the formula. The result of normalized cross-correlation processing of the periodic image f and the corresponding second contrast image t is calculated, which is the normalized cross-correlation processing result γ.

[0057] In the target region, periodic images are selected by sliding every 20 pixels along the direction indicated by y. The normalized cross-correlation result of each periodic image f and its corresponding second contrast image t is calculated. Assume that the index i corresponding to the first row of pixels in the target region along the direction indicated by y is 1. If periodic images f are selected starting from the first row, then the next periodic image f should be selected after sliding 20 pixels along the direction indicated by y from the first row, with index i becoming 21. The next periodic image f should continue to slide 20 pixels along the direction indicated by y, with index i becoming 41, and so on, with the index i corresponding to the periodic images f along the direction indicated by y gradually increasing.

[0058] The change of the normalized cross-correlation result γ with the change of the periodic image f is referenced. Figures 5-6 , Figure 6 The difference between (a), (b), and (c) lies in the different accuracy requirements for the normalized cross-correlation results. Figure 6 For illustrative purposes only, the actual normalized cross-correlation result will not be as straight as shown in the diagram. When the normalized cross-correlation result γ at adjacent positions within the target region drops sharply from near 1 to far from 1, the location of this sharp drop is recorded; this location is the edge position. Observation reveals that the similarity drops sharply around index i = 1495. It should be noted that because the number of rows in the first comparison image m is row = ceil(Trow), the edge position should be around 1495 + ceil(Trow) - 1 = 1654. Figure 7 As shown by the black dashed line in the image.

[0059] Example 2:

[0060] Figure 4 The first periodic structure 301 in the image is the target structure image, and its periodic variation direction is parallel to the edge of the target region. Therefore, in order to reduce computation time, the... Figure 4 (a) in the middle, that is Figure 8 In step (a), dimensionality reduction is performed, and the target region is divided into N equal parts along the direction perpendicular to the periodic change. The average gray value of each part is obtained, and the distribution of the average gray value is as follows. Figure 8 As shown in (b) above, the normalized cross-correlation result of the periodic image and the second contrast image with respect to the gray-scale average distribution is then calculated. The specific details are as described in the invention description and will not be repeated here. The distribution of edge positions calculated using this example differs from that in Example 1, as detailed below. Figure 9 As shown, the solid line corresponds to Example 1, and the dashed line corresponds to Example 2. The edge position obtained through Example 2 is located at row 1493 + 159 = 1652, which is slightly different from the result in Example 1 (row 165). Figure 9 This is for illustrative purposes only; in reality, the normalized results will not be as straight as shown in the diagram. Figure 9 The difference between (a), (b), and (c) lies in the different accuracy requirements for the normalized cross-correlation results.

[0061] Technical Solution 3:

[0062] When the edge position in the target region is not parallel to any side edge of the target region, such as Figure 10 As shown. The periodic image f is determined by referring to... Figure 10 The white frame in the middle and Figure 11In (c), the periodic image f has two directions of periodic change, and the two periods of the periodic image f are Trow = 159.1102 and Tcol = 265.1917, respectively. Because the period of the first comparison image m needs to be slightly larger than that of the periodic image f, the two corresponding periods of the first comparison image m are row1 = ceil(Trow) + 1 = 161 and col1 = ceil(Tcol) + 1 = 267, respectively; the first comparison image m refers to... Figure 11 In (b), because there is a phase difference between the first contrast image m and the periodic image f, a second contrast image t with the same phase as the periodic image f is obtained by interpolating the first contrast image m. The period of the second contrast image t is row2 = ceil(Trow) = 160 and col2 = ceil(Tcol) = 266. The second contrast image t is as follows: Figure 11 As shown in (d) in the formula. Calculate the normalized cross-correlation result γ between the second contrast image t and the periodic image m. i,j Assume that the index i of the first row of pixels in the target region along the direction indicated by y is 1, and the index j of the first row of pixels along the direction indicated by x is also 1. If a periodic image f is selected starting from the first row along the direction indicated by y, then the next periodic image f should slide 20 pixels from the first row of pixels along the direction indicated by y, and the index i becomes 21. The next periodic image f should continue to slide 20 pixels along the direction indicated by y, and its index i becomes 41, and so on, with the index i of the periodic image f along the direction indicated by y gradually increasing. If a periodic image f is selected starting from the first row along the direction indicated by x, then the next periodic image f should slide 20 pixels from the first row along the direction indicated by x, and its index j becomes 21. The next periodic image f should continue to slide 20 pixels along the direction indicated by x, and its index j becomes 41, and so on. The index j corresponding to the periodic image f along the direction indicated by x gradually increases until the entire image is traversed.

[0063] The normalized cross-correlation result γ i,j The changes with the periodic image f are referenced. Figure 12 (a) in the middle, Figure 12 The normalized cross-correlation value γ in (a) refers to the normalized cross-correlation result γ. i,j The normalized cross-correlation result γ corresponding to adjacent positions within the target region. i,jWhen the value drops abruptly from close to 1 to far from 1, the indices i and j corresponding to this drop are recorded. Since the number of rows in the second comparison image t is row = ceil(Trow) and the number of columns is col = ceil(Tcol), the actual calculated indices i and j need to be increased by ceil(Trow) - 1 and ceil(Tcol) - 1, respectively. Finally, the edge position is obtained as follows: Figure 12 As shown by the thick black line in the image.

[0064] Example 1's technical solution is applicable to edges parallel to the target area's edge, i.e., both horizontal and vertical. Example 2 is also applicable to edges parallel to the target area's edge. The advantage of Example 2 is its faster calculation speed, but its disadvantage is that the average gray values ​​of the two different periodic structures must be dissimilar; otherwise, the edge location cannot be found. Example 3 is applicable to edges of arbitrary shapes, but its disadvantages are high computational cost and slow calculation speed. However, this can be accelerated by using a conventional image pyramid algorithm to first quickly calculate a rough boundary edge, and then calculate a finer boundary edge near the rough edge, thus achieving fast calculation. In this application, the term "periodically changing direction" refers to a direction parallel to the edge of the target area and exhibiting periodic changes.

[0065] To ensure clarity and completeness of the invention, the "interpolation processing" described herein is explained in detail. Assume the length y1 of the periodic image f along the periodically varying direction is i to i+ceil(Trow)-1 rows and pixels, and the length y2 of the first comparison image m along the periodically varying direction is 1 to ceil(Trow)+1 rows and pixels. Interpolation processing is performed on the first comparison image m to obtain a second comparison image t with the same size and phase as the periodic image f. Specifically, the length y3 of the second comparison image t along the periodically varying direction falls within the range of 1 to ceil(Trow)+1, and includes both of these endpoints. Based on y3 = y1 - n*Trow, a suitable n is obtained, resulting in a second comparison image t with a sub-pixel level distribution. The phase of the second comparison image t is consistent with the period of the periodic image f. The value of n changes following the value of y3.

[0066] Based on the edge position detection method provided in any of the above embodiments, the present invention provides an edge position detection device, such as... Figure 13As shown, an edge location detection method as described in any of the above embodiments includes: an acquisition module 1301, an interpolation processing module 1302, a normalization processing module 1303, and an edge location acquisition module 1304; the acquisition module 1301 includes a first acquisition unit 13011, a second acquisition unit 13012, a third acquisition unit 13013, and a fourth acquisition unit 13014; the first acquisition unit 13011 is used to acquire a target region, the target region containing at least two structural images and edge locations, the edge locations being boundary lines between different structural images, and at least one side of the edge location being an image with a periodic structure, the periodic structure including a plurality of repeating periodic units; the second acquisition unit 13012 is used to select at least one periodic structural image among the structural images as a target structural image, and determine that the periodic structure in the target structural image is... The direction of periodic change; the third acquisition unit 13013 is used to sequentially select a plurality of periodic images along the direction of periodic change within the target area, the periodic images including at least one periodic unit in the target structure image; the fourth acquisition unit 13014 is used to select a first comparison image in the target structure image, the length of the first comparison image along the direction of periodic change is greater than the length of the periodic image along the direction of periodic change; the interpolation processing module 1302 is used to perform interpolation processing on the first comparison image to obtain a second comparison image that is consistent with the periodic image in both phase and size; the normalization processing module 1303 is used to obtain the normalized cross-correlation result between the periodic image and the corresponding second comparison image; the edge position acquisition module 1304 is used to obtain the edge position according to the normalized cross-correlation result.

[0067] Its beneficial effect is that the edge position detection device provided by the present invention can obtain the detection result of the edge position with low training cost.

[0068] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding unit module, and will not be repeated here.

[0069] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of this application should be covered within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be determined by the protection scope of the claims.

Claims

1. An edge position detection method, characterized in that, include: S1. Obtain a target region, the target region containing at least two structural images and edge positions, the edge positions being the boundary lines between different structural images, and at least one side of the edge position being an image of a periodic structure, the periodic structure including a plurality of repeating periodic units; S2. Select at least one periodic structure image from the structure images as the target structure image, and determine the direction in which the periodic structure in the target structure image changes periodically; S3. Within the target area, along the direction of the periodic change, a number of periodic images are selected sequentially, each periodic image including at least one periodic unit in the target structure image; S4. Select a first comparison image from the target structure image, wherein the length of the first comparison image along the direction of the periodic change is greater than the length of the periodic image along the direction of the periodic change. S5. Interpolate the first comparison image to obtain a second comparison image that is consistent with the phase and size of the periodic image; S6. Obtain the normalized cross-correlation result between the periodic image and the corresponding second comparison image; S7. Obtain the edge position based on the normalized cross-correlation result, including: taking the position in the target region corresponding to the normalized cross-correlation result that satisfies the preset conditions as the edge position; When the normalized cross-correlation result corresponding to an adjacent position within the target area drops sharply from close to 1 to far from 1, the normalized cross-correlation result far from 1 satisfies the preset condition. The value of the normalized cross-correlation result close to 1 is 0.8 to 1, and the value of the normalized cross-correlation result far from 1 is 0 to 0.3 or below 0.

2. The edge position detection method according to claim 1, characterized in that, In step S3, a first initial position is selected within the target structure image; Along the direction of the periodic change, starting from the first initial position, several periodic images are selected sequentially at first preset lengths, where the first preset length is less than or equal to the length of the periodic image along the direction of the periodic change.

3. The edge position detection method according to claim 2, characterized in that, In S4, the length of the first comparison image along the direction of the periodic change is obtained by rounding up the numerical value of the length of the periodic image along the direction of the periodic change and then adding 1.

4. The edge position detection method according to claim 3, characterized in that, In step S6, the normalized cross-correlation result between the periodic image and the corresponding second contrast image is obtained using the following formula: ,in, The result is the normalized cross-correlation result between the periodic image and the corresponding second contrast image. The pixel value of the periodic image at any coordinate position. The average value of all pixel values ​​in the periodic image. This refers to the pixel value of the second comparison image at the corresponding coordinate position. This is the average value of all pixel values ​​in the second comparison image.

5. The edge position detection method according to claim 1, characterized in that, Before executing S6, the following is also included: When the target structure image shows a periodic change in only one direction, the target region is subjected to dimensionality reduction processing; The target region is divided into N equal parts along a direction perpendicular to the periodic change, and the average grayscale value of each part is obtained, where N is equal to the number of pixels in the target region along the direction of the periodic change.

6. The edge position detection method according to claim 5, characterized in that, In step S6, the normalized cross-correlation result between the periodic image and the corresponding second contrast image is obtained using the following formula: ,in, The normalized cross-correlation result between the periodic image and the corresponding second contrast image. The grayscale average value of the periodic image at any equal division point. The average grayscale value of the periodic image. The grayscale average of the second comparison image at the corresponding equal divisions is given. The grayscale average value of the second comparison image.

7. An edge position detection device, characterized in that, An edge location detection method for performing any one of claims 1 to 6 includes: an acquisition module, an interpolation processing module, a normalization processing module, and an edge location acquisition module; the acquisition module includes a first acquisition unit, a second acquisition unit, a third acquisition unit, and a fourth acquisition unit; The first acquisition unit is used to acquire a target region, the target region includes at least two structural images and edge positions, the edge positions are the boundary lines between different structural images, and at least one side of the edge position is an image of a periodic structure, the periodic structure including a plurality of repeating periodic units; The second acquisition unit is used to select at least one periodic structure image among the structure images as the target structure image, and to determine the direction in which the periodic structure in the target structure image changes periodically; The third acquisition unit is used to sequentially select a number of periodic images along the direction of periodic change within the target area, wherein the periodic images include at least one periodic unit in the target structure image; The fourth acquisition unit is used to select a first comparison image in the target structure image, wherein the length of the first comparison image along the direction of the periodic change is greater than the length of the periodic image along the direction of the periodic change. The interpolation processing module is used to perform interpolation processing on the first comparison image to obtain a second comparison image that is consistent with the phase and size of the periodic image; The normalization processing module is used to obtain the normalized cross-correlation result between the periodic image and the corresponding second comparison image; The edge location acquisition module is used to acquire the edge location based on the normalized cross-correlation result, including: the location in the target area corresponding to the normalized cross-correlation result that satisfies the preset condition is the edge location; when the normalized cross-correlation result corresponding to an adjacent location in the target area drops sharply from close to 1 to far from 1, the normalized cross-correlation result far from 1 satisfies the preset condition, where close to 1 includes a value of 0.8 to 1 for the normalized cross-correlation result, and far from 1 includes a value of 0 to 0.3 or less for the normalized cross-correlation result.

Citation Information

Patent Citations

  • Edge detection method and device, computer device and storage medium

    CN110223309A

  • Dynamic positioning method and system for detection area of long-period sequence image

    CN114648583A