A sub-pixel positioning method for target center in visual measurement

Through the combination of biharmonic interpolation and Gaussian weight function, the problem of inaccurate positioning caused by the brightness saturation of the infrared light source image in visual measurement is solved, high-precision sub-pixel level target center positioning is achieved, and the anti-interference ability and robustness are improved.

CN114565565BActive Publication Date: 2024-08-27SHANXI ZHIDIAN TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210128326.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-11
Publication Date
2024-08-27
Estimated Expiration
2042-02-11

AI Technical Summary

Technical Problem

In visual measurement, infrared active light source image target center positioning often encounters brightness saturation problems, resulting in inaccurate positioning. Especially in defocused imaging systems, edge fitting methods cannot be used, and Gaussian surface fitting cannot be accurately fitted. The problem of saturated light spots.

Method used

The biharmonic interpolation method is used to subdivide pixels in the target spot area of ​​interest, combined with the Sobel operator to extract edge pixels, ellipse fitting and grayscale voting statistics to screen effective pixels, and the Gaussian weight function and distance weight function are used to combine and position the weighted centroid. The algorithm calculates the target center coordinates.

Benefits of technology

It achieves high-precision sub-pixel level positioning of the center of the target light spot, improves anti-interference ability, and is suitable for a variety of visual measurement environments, especially the accuracy and robustness in large-diameter light spots and complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114565565B
    Figure CN114565565B
Patent Text Reader

Abstract

The present invention discloses a method for sub-pixel positioning of the center of a visual measurement target, that is, a method for high-precision center positioning of a target light spot in an edge-blurred center oversaturated state, which solves the problem that the defocus imaging system cannot use the edge fitting center positioning algorithm, and the Gaussian surface fitting cannot accurately fit the oversaturated light spot. The present invention accurately locates and screens the edge area of ​​the target light spot to obtain the effective calculation area of ​​the central oversaturated light spot, and uses the Gaussian weight function and the distance weight function to compound to obtain the influence factor provided by each effective pixel on the center positioning. According to the idea of ​​the weighted centroid positioning algorithm, the target center positioning is obtained in combination with the pixel influence factor calculation. The present invention has high precision, strong anti-interference ability, is less affected by noise, and is suitable for a variety of visual measurement environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision and visual measurement technology, and in particular to a method for sub-pixel positioning of a center of a visual measurement target, which realizes high-precision center positioning under the condition of blurred target edges and saturated brightness. Background Art

[0002] The target center positioning algorithm is widely used in many fields such as three-dimensional reconstruction, visual measurement and aerospace vehicle attitude measurement in machine vision. The accuracy of target positioning plays a decisive role in the final measurement result. In visual measurement, there are three commonly used targets: infrared active light source, artificial retroreflective mark and morphological feature points of the object being measured. Infrared active light source is widely used in various visual measurement systems due to its unique stability and good anti-interference ability. The present invention mainly aims at the brightness saturation problem encountered when locating the target center of an infrared light source image, and provides a method for calculating the sub-pixel coordinates of the target center based on the edge area of ​​the target light spot.

[0003] Currently, object recognition in the field of visual measurement is mainly divided into two categories.

[0004] The first type is an ellipse fitting method based on edge information, which is suitable for the center positioning of artificial retro-reflective mark targets in the focus imaging system. This type of measurement system has poor real-time performance. For large workpieces over 10 meters, only offline measurement can be used. In addition, the retro-reflective mark is seriously affected by ambient light and is not suitable for outdoor measurement. The edge-based center positioning algorithm has the following shortcomings in practical applications: 1) The preparation work before measurement and the cleaning work after measurement are complicated; due to the use of artificial retro-reflective marks, the reflective marks must be pasted on the surface of the workpiece to be measured before measurement. In order to ensure the measurement accuracy, a large number of reflective marks are often required. This also brings a lot of trouble to the cleaning work after the measurement is completed. 2) The application scenario is limited; if the accuracy of industrial measurement level is to be achieved, it is necessary to ensure that the target edge imaging is clear and stable, which means that the measurement can only be carried out in a relatively stable environment indoors. 3) The measurement process is very time-consuming; in order to ensure clear imaging, the shooting distance is usually kept in the range of 3 to 5 meters. For large workpieces, measurement personnel are required to take hundreds or thousands of images from different angles to obtain measurement results of ideal accuracy. 4) Poor anti-interference ability: The imaging of artificial retroreflective signs is seriously affected by ambient light, and excessive shooting angles will also lead to unclear imaging.

[0005] The second category is based on the grayscale distribution of the target for fitting, mainly including grayscale centroid method, weighted grayscale method, Gaussian surface fitting method and other algorithms. Methods based on grayscale distribution are mostly used in defocus imaging systems, and the target used is an infrared active light source. This type of measurement system can measure ultra-large workpieces online and can cope with complex outdoor measurement environments. The center positioning algorithm based on grayscale distribution also has the following shortcomings: 1) It is difficult to unify the brightness of the target spot; the distance between different targets during the measurement process is far, resulting in different brightness of the image under the same exposure. It is easy for the brightness of the distant target to be too small while the brightness of the nearby target is too high, resulting in overexposure of the image, making the center positioning of the target inaccurate. 2) High grayscale distribution requirements; all information based on grayscale methods comes from the grayscale distribution of pixels during positioning. For the same target, a slight change in grayscale distribution may lead to very different center positioning results. Summary of the invention

[0006] The purpose of the present invention is to provide a high-precision center positioning method for a target light spot in an edge-blurred center oversaturated state, which is used to solve the problem that a defocused imaging system cannot use an edge fitting center positioning algorithm, and that Gaussian surface fitting cannot accurately fit an oversaturated light spot.

[0007] The present invention is achieved by adopting the following technical solutions:

[0008] A method for sub-pixel positioning of a target center by visual measurement comprises the following steps:

[0009] Step 1: Determine the target spot area of ​​interest.

[0010] Step 2: Use the biharmonic interpolation method to subdivide the region of interest into pixels. The interpolation formula used is:

[0011] I p =G p W (1)

[0012] Where, the subscript p is the number of the interpolation point to be found; G in formula (1) p is a 1×k-order Green function matrix, and the calculation formula is:

[0013] G p =[d 01 d 02 ...d 0k ] (2)

[0014] The element d in formula (2) is the interpolation kernel function, and the specific calculation formula is:

[0015]

[0016] In formula (3) In formula (1), W is the weight matrix, and the calculation formula is:

[0017] W=G -1 Z (4)

[0018] Among them, Z is a k×1-order attribute vector, which consists of all pixel values ​​Z=[z1 z2 ... z k ] T

[0019] G is a k×k Green function matrix, such as:

[0020]

[0021] The calculation formula of the element d in the matrix of formula (5) is as shown in formula (3);

[0022] Substitute equations (2) to (5) into equation (1) to calculate the pixel value of the interpolation point.

[0023] Step 3: First, use the Sobel operator to obtain the gradient and amplitude of all pixels in the x and y directions; if the gradient amplitude of a pixel is a maximum in its normal direction, the pixel is judged to be an edge pixel, otherwise it is set to zero; the edge pixel coordinates are recorded as (x i ,y i ), i = 1, ..., k, and then calculate the compensation value of each edge pixel according to the following formula:

[0024]

[0025] Where i is the selected edge pixel index, |g x | and |g y | represents the gradient value in the x and y directions, ||g(x,y)|| is the gradient amplitude of the pixel (x,y); the compensation value obtained by formula (6) is added to the edge pixel coordinate to obtain the sub-pixel edge coordinate (x i +η x ,y i +η y ), these points are where the gradient changes are the largest in the edge area of ​​the target spot.

[0026] Step 4: Fit the edge point ellipse obtained in step 3, and then select [0.9r max ,1.1r max ] constitute the candidate pixel set {PixelTBS}.

[0027] Step 5: Perform grayscale voting statistics on the grayscale values ​​of the target light spot area of ​​interest to obtain a grayscale value statistical series {GrayStatic}.

[0028] Step 6: Derivative the series {GrayStatic} obtained in step 5, and select the gray value I corresponding to the maximum statistical value according to the following constraints: max1 The gray value I corresponding to the second largest statistical value max2 :

[0029] |I max1 -I max2 |>150 (7).

[0030] Step 7: I obtained by screening in step 6 max1 and I max2 Find the gray value with a statistical percentage greater than 1% nearby, and compare it with I max1 ,I max2 The background threshold value array {Th_Background_GrayValues} and the center area threshold value array {Th_Center_GrayValues} are formed; the background threshold value and the center area threshold value are obtained by the following calculation formula:

[0031]

[0032] Step 8: The candidate pixel set {PixelTBS} obtained in step 4 is screened using the two thresholds obtained in step 7. All pixels within the threshold range (Th_Ibg<I m <Th_Icen) form a set {Valid_Pixel}, which participates in the subsequent center coordinate calculation, and the grayscale values ​​of pixels that are not within the threshold range are set to zero.

[0033] Step 9: Calculate the distance weight factor W of each valid pixel using the effective pixel {Valid_Pixel} in step 8 and the distance in the gradient direction of the edge point calculated using formula (6) in step 3 di (i=1,...,k); the distance weight factor is calculated as follows:

[0034]

[0035] Where dist is the distance from pixel i to the sub-pixel edge.

[0036] Step 10: Use a two-dimensional discrete Gaussian function to fit the valid pixel set {Valid_Pixel} obtained in step 8, and calculate the grayscale weight factor W of each valid pixel based on the obtained fitting parameters. gi (i=1,...,k); the two-dimensional Gaussian fitting function used is:

[0037]

[0038] Use equation (11) as the objective function for nonlinear optimization and obtain W gi (i=1,...,k) optimal solution; the specific calculation formula is:

[0039]

[0040] Among them, I i is the grayscale value of pixel i=1,...,k.

[0041] Step 11: Set the pixel gray value I i And the grayscale weight factor W calculated in step 10 gi Compound and get the new impact factor λ i , the composite formula is:

[0042]

[0043] Step 12: Substitute the influence factor calculated in step 11 into formula (13) to calculate the target spot center position (x c ,y c ):

[0044]

[0045] The present invention uses a high-precision biharmonic interpolation algorithm to perform high-precision and fast interpolation on the target light spot, and improves the edge positioning and center positioning of the light spot to the sub-pixel level. By accurately positioning and screening the edge area of ​​the target light spot, the effective calculation area of ​​the central oversaturated light spot is obtained. The Gaussian weight function is compounded with the distance weight function to obtain the influence factor provided by each effective pixel on the center positioning. According to the idea of ​​the weighted centroid positioning algorithm, the positioning coordinates closer to the real target center can be calculated in combination with the pixel influence factor, which solves the problem of truncation error in the target center positioning caused by the presence of oversaturated pixels in the center of some light spots due to large differences in target brightness.

[0046] The invention has a reasonable design, and its center positioning accuracy for a large-diameter light spot is significantly better than that of a Gaussian surface fitting algorithm. It also has strong anti-interference capability, is less affected by noise, has good robustness, and is suitable for a variety of visual measurement environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It represents the spot interest area in the embodiment of the present invention.

[0048] Figure 2 represents the Sobel operator in the embodiment of the present invention.

[0049] Figure 3 A schematic diagram showing a comparison between the results of the embodiment of the present invention and the prior art. DETAILED DESCRIPTION

[0050] The present invention is explained in detail below with reference to a specific example, and a horizontal comparison is made between the existing literature [2] and the Gaussian surface fitting method to illustrate the beneficial effects of the present invention.

[0051] The embodiment of the present invention uses a simulated light spot. The simulated camera parameters are selected from the Basler A102f industrial camera, with a resolution of 1392×1040 and a lens focal length of f=12 mm. The MATLAB scientific computing software is used to verify the relevant algorithm. The specific steps are as follows:

[0052] 1. Determine the target light spot interest area. The methods used include but are not limited to image filtering, threshold segmentation, target shape screening and other methods. The target light spot interest area finally obtained is as follows: Figure 1 shown.

[0053] The specific implementation of this embodiment is as follows: artificially set the nominal values ​​of the centers of 8 light spots, use the Gaussian light spot model combined with the defocus imaging model to generate 8 target light spots on the same image, add Gaussian noise with a signal-to-noise ratio of 50dB to the image, repeat adding 100 groups, and generate 100 groups of images. Obviously, each group of images contains 8 simulated target light spots. After binarizing the images, determine the approximate center coordinates of the 8 light spots based on the connected domain information of Matlab.

[0054] Second, for a target light spot, the grayscale information it contains is very limited. In order to maximize the use of the grayscale information of the target light spot, the pixel subdivision technology is used to interpolate the grayscale values ​​of two adjacent pixels to minimize the quantization error. The present invention uses the biharmonic interpolation method (specific reference [1]: Deng X, Tang Z. Moving surface spline interpolation based on Green's function [J]. Mathematical geosciences, 2011, 43 (6): 663-680.) to subdivide the pixel of the region of interest. Compared with the widely used cubic spline interpolation, this method has higher interpolation accuracy and shorter calculation time. The interpolation formula used is:

[0055] I p =G p W (1)

[0056] The subscript p is the number of the interpolation point to be sought.

[0057] In formula (1), G p is a 1×k-order Green function matrix, and the calculation formula is:

[0058] G p =[d 01 d02 ...d 0k ] (2)

[0059] The element d in formula (2) is the interpolation kernel function, and the specific calculation formula is:

[0060]

[0061] In formula (3) In formula (1), W is the weight matrix, and the calculation formula is:

[0062] W=G -1 Z (4)

[0063] Z is a k×1-order attribute vector, consisting of all pixel values ​​Z=[z1 z2 ... z k ] T ;

[0064] G is a k×k Green function matrix, which is as follows:

[0065]

[0066] The calculation formula of the element d in the matrix is ​​as shown in formula (3);

[0067] Substituting equations (2) to (5) into equation (1) can calculate the pixel value of the interpolation point.

[0068] Specifically, for the cth target spot in the pth image, select the area of ​​(31×31) pixels around each coordinate as the calculation window, and mark the pixel coordinate of the upper left corner of the window as The coordinate value is the global offset of the target spot center coordinate. The grayscale values ​​of the spot pixels in the window window are biharmonic interpolated to obtain the area to be calculated roi_interp of (121×121)pixel=14641pixel.

[0069] 3. In order to select appropriate edge pixels for center positioning, it is necessary to perform sub-pixel edge extraction on the spot target and determine the effective edge area. Prior art document [2] (Shi Dashun, Tang Chao. Circular spot center positioning method based on statistical Gaussian fitting [J]. Measurement and Control Technology, 2020, 39(7): 51-56.) uses the Canny algorithm to extract the edge of the circular spot. However, since the target spot of the present invention is defocused imaging, clear edge imaging cannot be obtained. Therefore, the use of the method in document [2] will result in large edge deviations. The present invention first uses the Sobel operator to obtain the gradient and amplitude of all pixels in the x and y directions. Figure 2The Sobel operator in the vertical and horizontal directions is given as an example. If the gradient amplitude of a pixel is the maximum value in its normal direction, the pixel is judged to be an edge pixel, otherwise it is set to zero. The edge pixel coordinates are recorded as (x i ,y i ), i = 1, ..., k, and then calculate the compensation value of each edge pixel according to the following formula:

[0070]

[0071] Where i is the selected edge pixel index, |g x | and |g y | represents the gradient value in the x and y directions, and ||g(x,y)|| is the gradient amplitude of the pixel (x,y). Add the compensation value obtained by equation (6) to the edge pixel coordinate to obtain the sub-pixel edge coordinate (x i +η x ,y i +η y ), these points are where the gradient changes are the largest in the edge area of ​​the target spot.

[0072] Specifically, the present embodiment uses the Sobel operator to calculate the gradient amplitude of all pixels in roi_interp, and takes the maximum value of the pixel gradient direction as the integer part of the edge pixel coordinate, which is recorded as Where ei=1,K,N edge Indicates that there are N edge The pixels are edge pixels. For edge pixels ei, the compensation value (η) is calculated according to formula (6) x ,η y ), the compensation value and the integer part of the edge pixel coordinates Add together to get the final sub-pixel edge coordinates

[0073] Fourth, fit the edge point ellipse obtained in step 3, and then select [0.9r max ,1.1r max ] constitute the candidate pixel set {PixelTBS}.

[0074] In this embodiment, the least square fitting method is used to fit all edge points in the region roi_interp, and the fitting function is the elliptic function ax 2 +by 2 +cxy+dx+ey+f=0, we get the parameters of the ellipse (a, b, c, d, e, f) and calculate the center (x ellip ,y ellip ) and the major axis radius r max , calculate the interpolation of all pixels in the region roi_interp and the center of the ellipse (xellip ,y ellip ) Select | d j -r max |<0.1r max The pixels are put into the candidate pixel set {PixelTBS}.

[0075] 5. Perform grayscale voting statistics on the grayscale values ​​of the target light spot area of ​​interest to obtain the grayscale value statistical series {GrayStatic}.

[0076] 6. Derivative the series {GrayStatic} obtained in step 5, and select the gray value I corresponding to the maximum statistical value according to the following constraints: max1 The gray value I corresponding to the second largest statistical value max2 :

[0077] |I max1 -I max2 |>150 (7)

[0078] 7. I obtained by screening in step 6 max1 and I max2 Find the gray value with a statistical percentage greater than 1% nearby, and compare it with I max1 ,I max2 The background threshold value array {Th_Background_GrayValues} and the center area threshold value array {Th_Center_GrayValues} are formed. The background threshold value and the center area threshold value are obtained by the following calculation formula:

[0079]

[0080] The specific implementation of this embodiment is as follows: the number of gray values ​​of pixels in roi_interp is counted. Since the image sensor is 8-bit, the gray value is an integer from 0 to 255. The gray values ​​of interval 1 are counted to obtain the sequence {GrayStatic} = {N1, ..., N 255}. Sort {GrayStatic} in descending order and put the gray value with the largest gray value count I max1 Recorded as the first threshold, find the gray value count that satisfies |I max1 -I max2 The second gray value with the largest gray value count I max2 , assuming I max1 <I max2 . Select the gray value count N vl >0.01×14641≈146, all gray values ​​I of (vl=1,...,255) vl , will|I max1 -Ivl Gray value I of |<20 vl with I max1 Recorded together as the background threshold series {Th_Background_GrayValues}, |I max2 -I vl Gray value I of |<20 vl with I max2 The center area threshold value sequence {Th_Center_GrayValues} is recorded together. The background threshold value and the center threshold value are found according to formula (8).

[0081] 8. The candidate pixel set {PixelTBS} obtained in step 4 is screened using the two thresholds obtained in step 7. All pixels within the threshold range (Th_Ibg<I m <Th_Icen) form a set {Valid_Pixel}, which participates in the subsequent center coordinate calculation, and the grayscale values ​​of pixels that are not within the threshold range are set to zero.

[0082] The specific embodiment of this invention is: for all (x j ,y j )∈{PixelTBS}, if Th_Ibg <I(x j ,y j )<Th_Icen, then the pixel (x j ,y j ) is recorded as effective pixel (x sj ,y sj ), forming a valid pixel set {Valid_Pixel}.

[0083] 9. Calculate the distance weight factor W of each valid pixel using the distance between the valid pixel {Valid_Pixel} in step 8 and the edge point calculated using formula (6) in step 3 in the gradient direction di (i=1,...,k). It is mainly to eliminate the influence of the following two factors: first, the influence of factors such as inevitable stray light in the environment and noise generated by electronic devices of the measuring equipment. The pixels in the target light spot that are closer to the background area are more affected by noise. When calculating the target center, the weight of these pixels should be smaller; second, the pixels in the center area of ​​the target light spot are oversaturated. Due to the "crosstalk" phenomenon between photosensitive components, saturated pixels will have a certain impact on adjacent pixels, so the weight of these affected pixels participating in the center calculation should also be smaller. The calculation formula of the distance weight factor is:

[0084]

[0085] dist is the distance from pixel i to the sub-pixel edge.

[0086] In this embodiment, for a pixel (x sj ,y sj ), connect(x sj ,y sj ) and the ellipse center (x ellip ,y ellip ) The line segment (or the extended line segment) intersects the circumference of the ellipse at point (x int ,y int ), calculate (x int ,y int ) and (x sj ,y sj ) Get pixel (x sj ,y sj )’s distance weight factor:

[0087] 10. Use a two-dimensional discrete Gaussian function to fit the valid pixel set {Valid_Pixel} obtained in step 8. The prior art document [2] directly uses a Gaussian function to fit the grayscale distribution to calculate the center of the target spot, but the spot diameter used is large and the edge is clear, which is not effective for the defocused spot used in the present invention. The present invention can calculate the grayscale weight factor W of each valid pixel based on the obtained fitting parameters. gi (i=1,...,k), on the one hand, it avoids the problem of "the poor accuracy and robustness of Gaussian surface fitting for large diameter target spot" pointed out in the existing technical literature [3] (Hao Yingming, Shu Feng, etc. Analysis of the influence of target center positioning method on posture measurement results [J]. Journal of Scientific Instrument, 2007, 28(4):1-6.), and on the other hand, it can filter out the influence of random noise on subsequent center positioning. The two-dimensional Gaussian fitting function used is:

[0088]

[0089] Using formula (11) as the objective function for nonlinear optimization, we can obtain W gi (i=1,...,k) optimal solution. Due to the reasons mentioned in step nine, the present invention adds a distance weight factor to the optimization objective function to ensure that the pixel with a larger gradient has a greater impact on the fitting result, and the pixel closer to the edge and saturation position has a smaller impact on the fitting result. The specific calculation formula is:

[0090]

[0091] Among them, I i is the grayscale value of pixel i=1,...,k.

[0092] Specifically, this embodiment uses a two-dimensional Gaussian function to perform surface fitting on pixels in the effective pixel set {Valid_Pixel}. The two-dimensional Gaussian function is: Where W gsi is the pixel (x sj ,y sj ) is the grayscale weight factor, let the parameter The initial value is 1, and the LM nonlinear optimization method is used to find the optimal parameter value. The objective function is: Where k is the number of effective pixels, W dsj is the calculated pixel (x sj ,y sj ) is the distance weight factor.

[0093] 11. Using the idea of ​​weighted centroid method, the pixel gray value I i And the grayscale weight factor W calculated in step 10 gi Compound and get the new impact factor λ i , the composite formula is:

[0094]

[0095] In this embodiment, the pixel (x sj ,y sj ) gray value I sj And the grayscale weight factor W of the pixel calculated gsi Calculate the pixel (x sj ,y sj )’s composite weight factor:

[0096] 12. Substitute the influence factor calculated in step 11 into formula (13) to calculate the center position of the target spot

[0097] In this embodiment, the center coordinates of the target spot window are calculated according to the following formula:

[0098] The position of the center coordinate in the entire image needs to be added with the offset of the spot window in the image. Therefore, the final sub-pixel center coordinates of the target spot in the entire image are:

[0099] 13. Store the result of step 12 into the register, and then repeat steps 2 to 12 for the next target light spot of the current image to determine the image coordinates of the next target light spot. After the center positioning of all 8 target light spots is completed, the center positioning of the target light spots on the remaining images is performed in the same way until all 100 groups of images are completed.

[0100] The above process was programmed in MATLAB software to implement algorithm verification, and the total time required to complete 100 sets of images was 11.44 seconds. In comparison, the total time required for the Gaussian surface fitting algorithm was 12.52 seconds, and the total time required for the method provided by reference [2] was 15.41 seconds. It can be found that the total time required for the three methods is not much different.

[0101] In order to verify the implementation accuracy of the method of the present invention, the positioning results of the three methods for the same image spot are shown in Figure 3 The nominal value of the light spot is represented by a black cross. The accuracy of the target light spot center positioning used in the present invention is significantly better than that of the other two methods, and the repeatability of the 100 results is also better.

[0102] In summary, the present invention accurately locates and screens the edge area of ​​the target spot to obtain the effective calculation area of ​​the central oversaturated spot, and uses the Gaussian weight function and the distance weight function to compound to obtain the influence factor provided by each effective pixel on the center positioning. According to the idea of ​​the weighted centroid positioning algorithm, the target center positioning is obtained by combining the pixel influence factor calculation. The present invention has high precision, strong anti-interference ability, is less affected by noise, and is suitable for a variety of visual measurement environments.

[0103] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although detailed description is given with reference to the embodiments of the present invention, a person skilled in the art should understand that the protection scope of the method of the present invention is not limited to the application in infrared target light recognition, and the recognition method of the controllable light source invented based on the principle of the present method, whether it is equivalent transformation or improvement, should not be excluded from the protection scope of the present invention.

Claims

1. A method for sub-pixel positioning of a target center by visual measurement, characterized in that: The steps include: Step 1: Determine the target spot area of ​​interest; Step 2: Use the biharmonic interpolation method to subdivide the region of interest into pixels. The interpolation formula used is: I p =G p W (1) Where, the subscript p is the number of the interpolation point to be found; G in formula (1) p is a 1×k-order Green function matrix, and the calculation formula is: G p =[d 01 d 02 ... d 0k ] (2) The element d in formula (2) is the interpolation kernel function, and the specific calculation formula is: In formula (3) In formula (1), W is the weight matrix, and the calculation formula is: W=G -1 Z (4) Among them, Z is a k×1-order attribute vector, which consists of all pixel values ​​Z=[z1 z2 ... z k ] T G is a k×k Green function matrix, such as: The calculation formula of the element d in the matrix of formula (5) is as shown in formula (3); Substitute equations (2) to (5) into equation (1) to calculate the pixel value of the interpolation point; Step 3: Use the Sobel operator to obtain the gradient and amplitude of all pixels in the x and y directions; if the gradient amplitude of a pixel is a maximum in its normal direction, the pixel is judged to be an edge pixel, otherwise it is set to zero; the edge pixel coordinates are recorded as (x i ,y i ), i = 1, ..., k, and then calculate the compensation value of each edge pixel according to the following formula: Where i is the selected edge pixel index, |g x | and |g y | represents the gradient value in the x-direction and y-direction, ||g(x,y)|| is the gradient amplitude of the pixel (x,y); the compensation value obtained by formula (6) is added to the edge pixel coordinate to obtain the sub-pixel edge coordinate (x i +η x ,y i +η y ), these points are where the gradient changes are the largest in the edge area of ​​the target spot; Step 4: Fit the edge point ellipse obtained in step 3, and then select [0.9r max ,1.1r max ] constitute the pixel set to be selected {PixelTBS}; Use the least squares fitting method to fit all edge points in the region roi_interp, and the fitting function is the elliptic function ax 2 +by 2 +cxy+dx+ey+f=0, we get the parameters of the ellipse (a, b, c, d, e, f) and calculate the center (x ellip ,y ellip ) and the major axis radius r max , calculate the interpolation of all pixels in the region roi_interp and the center of the ellipse (x ellip ,y ellip ) Select | d j -r max |<0.1r max The pixels are put into the candidate pixel set {PixelTBS}; Step 5: Perform grayscale voting statistics on the grayscale values ​​of the target light spot area of ​​interest to obtain a grayscale value statistical series {GrayStatic}; Step 6: Derivative the series {GrayStatic} obtained in step 5, and select the gray value I corresponding to the maximum statistical value according to the following constraints: max1 The gray value I corresponding to the second largest statistical value max2 : |I max1 -I max2 |>150 (7) Step 7: I obtained by screening in step 6 max1 and I max2 Find the gray value with a statistical percentage greater than 1% nearby, and compare it with I max1 ,I max2 The background threshold value array {Th_Background_GrayValues} and the center area threshold value array {Th_Center_GrayValues} are formed; the background threshold value and the center area threshold value are obtained by the following calculation formula: Step 8: The candidate pixel set {PixelTBS} obtained in step 4 is screened using the two thresholds obtained in step 7. All pixels within the threshold range (Th_Ibg<I m <Th_Icen) form a set {Valid_Pixel}, which participates in the subsequent center coordinate calculation, and the grayscale values ​​of pixels that are not within the threshold range are set to zero; Step 9: Calculate the distance weight factor W of each valid pixel using the effective pixel {Valid_Pixel} in step 8 and the distance in the gradient direction of the edge point calculated using formula (6) in step 3 di (i=1,...,k); the distance weight factor is calculated as follows: Where dist is the distance from pixel i to the sub-pixel edge; Step 10: Use a two-dimensional discrete Gaussian function to fit the valid pixel set {Valid_Pixel} obtained in step 8, and calculate the grayscale weight factor W of each valid pixel based on the obtained fitting parameters. gi (i=1,...,k); the two-dimensional Gaussian fitting function used is: Set parameters The initial value is 1; Use equation (11) as the objective function for nonlinear optimization and obtain W gi (i=1,...,k) optimal solution; the specific calculation formula is: Among them, I i is the gray value of pixel i=1,...,k; Step 11: Set the pixel gray value I i And the grayscale weight factor W calculated in step 10 gi Compound and get the new impact factor λ i , the composite formula is: Step 12: Substitute the influence factor calculated in step 11 into formula (13) to calculate the target spot center position (x c ,y c ):

Citation Information

Patent Citations

  • Free curve method vector measurement method based on binocular vision

    CN103913131A

  • Tikhonov regularization-based sub-pixel displacement measurement method

    CN107610102A

  • High-precision measuring method of laser triangulation

    CN108053441A

  • Image Processing System for Inspecting Object Distance and Dimensions Using a Hand-Held Camera with a Collimated Laser

    US20190266739A1