A geometric center fitting method of a center-symmetric image

By employing a multi-step fitting and iterative method, the geometric center of a centrally symmetric image is directly fitted, solving the problems of computational complexity and insufficient real-time performance in existing technologies, and achieving efficient fitting of all centrally symmetric images.

CN117115236BActive Publication Date: 2026-04-21NANJING TUODAO MEDICAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING TUODAO MEDICAL TECHNOLOGY CO LTD
Filing Date
2023-09-07
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing methods for fitting the geometric center of an image are difficult to apply to all centrally symmetric images, and the computational process is complex and difficult to meet real-time requirements.

Method used

Based on the geometric characteristics of centrally symmetric images, the geometric center of the image is directly fitted through multi-step fitting and multiple iterations. This includes selecting the two edge pixels with the largest distance, performing preliminary fitting at the midpoint, constructing a virtual pixel matrix, and selecting the virtual pixel with the smallest distance until the fitting accuracy meets the design requirements.

Benefits of technology

It is widely applicable to geometric center fitting of all centrally symmetric images. The calculation process is simple and direct, with high fitting accuracy, reduced computational load, and meets real-time requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117115236B_ABST
    Figure CN117115236B_ABST
Patent Text Reader

Abstract

This invention discloses a method for fitting the geometric center of a centrally symmetric image, comprising: S1, constructing a pixel coordinate system based on the original image and obtaining the pixel coordinates of the edges of the centrally symmetric image on the original image; S2, selecting the two edge pixels with the largest distance from all edge pixels, and taking the midpoint between the two edge pixels with the largest distance as a temporary center point; S3, constructing a virtual pixel matrix in the area surrounding the temporary center point, and selecting the virtual pixel with the smallest sum of distances to all edge pixels as a new temporary center point; S4, repeating step S3 until the fitting accuracy of the temporary center point meets the design requirements. This invention directly fits the geometric center of a graphic based on the geometric characteristics of a centrally symmetric image. The calculation process is simple and direct, and it is widely applicable to the geometric center fitting of all centrally symmetric images. At the same time, the multi-step fitting and multiple iteration methods fully ensure the fitting accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method for fitting the geometric center of a centrally symmetric image. Background Technology

[0002] Common methods for fitting the geometric center of an image include least squares fitting, Gaussian surface fitting, gray-level weighted centroid fitting, and Hough transform fitting. Among these, Gaussian surface fitting requires the image's gray levels to follow a Gaussian surface distribution, gray-level weighted centroid fitting requires the image's gray levels to be uniformly distributed or high-gray-level pixels to be concentrated near the geometric center point, and Hough transform fitting has a more complex computational process, requiring each point to be transformed into parameter space and recorded and voted on, resulting in extremely high time complexity.

[0003] From a practical perspective, least squares fitting is more suitable for application in engineering practice and product development. However, least squares also has the following problems: 1. Different graphs require different fitting formulas, making it difficult to apply a single general formula to fitting different graphs; 2. Least squares fitting yields the equation of the graph, which ultimately needs to be further converted into the center point of the graph; 3. Least squares fitting involves a large amount of computation, making it unsuitable for situations with high real-time requirements and a large number of graphs to be fitted.

[0004] In summary, existing methods for fitting the geometric center of an image are not suitable for fitting the geometric center of all centrally symmetric images, and the computational process is relatively complex, making it difficult to meet the requirements for real-time fitting. Summary of the Invention

[0005] Purpose of the invention: To address the problems existing in the prior art, this invention provides a method for fitting the geometric center of a centrally symmetric image. Based on the geometric characteristics of the centrally symmetric image, the geometric center of the image is directly fitted, making the calculation process simple and efficient, and applicable to the geometric center fitting of all centrally symmetric images.

[0006] Technical Solution: To achieve the above objectives, this invention provides a method for fitting the geometric center of a centrally symmetric image, comprising the following steps:

[0007] S1. Construct a pixel coordinate system based on the original image and obtain the pixel coordinates of the centrally symmetric image edge on the original image;

[0008] S2. Select the two edge pixels with the largest distance from all edge pixels, and take the midpoint between the two edge pixels with the largest distance as the temporary center point;

[0009] S3. Construct a virtual pixel matrix in the area surrounding the temporary center point, and select the virtual pixel with the smallest sum of distances to all edge pixels as the new temporary center point.

[0010] S4. Repeat step S3 until the fitting accuracy of the temporary center point meets the design requirements.

[0011] Specifically, constructing a virtual pixel matrix in the region surrounding the temporary center point involves:

[0012] In the k-th iteration, construct n with the current temporary center point as the center. k A virtual pixel matrix is ​​constructed, and the distance between two adjacent pixels is defined as the pixel interval. This is based on the pixel coordinates of the current temporary center point and the ratio between the virtual pixel interval and the actual pixel interval. k Get the coordinates of all virtual pixels. , ), i = 1, 2, ..., n k j=1, 2, ..., n k n k n represents the number of virtual pixels in each row and column of the virtual pixel matrix in the k-th iteration. k >1, k <1.

[0013] Furthermore, the ratio between the virtual pixel interval and the actual pixel interval k To set parameters.

[0014] Furthermore, when k=1, the actual pixel is set as the parent pixel; when k>1, the virtual pixel generated in the (k-1)th iteration is set as the parent pixel. Therefore, in the kth iteration, each row and column of the virtual pixel matrix covers m... k The parent pixel is obtained from this. k = k-1 ×(m k -1) / (n k -1), where k initial value =1, and n k >m k >2.

[0015] Furthermore, during the iteration process, n k Always equal to n, m k If it always equals m, then k = k-1 ×(m-1) / (n-1), n>m>2.

[0016] Furthermore, nk It is an odd number.

[0017] Furthermore, during the iteration process, the ratio between the virtual pixel interval and the actual pixel interval... k It shows a decreasing trend.

[0018] Furthermore, the fitting accuracy of the temporary center point meets the design requirements, specifically including:

[0019] Ratio between virtual pixel range and actual pixel range k ≤ set threshold β; or,

[0020] The number of iterations k ≥ the set threshold ɑ.

[0021] Specifically, the step of selecting the virtual pixel with the smallest sum of distances to all edge pixels involves:

[0022] For each virtual pixel ( , ), calculate its relationship with all edge pixels respectively. , The sum of the Euclidean distances between virtual pixels is calculated, and the sum of the distances of all virtual pixels is compared to select the virtual pixel with the smallest sum of distances. The formula for calculating the sum of Euclidean distances is as follows: or p = 1, 2, ..., z, where z is the total number of edge points.

[0023] Furthermore, obtaining the pixel coordinates of the centrally symmetric image edge on the original image specifically involves:

[0024] Obtain a centrally symmetric image from the original image. For each pixel in the centrally symmetric image, determine whether the pixel value of each pixel in its neighborhood is greater than the segmentation threshold. If the pixel value of each pixel in its neighborhood is greater than the segmentation threshold, then the current pixel is an internal point; otherwise, it is an edge point.

[0025] Specifically, obtaining a centrally symmetric image from the original image involves:

[0026] The original image is segmented using a segmentation threshold to obtain the centrally symmetric image.

[0027] Specifically, the formula for calculating the Euclidean distance between the edge pixels is as follows: or ,in( , )and( , ) represents the coordinates of any two edge pixels.

[0028] Specifically, let the coordinates of the two edge pixels with the largest distance be a( , ) and b( , If ), then the pixel coordinates of the midpoint between the two are (( + ) / 2,( + ) / 2).

[0029] Beneficial effects:

[0030] 1. This invention is based on fitting the geometric center of a graphic to the geometric characteristics of a centrally symmetric image. Therefore, it is widely applicable to fitting the geometric center of all centrally symmetric images, such as circles, ellipses, squares, rectangles, regular polygons, etc.

[0031] 2. This invention adopts a method of directly fitting the geometric center. The fitting result is the geometric center that is to be solved. There is no need to go through multiple transformations to obtain the geometric center. The calculation process is simple and direct.

[0032] 3. This invention uses a multi-step fitting and multiple iterations to fit the geometric center, which reduces the amount of computation while greatly ensuring the accuracy of the fitting. Attached Figure Description

[0033] Figure 1 This is an overall flowchart of the geometric center fitting method in this invention;

[0034] Figure 2a , 2b These are schematic diagrams and statistical results showing the sum of the distances from the 11 internal points of the circle to all points on the circumference;

[0035] Figure 3 This is a schematic diagram of coordinate analysis based on FPGA in an embodiment of the present invention;

[0036] Figure 4 This is a schematic diagram illustrating the 4-neighborhood edge determination in an embodiment of the present invention;

[0037] Figure 5 , Figure 6 These are schematic diagrams illustrating the generation and swiping of a 3×3 pixel window in an embodiment of the present invention;

[0038] Figure 7 This is a schematic diagram illustrating the construction of the 3rd and 4th order virtual pixel matrices in an embodiment of the present invention;

[0039] Figure 8 This is a schematic diagram illustrating the matrixing of the vicinity of the center point and the distance integration in an embodiment of the present invention. Detailed Implementation

[0040] The preferred embodiments of the present invention will now be described in conjunction with the accompanying drawings, which will more clearly and completely illustrate the technical solution of the present invention.

[0041] Reference Figure 1 This invention provides a method for fitting the geometric center of a centrally symmetric image, comprising the following steps:

[0042] S1, Coordinate Analysis;

[0043] Based on the received original image, a pixel coordinate system is established, and the coordinates (x, y) of each pixel in the image are obtained.

[0044] S2, Image Segmentation;

[0045] Background segmentation is performed on the original image using a segmentation threshold to obtain pixels with pixel values ​​greater than the segmentation threshold.

[0046] S3, Connectivity Component Labels;

[0047] Connected pixels in the segmented image are extracted and labeled as connected components, thus obtaining multiple isolated connected components. These connected components can form a complete or partial centrally symmetric image, and the geometric center of the centrally symmetric image is fitted accordingly.

[0048] S4, Edge Extraction;

[0049] The edge detection method of 4-neighborhood is used to detect the edge of the pixels in the connected region, thereby extracting the edge points of each connected region. Specifically, taking the pixel in the connected region as the center, it is determined whether the pixel values ​​of the four adjacent points in the four directions of top, bottom, left and right are greater than the segmentation threshold. If the pixel values ​​of the four adjacent points are all greater than the segmentation threshold, the point is an internal point; otherwise, it is an edge point.

[0050] S5, edge point regional storage;

[0051] Based on the edge extraction results of S4, the edge points of each connected component are cached in different storage spaces.

[0052] S6. Determining the longest distance;

[0053] Based on the edge points of each connected component stored in S5, obtain the Euclidean distance between any two edge points and filter out the maximum distance.

[0054] The geometric meaning of the maximum distance varies across different centrally symmetric images. For example, it represents the diameter in a circle, the major axis in an ellipse, and the diagonal in a square, rectangle, or regular polygon. However, the midpoint of the maximum distance is often the geometric center of the centrally symmetric image. Therefore, based on this geometric characteristic, a preliminary fitting of the geometric center is performed.

[0055] S7. Preliminary fitting of the geometric center point;

[0056] Based on the longest distance determination result in S6, the midpoint between the two edge points with the largest distance is obtained, which is the geometric center point of the initial fitting.

[0057] S8, matrixing near the center point;

[0058] Due to interference factors such as image noise and image jitter, the geometric center point initially fitted in S7 cannot be directly considered as the geometric center of the centrally symmetric image; it can only be used as a temporary center point. To more accurately fit the geometric center of the centrally symmetric image, it is necessary to find the actual geometric center point near the temporary center point.

[0059] Therefore, a virtual pixel matrix is ​​constructed in the area surrounding the temporary center point. This matrix needs to cover the pixels around the temporary center point, that is, the pixels including the actual center point. In this way, the pixel coordinates near the temporary center point are subdivided into virtualized subdivisions, and the coordinates of each virtual pixel are obtained.

[0060] S9, Distance integral;

[0061] Based on the virtual pixel coordinates obtained in S8, the sum of the distances between each virtual pixel and all edge points is obtained, and the minimum sum of distances is selected.

[0062] Analysis and comparison show that, among all interior points of a centrally symmetric image, the sum of the distances from the geometric center point to all edge points is the smallest. Taking a circle as an example... Figure 2a It represents the sum of the distances from the 11 internal points of the circle to all points on the circumference, where the 11 internal points are distributed on the same diameter; Figure 2b This represents the statistical result of the sum of distances to the 11 internal points within the circle. The horizontal axis represents the index of the internal points, from 1 to 11 from left to right, and the vertical axis represents the sum of distances from the internal points to all points on the circumference. It can be seen that the internal point with index 6 (i.e., the geometric center) corresponds to the lowest point of the inverse parabola, having the smallest sum of distances. The other internal points correspond to other points on the inverse parabola. Therefore, the fitting process of the geometric center in this invention is essentially finding (infinitely approximating) the internal point with the smallest sum of distances to all edge points.

[0063] S10, Fitting of the new center point;

[0064] Based on the filtering results of S9, the virtual pixel with the smallest sum of distances is selected as the new temporary center point.

[0065] S11, Iterative fitting;

[0066] Repeat steps S8 to S10, iterating until the actual geometric center point is approximated until the fitting accuracy of the geometric center point meets the design requirements.

[0067] Currently, in scenarios such as 3D modeling with binocular cameras and localization with monocular cameras, centrally symmetric images are artificially added as markers. Furthermore, during binocular 3D modeling or monocular localization, it is necessary to extract the center of the marker, which requires fitting the geometric center of the centrally symmetric image. For example, the spherical marker used in binocular 3D modeling typically forms a circle or ellipse in the camera's image (related to the angle between the sphere and the camera's optical center), both of which are centrally symmetric images. Therefore, the fitting method provided in this invention can be used to fit the geometric center of the marker's image.

[0068] Based on this, the present invention provides an embodiment of geometric center fitting for imaging of spherical markers based on FPGA, including the following steps:

[0069] S1, Coordinate Analysis;

[0070] Image reception, coordinate parsing and storage based on FPGA: The FPGA can be directly connected to the image transmission interface to receive the acquired image data in real time. At the same time, inside the FPGA, according to the image reception sequence, the position of each pixel in the image is represented by coordinates (x,y) in a row-by-row and column-by-column manner to form a pixel coordinate system.

[0071] Reference Figure 3 The coordinate analysis process based on FPGA is as follows:

[0072] 1.1 Define two parameters, x and y, to represent the horizontal and vertical coordinates of a pixel, respectively;

[0073] 1.2 When the rising edge of the Frame Valid signal arrives, clear x and y (assign a value of 0) to indicate that a new frame of image is being received;

[0074] 1.3 When the Line Valid signal goes high, the value of x increases by 1 every Pixel Clock cycle, indicating that reception of the current image line has begun. Figure 3 This is showing the case with a horizontal resolution of 1920. Therefore, when the Line Valid signal is high, the value of x accumulates continuously between 0 and 1919.

[0075] 1.4 When the Line Valid signal is pulled low, x is cleared to zero and y is incremented by 1, indicating that the current image line has been received.

[0076] 1.5 Repeat steps 1.3 to 1.4 continuously until the next frame arrives, then start executing from step 1.2 again, and so on, continuously looping from frame to frame.

[0077] S2, Image Segmentation;

[0078] The original image is segmented using a transfer function. In this embodiment, the pixel values ​​are represented by grayscale values. Therefore, the background image with grayscale values ​​not greater than the segmentation threshold is segmented out, leaving the pixels with grayscale values ​​greater than the segmentation threshold.

[0079] Specifically, the transfer function is:

[0080]

[0081] In the formula, H(x,y) is the new pixel gray level at coordinates (x,y) after segmentation, and D(x,y) is the original pixel gray level at coordinates (x,y) before segmentation. This is the segmentation threshold.

[0082] S3, Connectivity Component Labels;

[0083] Connected pixels in the segmented image are extracted and labeled as connected components, thus obtaining multiple isolated connected components. These connected components are the marker images, which are generally centrally symmetric images. Based on this, the geometric center of the centrally symmetric image is fitted.

[0084] S4, Edge Extraction;

[0085] Reference Figure 4 Pixels with a gray level greater than the segmentation threshold are marked as 1, and pixels with a gray level not greater than the segmentation threshold are marked as 0. Taking a pixel p (marked as 1) within the connected component as the center point, if it is the case in the upper half of the image, that is, if pixel p is surrounded by pixels marked as 1, then p is an interior point; if it is one of the cases in the lower half of the image, that is, if there are pixels marked as 0 among the pixels surrounded by pixels marked as 0, then p is an edge point.

[0086] Furthermore, since the extraction of each edge point requires the use of the pixel grayscale of 4 neighborhoods, at least 2 rows of images need to be cached. When the third row arrives, it forms a 3-row image with the first two rows. Then, a 3×3 pixel window is used to perform window extraction on the 3-row image.

[0087] For example, the FPGA contains two FIFO memories, namely FIFO0 and FIFO1, which are connected in series. Data is written and read at the same time. The data read from FIFO1 is written to FIFO0, which is cascaded with it. However, there are no other FIFOs cascaded after FIFO0, so the data read from FIFO0 is discarded after use.

[0088] Reference Figure 5 The row0 data is stored in fifo0, and the row1 data is stored in fifo1. fifo1 is written by the image transmission interface. When the image transmission interface writes row2 data (i.e., row2 data is written to fifo1), the row1 data stored in fifo1 is read out and written to fifo0, and the row0 data stored in fifo0 is read out and discarded.

[0089] Therefore, when the image transmission interface writes row2 data, the transmitted image data row2, the data row1 read from fifo1, and the data row0 read from fifo0 together form a 3x1 pixel array. By caching these three pixels in two rows using triggers, the data from the two cached triggers, together with the currently read data, can form a 3x3 data window.

[0090] Reference Figure 6 As image data is continuously transmitted, this 3x3 window slides down from left to right and from top to bottom, scanning the entire image. Generally, marker imaging will not appear at the edges of the original image; therefore, for the outermost row / column of pixels in the original image, there is no need to consider whether there are edge points of connected components.

[0091] S5, edge point regional storage;

[0092] Multiple cache regions RAM0-RAM7 are divided using the FPGA's internal storage space (such as block RAM) or external storage space (such as DDR), and the edge points point1-pointn in each connected domain are stored in RAM0-RAM7.

[0093] S6. Determining the longest distance;

[0094] The formula for calculating the Euclidean distance between any two edge points is: L = ,in( , )and( , ) represents the coordinates of any two edge points, from which the maximum distance is selected.

[0095] It can be seen that the Euclidean distance is monotonically related to its square value, that is, L 2 The larger the value, the larger L becomes. Therefore, for ease of calculation and to save resources, L can be omitted. 2 Instead of performing a prescription, the result of not performing a prescription is used directly. Filter out the maximum value.

[0096] S7. Preliminary fitting of the geometric center point;

[0097] The pixel coordinates of the longest distance midpoint are obtained by solving the vector midpoint problem. That is, the coordinates of the two edge points with the largest distance selected in S6 are a( , ) and b( , If ), then the pixel coordinates of the midpoint c of vector ab are ( , )for(( + ) / 2,( + () / 2), which is the geometric center point of the initial fit.

[0098] S8, matrixing near the center point;

[0099] In the k-th iteration, construct n with the current temporary center point as the center. k n-order virtual pixel matrix k This represents the number of virtual pixels in each row and column of the matrix during the k-th iteration, where n is the number of virtual pixels. k >1. When k=1, the current temporary center point is the geometric center point c initially fitted in S7. , When k > 1, the current temporary center point is the temporary center point fitted by the (k-1)th iteration.

[0100] Here, the distance between two adjacent pixels is defined as a pixel interval. Specifically, the distance between two adjacent actual pixels is the actual pixel interval, and the distance between two adjacent virtual pixels within the virtual pixel matrix is ​​the virtual pixel interval, which is the difference between the horizontal or vertical coordinates of two adjacent virtual pixels. In the k-th iteration, the ratio between the virtual pixel interval and the actual pixel interval is... k These can be directly set variable parameters, or they can be obtained through relevant calculations. k <1.

[0101] Furthermore, in the k-th iteration, based on the coordinates of the current temporary center point and the proportional relationship between the virtual pixel interval and the actual pixel interval... k It can obtain the coordinates of all virtual pixels. , ), i = 1, 2, ..., n k j=1, 2, ..., n k .

[0102] Furthermore, n k Odd numbers are preferred. (Refer to...) Figure 77a represents a 3×3 virtual pixel matrix, which is n k When the number of virtual pixels is odd, there are 3 virtual pixels per row and 3 virtual pixels per column. There are 2 virtual pixel intervals between these 3 virtual pixels. Therefore, within this matrix, there is a temporary center point corresponding to a virtual pixel at the center position, whose coordinates are easy to calculate. 7b represents a 4×4 virtual pixel matrix, which is n k In the case of an even number, it can be seen that within this matrix, the temporary center point is located at the center of the matrix, and there is no corresponding virtual pixel point, making it inconvenient to calculate its coordinates.

[0103] S9, Distance integral;

[0104] For each virtual pixel ( , ), calculate its relationship with all edge points ( ), , The sum of the Euclidean distances between ) Then, the sum of the distances to all virtual points is compared, and the virtual point with the smallest sum of distances is selected, p = 1, 2, ..., z, where z is the total number of edge points. Similarly, for ease of calculation, the square root operation of the Euclidean distance can be omitted, i.e., a method can be used... replace Perform calculations and comparisons.

[0105] S10, Fitting of the new center point;

[0106] Based on the filtering results of S9, the virtual pixel with the smallest sum of distances is selected as the new temporary center point.

[0107] S11, Iterative fitting;

[0108] Repeat steps S8 to S10 to continuously approximate the actual geometric center point through the iterative process until the fitting accuracy of the geometric center point meets the system design requirements. The iteration can then end, and the geometric center point of the last fitting is the geometric center point of the spherical marker imaging.

[0109] Furthermore, when k=1, the actual pixel is set as the parent pixel; when k>1, the virtual pixel generated in the (k-1)th iteration is set as the parent pixel. Therefore, in the kth iteration, each row and column of the virtual pixel matrix covers m... k The parent pixel is obtained from this. k = k-1 ×(m k -1) / ( n k -1), where k initial value =1, and n k>m k >2. Specifically, the order n of the virtual pixel matrix. k and the number of parent pixels covered by each row and column, m k It is determined by the imaging characteristics of the system itself.

[0110] Furthermore, during the iteration process, n k Always equal to n, m k If it always equals m, then k = k-1 ×(m-1) / (n-1), n>m>2.

[0111] Reference Figure 8 In this embodiment, a 17×17 virtual pixel matrix is ​​consistently used to cover several parent pixels near the temporary center point, i.e., n=17. Because the system imaging in this embodiment is unstable, the distance between the initially fitted geometric center point in S7 and the actual geometric center point generally fluctuates between 0 and 3 pixels. Therefore, in the first iteration, each row and column of the virtual pixel matrix must cover 3 actual pixels, i.e., m=3. At this time, the ratio between the virtual pixel interval and the actual pixel interval is... = ×(m-1) / (n-1)=0.125 represents the proportion of a virtual pixel range in the actual pixel range.

[0112] In the second iteration, a 17×17 virtual pixel matrix is ​​constructed again, centered on the new temporary center point. Each row and column of the virtual pixel matrix covers three virtual pixels generated in the first iteration. At this point, the ratio between the virtual pixel interval and the actual pixel interval is... = ×(m-1) / (n-1)=0.125×2 / 16=0.015625.

[0113] Similarly, the fitting accuracy of the geometric center point (i.e. k The fitting accuracy is continuously increased until it meets the system design requirements, namely the ratio between the virtual pixel interval and the actual pixel interval. k The iteration can end when the threshold value β is less than or equal to the set threshold value α.

[0114] For example, if the threshold β is set to 0.2, then the requirement can be met in one iteration, that is, in the first iteration... =2 / 16 = 0.125 < β, at which point the iteration can end; if the threshold β is set to 0.05, then a second iteration is required, that is, during the second iteration... =0.125×2 / 16=0.015625<β, at which point the accuracy requirement is met, and the iteration can be terminated.

[0115] In summary, during the iteration process, k The geometric center point is gradually changed according to the set rules, so that the fitting accuracy is continuously increased until the system design requirements are met. According to the accuracy requirements set by the system, a corresponding number of iterations will be generated. When the number of iterations reaches the set number, the algorithm iteration can end.

[0116] This invention uses a multi-step fitting and multiple iterations to fit the geometric center, which gradually reduces the pixel range covered by the virtual pixel matrix and gradually improves the fitting accuracy of the geometric center. Compared with constructing all virtual pixels under the target accuracy at once, this greatly reduces the amount of computation while ensuring the fitting accuracy of the geometric center.

[0117] The above-described specific embodiments are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Various modifications, substitutions, and improvements made by those skilled in the art to the technical solutions of the present invention based on the provided textual description and drawings, without departing from the design concept and spirit of the present invention, should all fall within the scope of protection of the present invention.

Claims

1. A method for fitting the geometric center of a centrally symmetric image, characterized in that, Includes the following steps: S1. Construct a pixel coordinate system based on the original image and obtain the pixel coordinates of the centrally symmetric image edge on the original image; S2. Select the two edge pixels with the largest distance from all edge pixels, and take the midpoint between the two edge pixels with the largest distance as the temporary center point; S3. Construct a virtual pixel matrix in the area surrounding the temporary center point, and select the virtual pixel with the smallest sum of distances to all edge pixels as the new temporary center point. S4. Repeat step S3 until the fitting accuracy of the temporary center point meets the design requirements.

2. The geometric center fitting method according to claim 1, characterized in that, The construction of a virtual pixel matrix in the area surrounding the temporary center point specifically involves: In the k-th iteration, construct n with the current temporary center point as the center. k A virtual pixel matrix is ​​constructed, and the distance between two adjacent pixels is defined as the pixel interval. This is based on the pixel coordinates of the current temporary center point and the ratio between the virtual pixel interval and the actual pixel interval. k Get the coordinates of all virtual pixels. , ), i = 1, 2, ..., n k j=1, 2, ..., n k n k n represents the number of virtual pixels in each row and column of the virtual pixel matrix in the k-th iteration. k >1, k <1.

3. The geometric center fitting method according to claim 2, characterized in that, The ratio between the virtual pixel range and the actual pixel range k To set parameters.

4. The geometric center fitting method according to claim 2, characterized in that, When k=1, the actual pixel is set as the parent pixel. When k>1, the virtual pixel generated in the (k-1)th iteration is set as the parent pixel. Then, in the kth iteration, each row and column of the virtual pixel matrix covers m pixels. k The parent pixel is obtained from this. k = k-1 ×(m k -1) / (n k -1), where k initial value =1, and n k >m k >2.

5. The geometric center fitting method according to claim 4, characterized in that, During the iteration process, n k Always equal to n, m k If it always equals m, then k = k-1 ×(m-1) / (n-1), n>m>2.

6. The geometric center fitting method according to claim 2, characterized in that, n k It is an odd number.

7. The geometric center fitting method according to claim 2, characterized in that, During the iteration process, the ratio between the virtual pixel interval and the actual pixel interval... k It shows a decreasing trend.

8. The geometric center fitting method according to claim 7, characterized in that, The fitting accuracy of the temporary center point meets the design requirements, specifically including: Ratio between virtual pixel range and actual pixel range k ≤ set threshold β; or, The number of iterations k ≥ the set threshold ɑ.

9. The geometric center fitting method according to claim 2, characterized in that, The process of selecting the virtual pixel with the smallest sum of distances to all edge pixels specifically involves: For each virtual pixel ( , ), calculate its relationship with all edge pixels respectively. , The sum of the Euclidean distances between virtual pixels is calculated, and the sum of the distances of all virtual pixels is compared to select the virtual pixel with the smallest sum of distances. The formula for calculating the sum of Euclidean distances is as follows: or p = 1, 2, ..., z, where z is the total number of edge points.

10. The geometric center fitting method according to claim 1, characterized in that, The specific steps for obtaining the pixel coordinates of the centrally symmetric image edge on the original image are as follows: Obtain a centrally symmetric image from the original image. For each pixel in the centrally symmetric image, determine whether the pixel value of each pixel in its neighborhood is greater than the segmentation threshold. If the pixel value of each pixel in its neighborhood is greater than the segmentation threshold, then the current pixel is an internal point; otherwise, it is an edge point.

11. The geometric center fitting method according to claim 10, characterized in that, Obtaining a centrally symmetric image from the original image involves: The original image is segmented using a segmentation threshold to obtain the centrally symmetric image.

12. The geometric center fitting method according to claim 1, characterized in that, The formula for calculating the Euclidean distance between the edge pixels is as follows: or ,in( , )and( , ) represents the coordinates of any two edge pixels.

13. The geometric center fitting method according to claim 1, characterized in that, Let the coordinates of the two edge pixels with the largest distance be a( , ) and b( , If ), then the pixel coordinates of the midpoint between the two are (( + ) / 2,( + ) / 2).

Citation Information

Patent Citations

  • Cover defect detection method based on image processing

    CN106251352A

  • Stable high-performance circle feature detection method

    CN106530347A