Checkerboard angular point positioning method based on fractal mask bilinear interpolation
By using the fractal mask bilinear interpolation method, combined with edge detection and grayscale integration, and iterative optimization based on fractal theory, the problem of large corner point localization error in high-quality checkerboard images was solved, achieving high-precision sub-pixel level corner point localization and improving the accuracy of camera calibration and 3D reconstruction.
Patent Information
- Application Number
- CN202511944213.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-02-10
AI Technical Summary
Existing camera calibration methods suffer from significant subpixel positioning errors in high-quality checkerboard images, especially under the interference of factors such as noise and uneven illumination, which affects calibration accuracy.
A method based on bilinear interpolation using fractal masks is adopted, which combines edge detection, gray-scale integration and iterative optimization of fractal theory to achieve sub-pixel-level accurate positioning of checkerboard corner points. This includes candidate corner point extraction, local edge direction determination, gray-scale integration processing, bilinear interpolation using fractal masks and gradient distribution calculation. Finally, the corner point coordinates are iteratively optimized through the minimum error function.
It significantly improves the robustness and accuracy of corner point localization, provides highly stable sub-pixel level corner point positions, provides a high-quality data foundation for tasks such as camera calibration and 3D reconstruction, and enhances the performance of vision measurement systems.
Smart Images

Figure CN121505048A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer vision, and more particularly to a chessboard corner point positioning method based on fractal mask bilinear interpolation. BACKGROUND
[0002] Camera calibration is a technique to determine the intrinsic and extrinsic parameters of a camera by calibrating an object, which is one of the important techniques in the field of computer vision and is widely used in three-dimensional reconstruction, autonomous driving, industrial manufacturing, distortion correction, etc. Black and white chessboard is a commonly used two-dimensional calibration object. Camera calibration solves camera parameters according to the relationship between known chessboard corner point coordinates and world coordinates, and the accuracy of corner point detection directly affects the subsequent solving of calibration parameters. Chessboard corner point detection algorithms are divided into three categories: gray centroid-based method, interpolation fitting-based method, and gradient-based method.
[0003] The gray centroid method locates feature points by calculating the weighted average of the gray value and the coordinates of each pixel in the local region. Cheng et al. combined the Canny edge detection operator with the Gaussian function and introduced a weighting mechanism in the gray centroid method. Liu et al. used the Hessian corner detector to obtain an initial set of corner points and used the gray centroid method to optimize the sub-pixel corner coordinates. Yang Xingfang based on the algorithm of "the number of pixel gray level jumps on the small neighborhood ring template" to realize the type recognition of corner points, and then used the gray centroid to realize the sub-pixel corner positioning. The gray centroid method will deviate from the center when the pixel gray value in the corner neighborhood image changes, so this method is sensitive to noise.
[0004] The interpolation fitting method is a method of interpolating the gray or gradient data around the image feature points and then determining the sub-pixel level accurate position through fitting mathematical models. Liu et al. estimated the corner position by fitting a Gaussian surface to the local region of the pixel-level corner. Niu et al. first used parabolic fitting to achieve sub-pixel level positioning of the edge, then analyzed the bending degree of the edge and used a cubic B-spline curve for further fitting, and finally realized the accurate detection of the corner. Liu et al. used the RANSAC algorithm to fit the light field circle domain features to screen the corner points, and used a quadratic function to fit the corner response map near each corner point to optimize it to the sub-pixel level. The fitting effect of the fitting method depends on the accuracy of the initial pixel-level corner coordinates and the completeness of the local data, and is easily affected by the fitting model.
[0005] Gradient-based methods utilize the rate of change of brightness and darkness of local pixels in an image and gradient statistics to optimize feature point coordinates for sub-pixel-level localization. Wang et al. initially located intersection points based on local gray-level responses and achieved sub-pixel-level localization by calculating local LOG responses. Zhu et al. determined candidate corner points by comparing the gray-level differences between the template center pixel and neighboring pixels to statistically identify gray-level similar regions, and then achieved sub-pixel optimization based on the theory of gray-level gradients from the corner point to its neighboring pixels. Wu et al. established a Gaussian weighted gradient window centered on the candidate points, constructing the gradient orthogonality error as the optimization objective to achieve sub-pixel-level corner point position optimization. Gradient-based methods typically use fixed-form weight functions such as Gaussian functions and linear interpolation to calculate the gray-level values of sub-pixel coordinate positions. This leads to a certain degree of loss of effective gray-level information around the corner points, and its accuracy decreases in areas with irregular textures.
[0006] In summary, current research focuses on overcoming noise in checkerboard corners or edge regions to improve camera calibration accuracy. However, in many industrial fields, capturing high-quality checkerboard images for camera calibration is a prerequisite. Therefore, this invention proposes a sub-pixel corner localization method based on fractal modulation mask interpolation to address the problem of large errors in sub-pixel localization in existing methods when performing sub-pixel localization in high-quality checkerboard image scenarios. Summary of the Invention
[0007] The purpose of this invention is to provide a checkerboard corner point localization method based on fractal mask bilinear interpolation. By fusing edge detection, grayscale integration and fractal theory for iterative optimization, sub-pixel level accurate localization of checkerboard corner points can be achieved.
[0008] To achieve the above objectives, the present invention provides the following technical solution: A method for locating corner points of a chessboard grid based on fractal mask bilinear interpolation includes the following steps: S1. Acquire a chessboard image using an image acquisition device, and extract candidate corner points from the chessboard image using an improved FAST algorithm; S2. Use edge detection algorithms to extract the local region edges of candidate corner points, and determine the orientation angles of the local region edges through polar coordinate transformation and clustering algorithms; S3. Based on the direction angle of the local region edge, the edge line is processed into sub-pixelation using the gray-scale integral method, and the edge line is fitted by the least squares method and the intersection point is calculated to initially locate the coordinates of the candidate corner point. S4. Within the neighborhood of the initially located candidate corner point coordinates, sub-pixel level gray values are obtained using bilinear interpolation with fractal mask, and the local gradient distribution is calculated. S5. Utilize local gradient distribution to dynamically generate weight masks based on fractal theory. Based on the principle of local gradient consistency at corner points, construct the minimum error function for the center point, iteratively optimize the coordinates of candidate corner points, and output sub-pixel level positions.
[0009] Further, in step S1, an image acquisition device is used to acquire a checkerboard image, and a candidate corner point is extracted from the checkerboard image using an improved FAST algorithm, specifically as follows: The characteristics of the checkerboard image are used to initially screen the candidate corner points, and the preliminary candidate corner points are obtained. The candidate corner points obtained from the initial screening are verified by the gray-level similarity of symmetrical points and the high contrast of neighboring points in the checkerboard image, and the final candidate corner points are extracted by combining the neighborhood adaptive threshold.
[0010] Furthermore, the judgment criteria for the preliminary screening of candidate corner points are as follows: (1) in, , These represent the grayscale value at the center of the template and the grayscale value on the circumference of the template, respectively. Indicates the neighborhood adaptive threshold. N The number of pixels; The expression for verifying the candidate corner points obtained from the initial screening, based on the gray-level similarity of symmetrical points and the high contrast of neighboring points in the checkerboard image, is as follows: (2) in, Candidate corner points The grayscale values of neighboring pixels on the circumference of the template. New grayscale values for candidate corner points To be with candidate corner points Symmetrical point The grayscale value.
[0011] Furthermore, the expression for the neighborhood adaptive threshold T is: (3) in, The minimum gray value of non-center points within the region. For adjustment coefficients, Variance of gray values within the neighborhood It is the average value within the neighborhood.
[0012] Furthermore, in step S2, the orientation angle of the local region edge is determined through polar coordinate transformation and clustering algorithm. The specific calculation formula is as follows: (4) in, Angle correction factor and The coordinates of each candidate corner point are respectively The direction vector relative to the center point.
[0013] Furthermore, the calculation formula for sub-pixelization of the edge lines using the gray-scale integral method in S3 is as follows: (5) in, Pixel-level grayscale values, It is the average of all sub-pixel grayscale values in the interval [0,1]. This represents a subpixel grayscale value.
[0014] Furthermore, in S3, the calculation formula for sub-pixelization of the edge line based on the direction angle of the local region edge using the gray-scale integral method is as follows: (6) in, Integral grayscale values for all pixels. For discrete grayscale values, Discrete grayscale values At the border The value at that location, Discrete grayscale values At the border The value at; The edge region is a gray-level abrupt change point. Let the sub-pixel coordinates of this gray-level abrupt change point be . c This yields the following expression: (7) Then the coordinates of the gray-scale abrupt change point are calculated. Sub-pixel coordinates along the axis for: (8) Then point Given the sub-pixel coordinates of the candidate corner points, after obtaining the sub-pixel edges in four directions of the candidate corner points, the least squares method is used to fit the edge lines and calculate the unique intersection point to initially locate the coordinates of the candidate corner points. .
[0015] Further, in step S4, within the neighborhood of the initially located corner coordinates, sub-pixel level grayscale values are obtained using fractal mask bilinear interpolation, and the gradient distribution is calculated as follows: Based on the preliminary location of candidate corner coordinates Centered on, For a square area that is half the width of the window, use bilinear interpolation to calculate the sub-pixel coordinates within the window; Let the coordinates of the ideal candidate corner point be... According to the principle of local gradient consistency at corner points, the gradient of this ideal candidate corner point is... and surrounding points The direction vector to the ideal candidate corner point Vertical, expressed as follows: (9) gradient In the neighborhood point A first-order Taylor expansion is performed at the point, and its expansion is shown in formula (10): (10) in, , , , It is the second-order partial derivative of the gradient; This indicates that in the image The grayscale value of the pixel at that location. yes right The first-order partial derivative reflects the gradient of the gray value in the horizontal direction. yes right The first-order partial derivative reflects the gradient of the gray value in the vertical direction; because In express right First-order partial derivative, therefore express gradient components of direction exist Rate of change in direction; similarly, , , They represent: gradient components of direction exist Rate of change in direction; gradient components of direction exist Rate of change in direction; gradient components of direction exist Rate of change in direction; Substituting the second-order partial derivative of the gradient into formula (9) and rearranging, we obtain formula (11): (11).
[0016] Furthermore, in S5, the expression for the minimum error function of the center point is: (12) in, The minimum error function at the center point, For weighted masks, These represent the candidate points that need to be... direction and The displacement for fine-tuning in the direction, formula (12) is used to find the amount of displacement that makes the direction fine-tuning possible. Minimum The value of this value allows us to determine the initial coordinates. The new coordinates are being updated. .
[0017] Furthermore, weight mask The expression is: (16) in, These are hyperparameters that control the weights of the two parts. Used to modulate weight gain, This represents the Hadamard inner product. Gaussian weights; (14) in, The output of the final modulation function, For scale The corresponding weighting coefficients, These are harmonic components; Among them, for one of them Centered on, half width is For a rectangular window, the expression for the Gaussian weights defined by the two-dimensional Gaussian function is: (13) The harmonic components The expression is: (15); in, For random noise, This refers to the half width of a square window. , They refer to windows respectively. direction and Half width in the direction.
[0018] According to specific embodiments provided by the present invention, the present invention has the following technical effects compared to the prior art: This invention accurately determines local edge directions through edge detection, polar coordinate transformation, and clustering algorithms, providing reliable geometric constraints for subsequent sub-pixelation processing. Building upon this, the invention uses gray-level integration and least squares methods to fit edge lines and calculate intersection points, achieving preliminary accurate corner location. Furthermore, this invention innovatively introduces fractal mask bilinear interpolation to obtain sub-pixel-level gray values and calculates local gradient distribution. Finally, based on fractal theory, a weighted mask is dynamically generated, and a minimum error function for the center point is constructed using the corner local gradient consistency principle for iterative optimization. This series of progressive steps not only effectively overcomes interference from image noise and uneven illumination but also significantly improves the robustness and accuracy of corner location through dynamic weights and gradient consistency constraints. Ultimately, it outputs highly stable sub-pixel-level corner positions, providing a high-quality data foundation for subsequent visual tasks such as camera calibration and 3D reconstruction, greatly enhancing the performance of the entire visual measurement system. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0020] The following description, in conjunction with the accompanying drawings, further illustrates the present invention's method for locating corner points of a chessboard grid based on fractal mask bilinear interpolation. Figure 1 This is a schematic diagram of the overall process of the fractal mask bilinear interpolation chessboard corner point localization method in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the FAST detection template in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of candidate corner detection in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of local region edge detection for candidate corner points in Embodiment 1 of the present invention; Figure 5 This is a schematic diagram of edge line refinement in Embodiment 1 of the present invention; Figure 6 This is a schematic diagram of the weight mask dynamically generated based on fractal theory in Embodiment 1 of the present invention; Figure 7 This is a schematic diagram of the chessboard image in Embodiment 1 of the present invention; Figure 8 This is a schematic diagram of the corner reprojection error in Example 1. Detailed Implementation
[0021] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0022] To better understand the purpose, structure, and function of this invention, the invention will be described in further detail below with reference to the accompanying drawings.
[0023] Example 1 like Figure 1 As shown, this invention provides a method for locating corner points of a chessboard grid based on fractal mask bilinear interpolation, comprising the following steps: S1. Acquire a checkerboard image using an image acquisition device, and extract candidate corner points from the checkerboard image using an improved FAST algorithm. In this embodiment, FAST is a feature point detection algorithm based on grayscale changes, which has a fast detection speed. First, a circular detection template is defined, such as... Figure 2 As shown, the circular detection template is a discrete circle with a radius of 3 and 16 pixels, which are evenly distributed in the center pixel. On the circumference of a circle. Assume... grayscale value Set the threshold to If there are consecutive points on the 16 circumferences... The grayscale value of each point is higher than Bigger or smaller Small, then The point may be the target corner point, and the method for determining it is shown in formula (1).
[0024] (1) in, , These represent the grayscale value at the center of the template and the grayscale value on the circumference of the template, respectively. This represents the threshold.
[0025] The checkerboard image has its own shape characteristics; its corner points will not appear within black or white squares, making it difficult for the traditional FAST algorithm to remove false points in smooth areas. First, two pairs of symmetrical points are randomly selected on the circumference of the template, and the grayscale difference between these four points and the center pixel is calculated. All are greater than or equal to If the condition is met, the center of the template circle may be a corner point. If the condition is met, a more precise judgment is performed, and the gray values of the 16 points on the template circumference are rearranged in descending order, with the maximum gray value set to 1. , The minimum value is These points are divided into eight groups of two. , ,…, Next, the grayscale values of the points on the template circumference are updated. For the checkerboard candidate corner point region, the grayscale values between two points in each group are located in the black and white grids respectively. The ratio of the absolute value of the difference in grayscale values between the two points to the maximum grayscale value between them is close to 1. This condition is not met for pseudo-points in smooth regions. For candidate corner points... Find information about the center of the template. Symmetrical points Then candidate corner points grayscale value Its symmetrical point grayscale value Approximately equal, this allows us to eliminate ordinary edge false points. Based on the above rules, candidate corner points... New grayscale value The calculation formula is as follows: (2) Traditional FAST uses a fixed threshold, which is easily affected by illumination. Therefore, an adaptive threshold generation method is proposed, as shown in formula (3). For its candidate centers... Extract larger surroundings Calculate the variance of gray values within the neighborhood. and average Its adaptive threshold is as follows, where The minimum gray value of non-center points within the region. The adjustment coefficient has a default value of 0.2. The final candidate point detection results are as follows: Figure 3 As shown: (3).
[0026] S2. Use edge detection algorithms to extract the local region edges of candidate corner points, and determine the orientation angles of the local region edges through polar coordinate transformation and clustering algorithms; In this embodiment, the FAST detection algorithm cannot effectively eliminate false points adjacent to ideal corner points, and therefore cannot guarantee the uniqueness of corner points in local areas. Figure 4 As shown in (a), edge lines are used to determine unique corner points. The Sobel edge detection operator is used to extract image edges. Figure 4 As shown in (b), the corner points detected by FAST are first clustered using a clustering algorithm. The number of clusters is equal to the actual number of corner points. The center of each cluster is the initial candidate corner point coordinates. A window radius of [size missing] is then selected, centered on the initially located candidate corner point coordinates. From the square region image, the coordinates of the window edge region can be obtained. To determine the line segments in the four main directions surrounding the candidate corner points, the corner point coordinates are used as the basis for this determination. A coordinate system with the origin as the origin and the set of edge pixels. All point coordinates are transformed from the image pixel coordinate system to this coordinate system, and then their coordinates are transformed from the Cartesian coordinate system to the polar coordinate system. Define the coordinates of each point. Direction vector relative to the center point: , The polar angle can be calculated using formula (4). This is the angle correction factor; the negative sign is used to correct the coordinates in the image coordinate system. The downward deviation along the axis, in order to ensure a uniform angle range, , represents the angle of a corner point.
[0027] (4) Then, based on the angle value, the pixels are categorized into the four edges surrounding the corner point using k-means clustering. [ The algorithm performs clustering on all angles, setting the number of clusters to 4. It can determine the initial edges of the corner points in four directions based on the angles, such as... Figure 4 As shown in (c).
[0028] S3. Use the gray-scale integral method to perform sub-pixelation processing on the edge lines and calculate the intersection of the edge lines to initially locate the coordinates of the candidate corner points. In this embodiment, due to the divergence of the edge region and the presence of noise points in different directions, the edge lines are first thinned to avoid significant errors caused by directly using the least squares method for fitting. Traditionally, pixel grayscale values are considered discrete sampled values within a unit interval on the edge intensity curve. This invention treats pixel intensity values as the average of all sub-pixel points within the curve; therefore, continuous pixel grayscale values can be represented by the integral of the corresponding sub-pixel grayscale values. Image pixel-level grayscale values are obtained through sampling. Assuming the size of a single pixel is 1, the pixel-level grayscale value is... Subpixel grayscale values are used If we express this as an expression, then we can obtain: (5) in, It is the average value of all subpixel grayscale values in the interval [0,1].
[0029] There are grayscale transition areas at the edges, such as... Figure 5 As shown in (b), it is Figure 5 (a) Enlarged image of the red rectangular area. The sub-pixel positions of the edge regions are located in the transition zone between the black and white regions. After separating the edge lines, the direction of each line and its normal direction can be preliminarily determined. Furthermore, it can be determined that for each point constituting the edge line, the transition zone is parallel to the image coordinate system. shaft or Axis. For example... Figure 5As shown in (a), the yellow lines represent the edge direction, and the green lines represent the normal direction; the yellow lines indicate horizontal or vertical directions close to the normal direction. For a pixel on the edge line... Extract the pixel along the direction of the yellow line. consecutive pixel grayscale values, such as Figure 5 As shown in (c), the position of the grayscale abrupt change in the transition band is the sub-pixel edge position in that direction.
[0030] Let the original coordinates of a point on the edge line be... Its grayscale transition band and If the axes are parallel, then in The sub-pixel coordinate position in the axial direction is c ,like Figure 5 The area indicated by the red arrow in (c) has a total of [number] consecutive [items]. To achieve continuous integral approximation across pixels, endpoint discrete values are used to compensate for boundary offsets. Figure 5 In (c), the grayscale integral of all pixel values This can be expressed using formula (6): (6) in, Integral grayscale values for all pixels. For discrete grayscale values, Discrete grayscale values At the border The value at that location, Discrete grayscale values At the border The value at; The edge region is a gray-level abrupt change point. Let the sub-pixel coordinates of this gray-level abrupt change point be . c This yields the following expression: (7) Then the coordinates of the gray-scale abrupt change point are calculated. Sub-pixel coordinates along the axis for: (8) Then point Given the sub-pixel coordinates of the candidate corner points, after obtaining the sub-pixel edges in four directions of the candidate corner points, the least squares method is used to fit the edge lines and calculate the unique intersection point to initially locate the coordinates of the candidate corner points. .
[0031] S4. Within the neighborhood of the initially located candidate corner point coordinates, sub-pixel level gray values are obtained using bilinear interpolation with fractal mask, and the local gradient distribution is calculated. In this embodiment, even in high-quality images, the edges around corners suffer from jagged edges and non-collinearity, leading to errors in the corner coordinates fitted using the least squares method. To address this, a sub-pixelization method for corners based on fractal mask bilinear interpolation and gradient consistency is proposed. Ideal candidate corners satisfy the principle of local gradient consistency, which is the theoretical basis for current gradient methods calculating sub-pixel coordinates. This means that the gradient direction distribution in a small local region near the corner exhibits significant consistency; specifically, the gradient of the local neighboring pixels of the corner is perpendicular to the direction vector from that point to the corner. First, an initial corner is determined... Centered on, The area is a square region equal to half the width of the window. Bilinear interpolation is then used to calculate the sub-pixel coordinates within the window, assuming the ideal corner coordinates are... According to the principle of local gradient consistency at corner points, the gradient at that point is... and surrounding points Direction vector to that point Vertical, its expression is as follows.
[0032] (9) gradient In the neighborhood point A first-order Taylor expansion is performed at the point, and its expansion is shown in equation (10): (10) in, , , , It is the second-order partial derivative of the gradient; This indicates that in the image The grayscale value of the pixel at that location. yes right The first-order partial derivative reflects the gradient of the gray value in the horizontal direction. yes right The first-order partial derivative reflects the gradient of the gray value in the vertical direction; because In express right First-order partial derivative, therefore express gradient components of direction exist Rate of change in direction; similarly, , , They represent: gradient components of direction exist Rate of change in direction; gradient components of direction exist Rate of change in direction; gradient components of direction exist Rate of change in direction; Substituting it into formula (9) and rearranging, we get: (11).
[0033] S5. Based on fractal theory, a weight mask is dynamically generated. According to the principle of local gradient consistency at corner points, a minimum error function for the center point is constructed. The corner point coordinates are iteratively optimized, and the sub-pixel level position is output.
[0034] In this embodiment, it is determined that... Centered on, The neighboring window is a square with a width of half, and its window mask is Then the equation for the minimum error of the center point is: (12) The return value for exist and The offset in direction, which is used to... Perform coordinate correction. These are the weights corresponding to the gradients at corner points, used to evaluate the reliability of corner points within the spatial window, suppress features in non-corner regions, and highlight corner features. The number of elements in the window; These represent the candidate points that need to be... direction and The displacement for fine-tuning in the direction, formula (12) is used to find the amount of displacement that makes the direction fine-tuning possible. Minimum The value of this value allows us to determine the initial coordinates. The new coordinates are being updated. .
[0035] The main process of this method is as follows: (1) Set the half width of the square window Maximum number of iterations Convergence accuracy Construct a mask matrix of the same size as the window. Set the width of the zero zone window.
[0036] (2) Execute iterative optimization process a) Using the currently estimated corner point Extract the extended window area centered on the target area; b) Use interpolation to obtain the sub-pixel grayscale values of the image within the window, and calculate according to formula (10). , Gradient of direction; c) Calculate the corner offset using formula (12) ,if And if the maximum number of iterations has not been reached, then for Update; otherwise, output. .
[0037] Traditional Gaussian weighted masks offer good smoothness in noisy regions, but can lead to inaccurate gradient calculations in local corner areas. Within the local window surrounding a corner, pixels at different locations contribute unevenly to determining the true corner position. Pixels closer to the corner center more accurately reflect the corner's geometric features, while pixels farther from the center are more susceptible to noise, proximity features, and boundary effects. The weighting function, by assigning an importance coefficient corresponding to the reliability of each pixel, achieves adaptive enhancement of effective information and intelligent suppression of interfering information.
[0038] Here, the multi-scale self-similarity property of fractal theory is utilized to dynamically generate a spatial weight mask that adapts to the local image texture structure. Fractal theory, first proposed by the French mathematician Mandelbrot, is characterized by self-similarity and can better describe the corner regions of objects.
[0039] First, establish a Gaussian weight distribution. For a given... Centered on, half width is The rectangular window has weights defined by the two-dimensional Gaussian function as follows: (13) in, Represents the pixel coordinates in the image. , Representing windows respectively direction and Half width of the direction, The weights for the corresponding positions, It is a natural exponential function.
[0040] Fractal modulation functions are multi-scale harmonic components The linear superposition, as shown in Equation (14), is such that the contribution of each scale is determined by its fractal dimension. D modulation.
[0041] (14) in, The output of the final modulation function, For scale The corresponding weighting coefficients.
[0042] Harmonic components Generated by the function shown in formula (15), its fractal mask is as follows: Figure 6 As shown: (15) in, For random noise, This refers to the half width of a square window. , They refer to windows respectively. direction and Half width in the direction.
[0043] Final weight mask Gaussian weights With fractal modulation output The composition, as shown in the formula: (16) in, These are hyperparameters that control the weights of the two parts. Used to modulate weight gain, This represents the Hadamard inner product.
[0044] Example 2 This invention further provides a verification process for the checkerboard corner point localization method based on fractal modulation mask in Embodiment 1: To verify the effectiveness of the proposed method, a chessboard image was captured using an image acquisition device. The device consisted of both hardware and software components. The hardware included a desktop computer, an image acquisition card, and a resolution of 2592. The system includes a 5-megapixel area array industrial camera (1944), a camera bracket, a white surface light source, a digital light source controller, a fixed-focus camera lens, and a transparent calibration plate with a square checkerboard pattern of 8 rows and 11 columns and a grid size of 3mm. The software components are the image acquisition software MV Viewer and the simulation experiment software MATLAB 2025a. The specific models of the main hardware equipment are shown in Table 1.
[0045] Table 1 Experimental Equipment Parameter Information
[0046] The camera is powered via Ethernet and uses the GigE transmission protocol, transmitting images to the computer via a network cable. The accuracy of the checkerboard corner point extraction directly affects the accuracy of the camera calibration. During camera calibration, the checkerboard corner point detection accuracy directly impacts the overall calibration accuracy. Since the ideal checkerboard corner point coordinates are unknown, the camera calibration accuracy indirectly reflects the checkerboard corner point positioning accuracy. In this invention, the calibration uses camera calibration functions in MATLAB. Due to insufficient and uneven ambient light, external light sources are typically used to illuminate the checkerboard to ensure image quality. This invention uses backlighting, placing the transparent PET checkerboard above the light source panel, allowing light to pass directly through the checkerboard into the camera. The light source is first turned off, the focus is adjusted, and the aperture is tightened to ensure a clear image. Then, the aperture is reduced to create a darker image when not relying on external light. Finally, the light source is turned on to illuminate the checkerboard. The checkerboard is moved to different positions, and images are acquired. The experimental setup and captured images are shown below. Figure 7 As shown.
[0047] The method in this invention solves for sub-pixel coordinates of corner points based on the gradient consistency principle. However, this method uses interpolation to calculate the grayscale values of the sub-pixel corner points. First, the effectiveness of the proposed fractal mask bilinear interpolation method is evaluated, and it is compared with linear interpolation, bilinear interpolation, and spline interpolation methods using Gaussian masks. The proposed algorithm is used to extract checkerboard pixel-level corner points. Its initial coordinates are all coordinates. A two-stage optimization strategy is adopted. The corner point input value of the second stage is the corner point output value of the first stage. The main parameter settings are shown in Table 2. The maximum number of iterations, The interpolation region and the mask region are half the width of each other. The size of the zero zone window, For convergence accuracy.
[0048] Table 2 Optimization parameter settings for each stage
[0049] Afterwards, the corner points of the chessboard were extracted and a camera calibration experiment was conducted. The average reprojection error of the camera calibration on 12 chessboard images by each method is shown in Table 3.
[0050] As shown in Table 3, when the mask does not have a zero zone, the fractal mask interpolation method proposed in this invention can achieve higher camera calibration accuracy, with an average reprojection error of 0.0538 pixels. Nearest neighbor interpolation has the lowest calibration accuracy, mainly because it is sensitive to noise. Although it captures good quality checkerboard images, noise still exists in real-world environments. Other interpolation methods outperform nearest neighbor interpolation in suppressing noise. Bicubic interpolation has better smoothness than bilinear interpolation, but excessive smoothing can lead to texture information loss and decreased calibration accuracy. Bispline interpolation has better smoothness than bilinear interpolation while preserving more details and better fitting the gradient distribution around corner points; its final calibration accuracy is second only to the fractal mask interpolation proposed in this invention.
[0051] When the mask is set to zero, its local With the mask set to zero within the window, grayscale values are not included in the calculation. In this case, only the nearest neighbor interpolation method has better calibration accuracy than the case without using zero regions. Since nearest neighbor interpolation introduces more noise, the use of zero regions suppresses local high noise. Bispline interpolation achieves the best performance in this situation, with a calibration average reprojection error of 0.0811 pixels, demonstrating its excellent performance under high noise and severe feature loss conditions. The interpolation method presented in this paper performs slightly worse than bispline interpolation, but it has a certain texture feature completion effect, and its performance is better than other interpolation methods. For other interpolation methods, setting zero regions further destroys the local feature information of corner points, leading to a decrease in corner detection accuracy.
[0052] Table 3. Calibration results of corner point coordinates obtained by different interpolation methods.
[0053] To evaluate the effectiveness of the proposed method, it was compared with methods based on periodic characteristics, MATLAB 2025a Toolbox, Local Area Intensity Response, and directional vector projection. The periodic characteristics-based method reconstructs missing corners that may be masked by noise using the periodic characteristics of corner points; the MATLAB toolbox uses the gradient method for corner point refinement; Local Area Intensity Response finds four LOG response values of the local region of the corner point and uses them to determine the center; the directional vector projection method optimizes the corner point coordinates by maximizing the projection of the corner point onto the edge. The parameter settings for the method in this invention are shown in Table 2, and the mask does not have a zero zone. The calibration accuracy was tested before and after corner point refinement. The calibration results for each method are shown in Table 4. , for , Focal length of direction, , Principal point coordinates , The radial distortion coefficient is... The average ghosting error is calibrated for the camera. The corner reprojection error in all images is as follows: Figure 8 As shown.
[0054] Table 4. Camera calibration results for different corner detection methods
[0055] As shown in Table 4, using the method proposed in this invention to detect chessboard corner points and perform sub-pixel optimization, followed by phase calibration using the obtained corner points, yields an average reprojection error of 0.0538 pixels, which is superior to the average ghosting error when using corner point coordinates obtained by other methods for calibration. The MATLAB toolbox, similar to this paper, uses the gradient method to optimize point coordinates and bilinear interpolation to calculate sub-pixel coordinates. After camera calibration, its reprojection error is 0.0607 pixels, higher than the 0.0557 pixel reprojection error achieved in Table 3 when the corner points calculated in this invention are used as initial coordinates, and bilinear interpolation and gradient method are used to solve for sub-pixel coordinates before camera calibration. This demonstrates that this invention uses sub-pixel edges to initially calculate chessboard corner points. The advantages of this method provide better initial coordinates for subsequent optimization; the method based on periodic characteristics reconstructs corner coordinates based on the characteristics of the local corner region, and the reprojection error after calibration is 0.0561 pixels, second only to the method in this invention, which requires a microscope to better capture the periodic information of the local corner region; the method based on local grayscale response values fits a circle based on the four LOG response values of the local corner region, using the center of the circle as the sub-pixel coordinates, but uses cubic linear interpolation to obtain the response surface before calculating the response value, which destroys the local corner region features, and the reprojection error after calibration is 0.0616 pixels; the method based on directional vector projection determines the sub-pixel corner coordinates by the edge line, but its edge jaggedness affects the accuracy, and the reprojection error after calibration is 0.0563 pixels.
[0056] The above description of the disclosed embodiments enables those skilled in the art to make or use the present 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 present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for locating corner points of a chessboard grid based on fractal mask bilinear interpolation, characterized in that, Includes the following steps: S1. Acquire a chessboard image using an image acquisition device, and extract candidate corner points from the chessboard image using an improved FAST algorithm; S2. Use edge detection algorithms to extract the local region edges of candidate corner points, and determine the orientation angles of the local region edges through polar coordinate transformation and clustering algorithms; S3. Based on the direction angle of the local region edge, the edge line is processed into sub-pixelation using the gray-scale integral method, and the edge line is fitted by the least squares method and the intersection point is calculated to initially locate the coordinates of the candidate corner point. S4. Within the neighborhood of the initially located candidate corner point coordinates, sub-pixel level gray values are obtained using bilinear interpolation with fractal masks, and the local gradient distribution is calculated. S5. Utilize local gradient distribution to dynamically generate weight masks based on fractal theory. Based on the principle of local gradient consistency at corner points, construct the minimum error function for the center point, iteratively optimize the coordinates of candidate corner points, and output sub-pixel level positions.
2. The method for locating corner points of a chessboard grid based on fractal mask bilinear interpolation according to claim 1, characterized in that, S1 involves acquiring a checkerboard image using an image acquisition device and extracting candidate corner points from the checkerboard image using an improved FAST algorithm, specifically as follows: The characteristics of the checkerboard image are used to initially screen the candidate corner points, and the preliminary candidate corner points are obtained. The candidate corner points obtained from the initial screening are verified by the gray-level similarity of symmetrical points and the high contrast of neighboring points in the checkerboard image, and the final candidate corner points are extracted by combining the neighborhood adaptive threshold.
3. The method for locating corner points of a chessboard grid based on fractal mask bilinear interpolation according to claim 2, characterized in that, The specific criteria for preliminary screening of candidate corner points are as follows: (1) in, , These represent the grayscale value at the center of the template and the grayscale value on the circumference of the template, respectively. Indicates the neighborhood adaptive threshold. N The number of pixels; The expression for verifying the candidate corner points obtained from the initial screening, based on the gray-level similarity of symmetrical points and the high contrast of neighboring points in the checkerboard image, is as follows: (2) in, Candidate corner points The grayscale values of neighboring pixels on the circumference of the template. New grayscale values for candidate corner points To be with candidate corner points Symmetrical point The grayscale value.
4. The method for locating corner points of a chessboard grid based on fractal mask bilinear interpolation according to claim 2, characterized in that, The neighborhood adaptive threshold T The expression is: (3) in, The minimum gray value of non-center points within the region. For adjustment coefficients, Variance of gray values within the neighborhood It is the average value within the neighborhood.
5. The method for locating corner points of a chessboard grid based on fractal mask bilinear interpolation according to claim 1, characterized in that, S2 determines the orientation angle of the local region edge through polar coordinate transformation and clustering algorithm. The specific calculation formula is as follows: (4) in, Angle correction factor and The coordinates of each candidate corner point are respectively The direction vector relative to the center point.
6. The method for locating corner points of a chessboard grid based on fractal mask bilinear interpolation according to claim 1, characterized in that, The calculation formula for sub-pixelization of edge lines using the gray-scale integral method in S3 is as follows: (5) in, Pixel-level grayscale values, It is the average of all sub-pixel grayscale values in the interval [0,1]. This represents a subpixel grayscale value.
7. The method for locating corner points of a chessboard grid based on fractal mask bilinear interpolation according to claim 1, characterized in that, In step S3, the calculation formula for sub-pixelization of the edge line based on the direction angle of the local region edge using the gray-scale integral method is as follows: (6) in, Integral grayscale values for all pixels. For discrete grayscale values, Discrete grayscale values At the border The value at that location, Discrete grayscale values At the border The value at; The edge region is a gray-level abrupt change point. Let the sub-pixel coordinates of this gray-level abrupt change point be . c This yields the following expression: (7) Then the coordinates of the gray-scale abrupt change point are calculated. Sub-pixel coordinates along the axis for: (8) Then point Given the sub-pixel coordinates of the candidate corner points, after obtaining the sub-pixel edges in four directions of the candidate corner points, the least squares method is used to fit the edge lines and calculate the unique intersection point to initially locate the coordinates of the candidate corner points. .
8. The method for locating corner points of a chessboard grid based on fractal mask bilinear interpolation according to claim 1, characterized in that, In step S4, within the neighborhood of the initially located corner coordinates, sub-pixel level grayscale values are obtained using bilinear interpolation with a fractal mask. The gradient distribution is calculated as follows: Based on the preliminary location of candidate corner coordinates Centered on, For a square area that is half the width of the window, use bilinear interpolation to calculate the sub-pixel coordinates within the window; Let the coordinates of the ideal candidate corner point be... According to the principle of local gradient consistency at corner points, the gradient of this ideal candidate corner point is... and surrounding points The direction vector to the ideal candidate corner point Vertical, expressed as follows: (9) gradient In the neighborhood point A first-order Taylor expansion is performed at the point, and its expansion is shown in formula (10): (10) in, , , , It is the second-order partial derivative of the gradient; This indicates that in the image The grayscale value of the pixel at that location. yes right The first-order partial derivative reflects the gradient of the gray value in the horizontal direction. yes right The first-order partial derivative reflects the gradient of the gray value in the vertical direction; because In express right First-order partial derivative, therefore express gradient components of direction exist Rate of change in direction; similarly, , , They represent: gradient components of direction exist Rate of change in direction; gradient components of direction exist Rate of change in direction; gradient components of direction exist Rate of change in direction; Substituting the second-order partial derivative of the gradient into formula (9) and rearranging, we obtain formula (11): (11)。 9. The method for locating corner points of a chessboard grid based on fractal mask bilinear interpolation according to claim 1, characterized in that, The expression for the minimum error function of the center point in S5 is: (12) in, The minimum error function at the center point, M For weighted masks, These represent the candidate points that need to be... direction and The displacement for fine-tuning in the direction, formula (12) is used to find the amount of displacement that makes the direction fine-tuning possible. Minimum The value of this value allows us to determine the initial coordinates. The new coordinates are being updated. .
10. The method for locating corner points of a chessboard grid based on fractal mask bilinear interpolation according to claim 9, characterized in that, Weight mask M The expression is: (16) in, These are hyperparameters that control the weights of the two parts. Used to modulate weight gain, This represents the Hadamard inner product. G Gaussian weights; (14) in, The output of the final modulation function, For scale The corresponding weighting coefficients, These are harmonic components; Among them, for one of them Centered on, half width is For a rectangular window, the expression for the Gaussian weights defined by the two-dimensional Gaussian function is: (13) The harmonic components The expression is: (15); in, For random noise, This refers to the half width of a square window. , They refer to windows respectively. direction and Half width in the direction.
Citation Information
Cited By
Machine vision circle-circle intersection point measurement method based on dynamic fitting and local optimization
CN121904172A
Method for measuring intersection of circles in machine vision based on dynamic fitting and local optimization
CN121904172B