A method for quickly identifying a circular arc target against stray light interference
By combining downsampling, eight-neighbor tracking, and gradient estimator, the problem of high-precision circular arc recognition under limited hardware resources is solved, achieving fast and interference-resistant circular arc recognition, which is suitable for industrial product inspection and spacecraft target aiming.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2026-03-24
AI Technical Summary
Under limited hardware resources, existing technologies struggle to achieve high-precision, interference-resistant arc recognition, and also suffer from long computation time and high memory consumption.
A combined approach of downsampling, eight-neighborhood tracking, contour detection, inflection point detection, and gradient estimator is adopted. By performing binarized image processing and contour segmentation, circular targets can be quickly identified. A gradient estimator is designed to determine the edge shape and estimate the center and radius of the circle.
It achieves high-precision arc recognition under conditions of small memory and low clock frequency, has strong anti-stray light interference capability, fast recognition speed, and is suitable for embedded boards with limited hardware resources.
Smart Images

Figure CN115511943B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a method for quickly identifying a circular arc target with anti-glare interference, and belongs to the technical field of image processing. BACKGROUND
[0002] In the field of classical image processing recognition, a circular feature is one of the main recognition targets. Contour circularity measurement method, three-point circle fitting method, Hough circle transformation method and random Hough circle transformation method are the most commonly used classical circle recognition algorithms. Among them, 1) the contour circularity measurement method is extremely simple and fast in recognition, but cannot recognize a circular arc, and the calculation accuracy and anti-interference ability are poor; 2) the three-point circle fitting method is simple in calculation and small in memory occupation, but cannot recognize a missing circle or a circular arc segment, and has weak anti-glare ability; 3) the Hough circle transformation method and the improved random Hough circle transformation method can realize circular arc recognition, but have large memory occupation and long calculation time. Considering that in some special application scenarios with limited hardware resources, how to realize a strong-robust and high-precision circular arc recognition algorithm under glare interference on the premise of meeting special requirements such as small memory occupation and fast recognition speed is a research problem to be solved by the application. SUMMARY
[0003] The technical problem of the application is to overcome the shortcomings of the prior art and provide a method for quickly identifying a circular arc target with anti-glare interference, which realizes a strong-robust and high-precision circular arc recognition algorithm under glare interference on the premise of meeting special requirements such as small memory occupation and fast recognition speed.
[0004] The technical solution of the application is:
[0005] The application discloses a method for quickly identifying a circular arc target with anti-glare interference, comprising:
[0006] performing down-sampling processing on a current image, and converting the image processed by the down-sampling into a gray-scale image;
[0007] adopting a binary image processing method to convert the gray-scale image into a binary image;
[0008] adopting an eight-neighborhood tracking method to identify a contour sequence point set in the binary image;
[0009] adopting a contour detection method to convert the binary image into a contour image according to the contour sequence point set;
[0010] designing a corner point detection method to divide the contour image into a plurality of edges according to the contour sequence point set;
[0011] designing a gradient estimator to judge the shape of the edge according to a convergence judgment condition, and if the edge is a circular arc, estimating the horizontal coordinate of the center of the edge, the vertical coordinate of the center of the edge and the radius of the edge.
[0012] In the above recognition algorithm, the method of using binarization image processing to convert the grayscale image into a binary image is specifically: the Otsu thresholding method or the fast Otsu thresholding method is used to calculate the segmentation threshold of the grayscale image, and the grayscale image is converted into a binary image with only a black background and a white foreground according to the segmentation threshold.
[0013] In the above recognition algorithm, the step of converting the binary image into a contour image using a contour detection method based on the contour sequence point set is as follows:
[0014] Calculate the total number of contour pixels for each contour in the contour sequence point set;
[0015] The contours in the contour sequence point set are filtered based on the total number of contour pixels.
[0016] The selected contours form a contour map.
[0017] In the above recognition algorithm, the specific method for filtering contours in the contour sequence point set based on the total number of contour pixels is as follows:
[0018] If the total number of contour pixels is less than the minimum number of input points, then remove the contour corresponding to the total number of contour pixels.
[0019] If the total number of outline pixels is less than the minimum number of pixels, then remove the outline corresponding to the total number of outline pixels.
[0020] Otherwise, the contour corresponding to the total number of contour pixels is the selected contour.
[0021] In the above recognition algorithm, the step of designing an inflection point detection method based on the contour sequence point set to segment the contour map into multiple edges is as follows:
[0022] Traverse the contour sequence point set and calculate the line segments. and The angle between ;
[0023] When the included angle When the value is less than the preset inflection point detection threshold, the q-th point is determined to be an inflection point;
[0024] Using the inflection point as the dividing point, a contour is divided into multiple edges with a single feature.
[0025] In the above recognition algorithm, the calculation of the straight line segment and The angle θ between them is given by the formula:
[0026]
[0027] in, Let q be the pixel coordinates of the currently detected point. Let be the pixel coordinates of the qt-th point preceding the q-th point in the sequence. The pixel coordinates are the (q+t)th point after the qth point in the sequence.
[0028] In the above recognition algorithm, the edge of a single feature refers to an edge that contains only one of the following: a straight line, a point, a curve, an arc, or a ring.
[0029] In the above recognition algorithm, the gradient estimator is designed to determine the shape of the edge based on the convergence criterion. If the edge is an arc, the x-coordinate of the center, y-coordinate of the center, and radius of the edge are estimated. The specific method is as follows:
[0030] The gradient estimator is designed using the following formula:
[0031]
[0032] In the formula, To update the estimated x-coordinate of the circle center learning rate, To update the estimated ordinate of the circle center The learning rate To update the radius estimate The learning rate , , This is the estimated value for the j-th iteration. , , Let be the estimated value for the (j+1)th iteration; N is the number of sampling points, and i is the sequence number. j represents the iteration number, j=1,…,P, where P is the maximum iteration number; Here is the state equation for the gradient estimator;
[0033] Increasing the value of j, iterating P times to calculate the gradient, and obtaining P values. , , and , , The value;
[0034] Within the maximum number of iterations P, if , , and , , If the value satisfies the convergence criterion Q times consecutively, then the detected edge is determined to be an arc. , , are estimated values of the horizontal coordinate of the center, the vertical coordinate of the center and the radius of the edge; if the number of iterations reaches P times and the convergence determination condition cannot be continuously satisfied, the detected edge is determined as a non-circular arc.
[0035] In the above identification algorithm, the state equation of the gradient estimator is , and the formula is:
[0036]
[0037] wherein, , , is the estimated value of the jth iteration, is a pixel coordinate on the contour, and i is a serial number, .
[0038] In the above identification algorithm, the convergence determination condition is specifically:
[0039]
[0040] wherein, , , are respectively the estimated error of the horizontal coordinate of the center, the vertical coordinate of the center and the radius in the (j+1)th iteration, , , are respectively the steady-state error determination condition values of the estimated horizontal coordinate of the center, the vertical coordinate of the center and the radius.
[0041] The present application has the beneficial effects over the prior art in that:
[0042] (1) The present application proposes a center and radius parameter estimation algorithm based on a gradient estimator, which can identify a missing circle or a circular arc, has small memory occupation, high identification precision, fast identification speed and can resist stray light interference. Compared with a profile roundness measurement method and a three-point circle fitting method, the present application has stronger robustness and higher identification precision, and can realize circular arc identification when a target circular ring is partially blocked under stray light interference. Compared with a Hough circle transformation method and a random Hough circle transformation method, the present application has smaller memory requirement and faster identification speed, and can be applied to a limited hardware resource condition.
[0043] (2) The present application realizes an image processing algorithm suitable for an embedded board with small memory and low frequency. The algorithm data occupies only a single image memory. The Hough circle transformation method and the random Hough circle transformation method not only need to store an original image matrix, but also need to store an accumulator matrix, a gradient matrix and an edge matrix, and thus have large space occupation.
[0044] (3) The application designs an edge inflection point detection method using profile slope. The inflection points in the profile are quickly judged by calculating the included angle of three points, and the profile is divided into multiple edges with single characteristics.
[0045] (4) The application solves the problems of low recognition accuracy and slow recognition speed of the incomplete circle, and can be applied to the circle and arc recognition scene under complex lighting environment, or the fast circle and arc recognition scene under the condition of limited hardware resources, and is suitable for industrial product detection, spacecraft target aiming docking and other fields. Compared with the classic circle recognition algorithm, the application has higher recognition accuracy, recognition speed and stronger anti-glare interference ability. BRIEF DESCRIPTION OF DRAWINGS
[0046] Figure 1 It is the anti-glare interference arc recognition algorithm flowchart based on the gradient estimator of the application. DETAILED DESCRIPTION
[0047] The application patent will be further described in detail below in combination with the drawings and specific embodiments.
[0048] The application discloses an anti-glare interference arc target fast recognition method, comprising:
[0049] Step one, the current image is processed by downsampling, and the image processed by downsampling is converted into a gray image;
[0050] Step two, a binary image processing method is used to convert the gray image into a binary image, specifically: the threshold segmentation of the gray image is calculated by using the Otsu threshold method or the fast Otsu threshold method, and the gray image is converted into a binary image with only black background and white foreground according to the threshold segmentation.
[0051] Step three, an eight-neighborhood tracking method is used to identify the contour sequence point set in the binary image;
[0052] Step four, according to the contour sequence point set, a contour detection method is used to convert the binary image into a contour image, and the specific method is:
[0053] Step S41: the total number of contour pixels of each contour in the contour sequence point set is calculated;
[0054] Step S42: the contours in the contour sequence point set are screened according to the total number of contour pixels, and the specific method is:
[0055] If the total number of contour pixels is less than the minimum input point set number, the contour corresponding to the total number of contour pixels is removed;
[0056] If the total number of contour pixels is less than the minimum pixel number, the contour corresponding to the total number of contour pixels is removed;
[0057] Otherwise, the contour corresponding to the total number of contour pixels is the screened contour.
[0058] Step S43: The selected contours are used to form a contour map.
[0059] Step 5: Based on the contour sequence point set, design an inflection point detection method to segment the contour map into multiple edges. The specific method is as follows:
[0060] Step S51: Traverse the contour sequence point set and calculate the line segments. and The included angle θ between them;
[0061] The formula is:
[0062]
[0063] in, Let q be the pixel coordinates of the currently detected point. Let be the pixel coordinates of the qt-th point preceding the q-th point in the sequence. The pixel coordinates are the (q+t)th point after the qth point in the sequence.
[0064] Step S52: When the included angle When the value is less than the preset inflection point detection threshold, the q-th point is determined to be an inflection point;
[0065] Step S53: Using the inflection point as the dividing point, divide a contour into multiple edges with a single feature. An edge with a single feature refers to an edge that contains only one of the following: a straight line, a point, a curve, an arc, or a ring.
[0066] Step 6: Design a gradient estimator. Based on the convergence criterion, determine the shape of the edge. If the edge is an arc, estimate the x-coordinate of the center, y-coordinate of the center, and radius. The specific method is as follows:
[0067] The gradient estimator is designed using the following formula:
[0068]
[0069] In the formula, To update the estimated x-coordinate of the circle center The learning rate To update the estimated ordinate of the circle center The learning rate To update the radius estimate The learning rate , , This is the estimated value for the j-th iteration. , , Let be the estimated value for the (j+1)th iteration; N is the number of sampling points, and i is the sequence number. j represents the iteration number, j=1,…,P, where P is the maximum iteration number; Here is the state equation for the gradient estimator;
[0070] State equation of gradient estimator The formula is:
[0071]
[0072] in, , , This is the estimated value for the j-th iteration. Here are the pixel coordinates on the contour, and i is the sequence number. .
[0073] Increasing the value of j, iterating P times to calculate the gradient, and obtaining P values. , , and , , The value;
[0074] Within the maximum number of iterations P, if , , and , , If the value satisfies the convergence criterion Q times consecutively, then the detected edge is determined to be an arc. , , The values are the estimated x-coordinates, y-coordinates, and radius of the edge. If the convergence criteria cannot be continuously met after P iterations, the detected edge is determined to be a non-circular arc.
[0075] The convergence criteria are as follows:
[0076]
[0077] In the formula, , , Let be the estimation errors of the x-coordinate, y-coordinate, and radius estimates at the (j+1)th iteration, respectively. , , These are the steady-state error criteria values for the abscissa of the circle center, ordinate of the circle center, and radius estimation, respectively.
[0078] Example 1
[0079] like Figure 1As shown in the figure, a method for rapid identification of circular targets with resistance to stray light interference in this embodiment includes the following steps:
[0080] Step 1: Downsample the current image and convert it to grayscale. In this example, the input image is 1024. A 1024-byte 8-bit grayscale image is converted to 512 by downsampling. A 512-byte 8-bit grayscale image has its storage space reduced to 0.25 times that of the original image.
[0081] Step 2: The image is converted into a binary image using binarization image processing methods such as the Otsu thresholding method. In this embodiment, the fast OTSU algorithm is used to calculate the image grayscale threshold and segment the image into a white foreground and a black background.
[0082] Step 3: Use the eight-neighbor tracking method to convert the binary image into a contour image.
[0083] Step 4: Design an inflection point detection method, traverse the contour sequence point set, and record the currently detected inflection point. q The pixel coordinates of each point are The first point before that point q-t The pixel coordinates of each point are The first point after that point q+t The pixel coordinates of each point are Calculate the line segment and The angle between the points. When the angle is less than the inflection point detection threshold, the current point is determined to be an inflection point, and the contour is segmented into single-feature edges. The contour is segmented into multiple edges, each edge should contain only a single feature such as an arc, a straight line segment, or a curve segment. In this embodiment, the t-value in inflection point detection is set to 10, and the inflection point detection threshold is set to 120°.
[0084] Step 5: Design a gradient estimator to estimate three parameters of the edge to be detected: the x-coordinate of the center, the y-coordinate of the center, and the radius. Collect sparse point set information for each edge and feed a small number of edge points into the gradient estimator for iterative calculation. If the edge is an arc segment, the estimator will eventually converge to a stable error range, thus obtaining the x-coordinate, y-coordinate, and radius of the arc edge. If the edge is not an arc segment, the estimator will not converge to the error range within a finite number of iterations. In this embodiment, the sparse point set of the edge is taken as 10 points evenly distributed, the maximum number of iterations is 300, and the steady-state error is... , , All are 0.05, learning rate , , All are 0.01.
[0085] The algorithm flow chart is as follows Figure 1 as shown, the algorithm pseudo code is as follows:
[0086] while (1) { / / Initial large circle positioning for the first frame
[0087] 1 - Initialization definition
[0088] 2 - Lock: Lock the current image address range of the FPGA to prevent new images from overwriting;
[0089] 3 - Downsampled image reading: Ensure that the occupied memory < the maximum image storage area of the DSP on - chip memory;
[0090] 4 - Binarization: Accelerate the Otsu threshold method, calculate the image grayscale, and obtain the binary image;
[0091] 5 - Synchronization of contour tracking and arc recognition:
[0092] for( k = 0; k < total number of contours K; k++) {
[0093] Detect contour corner points and segment the contour into multiple edges;
[0094] for( m = 0; m < total number of edges M; m++) {
[0095] Obtain a sparse point set evenly distributed on the edge ;
[0096] Calculate the cost function ;
[0097] Iteratively update the estimated value of the gradient estimator ;
[0098] if( Satisfied continuously for 10 times)
[0099] Confirm that this edge is an arc and mark the estimated values of the center and radius;
[0100] }
[0101] }
[0102] }
[0103] In some special application scenarios, embedded DSP chips often have limited memory and low clock frequencies. Commonly used image - processing algorithms such as the OpenCV library have high requirements for memory space and main frequency, and are difficult to be applied to image - processing target recognition. In this embodiment, the DSP selects the chip TMS320C6415, with a clock frequency of 600 MHz and a memory of 1 M, which is a fixed - point processor. However, for only a single 1440 An 8-bit image of size 1440 requires 1.97 MB of memory. A complete traversal and read operation of this image using a 600 MHz DSP takes approximately 7.6 ms. Some commonly used image processing algorithms in OpenCV, such as the Hough transform, have even higher requirements for memory and computing power. In this invention, image memory is reduced through downsampling, and the gradient estimator requires only one times the image memory, with an algorithm processing frequency exceeding 10 Hz. In contrast, the Hough circle transform and stochastic Hough circle transform methods require storing not only the original image matrix but also the accumulator matrix, gradient matrix, and edge matrix, resulting in a larger memory footprint.
[0104] Although the present invention has been described in detail through the preferred embodiments above, it should be understood that the above description should not be considered as a limitation of the present invention. Various modifications and substitutions to the present invention will be apparent to those skilled in the art after reading the above description. Therefore, the scope of protection of the present invention should be defined by the appended claims.
[0105] The contents not described in detail in this specification are common knowledge to those skilled in the art.
Claims
1. A method for rapid identification of circular arc targets with resistance to stray light interference, characterized in that, include: The current image is downsampled, and the downsampled image is converted into a grayscale image. The grayscale image is converted into a binary image using a binarization image processing method. The eight-neighbor tracking method is used to identify the contour sequence point set in the binary image; Based on the contour sequence point set, a contour detection method is used to convert the binary image into a contour image; Based on the contour sequence point set, an inflection point detection method is designed to segment the contour map into multiple edges; Design a gradient estimator to determine the shape of the edge based on the convergence criteria. If the edge is an arc, estimate the x-coordinate of the center, y-coordinate of the center, and radius of the edge. The gradient estimator is designed to determine the shape of the edge based on the convergence criterion. If the edge is an arc, the x-coordinate of the center, y-coordinate of the center, and radius of the edge are estimated. The specific method is as follows: The gradient estimator is designed using the following formula: In the formula, To update the estimated x-coordinate of the circle center The learning rate To update the estimated ordinate of the circle center The learning rate To update the radius estimate The learning rate , , This is the estimated value for the j-th iteration. , , Let be the estimated value for the (j+1)th iteration; N is the number of sampling points, and i is the sequence number. j represents the iteration number, j=1,…,P, where P is the maximum iteration number; Here is the state equation for the gradient estimator; Increasing the value of j, iterating P times to calculate the gradient, and obtaining P values. , , and , , The value; Within the maximum number of iterations P, if , , and , , If the value satisfies the convergence criterion Q times consecutively, then the detected edge is determined to be an arc. , , The estimated values are the x-coordinate of the center, y-coordinate of the center, and radius of the edge. If the convergence condition cannot be continuously met after P iterations, the detected edge is determined to be a non-circular arc. The state equation of the gradient estimator The formula is: in, , , This is the estimated value for the j-th iteration. Here are the pixel coordinates on the contour, and i is the sequence number. .
2. The method for rapid identification of circular targets with resistance to stray light interference according to claim 1, characterized in that: The method of using binarization image processing to convert the grayscale image into a binary image specifically involves: calculating the segmentation threshold of the grayscale image using the Otsu thresholding method or the fast Otsu thresholding method, and converting the grayscale image into a binary image with only a black background and a white foreground based on the segmentation threshold.
3. The method for rapid identification of circular targets with resistance to stray light interference according to claim 1, characterized in that: The step involves converting the binary image into a contour image using a contour detection method based on the contour sequence point set. The specific method is as follows: Calculate the total number of contour pixels for each contour in the contour sequence point set; The contours in the contour sequence point set are filtered based on the total number of contour pixels. The selected contours form a contour map.
4. The method for rapid identification of circular targets with resistance to stray light interference according to claim 3, characterized in that: The specific method for filtering contours in the contour sequence point set based on the total number of contour pixels is as follows: If the total number of contour pixels is less than the minimum number of input points, then remove the contour corresponding to the total number of contour pixels. If the total number of outline pixels is less than the minimum number of pixels, then remove the outline corresponding to the total number of outline pixels. Otherwise, the contour corresponding to the total number of contour pixels is the selected contour.
5. The method for rapid identification of circular targets with resistance to stray light interference according to claim 1, characterized in that: The inflection point detection method is designed based on the contour sequence point set to segment the contour map into multiple edges. The specific method is as follows: Traverse the contour sequence point set and calculate the line segments. and The angle between ; When the included angle When the value is less than the preset inflection point detection threshold, the q-th point is determined to be an inflection point; Using the inflection point as the dividing point, a contour is divided into multiple edges with a single feature.
6. The method for rapid identification of circular targets with resistance to stray light interference according to claim 5, characterized in that: The calculated straight line segment and The angle between The formula is: in, Let q be the pixel coordinates of the currently detected point. Let be the pixel coordinates of the qt-th point preceding the q-th point in the sequence. The pixel coordinates are the (q+t)th point after the qth point in the sequence.
7. The method for rapid identification of circular targets with resistance to stray light interference according to claim 5, characterized in that: The edge of a single feature refers to an edge that contains only one of the following: a straight line, a point, an arc, or a ring.
8. The method for rapid identification of circular targets with resistance to stray light interference according to claim 1, characterized in that: The convergence determination condition is as follows: In the formula, , , Let be the estimation errors of the x-coordinate, y-coordinate, and radius estimates at the (j+1)th iteration, respectively. , , These represent the steady-state error criteria values for the abscissa, ordinate, and radius estimation of the circle center, respectively. , and , respectively, are the estimated values of the x-coordinate of the circle's center, the y-coordinate of the circle's center, and the radius in the (j+1)th iteration. , and These are the estimated values of the x-coordinate of the circle's center, y-coordinate of the circle's center, and radius in the j-th iteration, respectively.
Citation Information
Patent Citations
Yarn cone identification method and system based on circular convolution kernel under complex background
CN114663457A
Shape determination method
JP2008298706A