A method for measuring the diameter of a circular arc
By employing a dynamic frequency search mechanism and a bat algorithm based on a cooperative mutation mode, combined with conformal filters and a curvature-slope fusion strategy, the noise interference and data sparsity problems in online detection of incomplete circular arcs are solved. This enables high-precision and robust extraction of circular arc parameters, meeting the online detection requirements of components such as automotive swing arms.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHANGCHUN INST OF TECH
- Filing Date
- 2026-04-20
- Publication Date
- 2026-07-03
Smart Images

Figure CN122041737B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of precision measurement technology, and in particular relates to a method for measuring the diameter of a circular arc. Background Technology
[0002] The rapid development of the automotive industry has placed higher demands on the machining precision of parts. Typical structural components, such as automotive control arm assemblies, often employ R-shaped radius transitions at key connection points to optimize stress distribution and avoid localized stress concentrations, thereby affecting the fatigue life of the parts and the overall structural reliability. Measuring the geometric dimensions (especially the radius R) of such arc contours is a crucial step in ensuring product quality and driving safety.
[0003] Currently, measurement methods for such circular arcs are mainly divided into two categories: contact and non-contact. While traditional contact measurements offer high accuracy, they suffer from low efficiency, may scratch the workpiece surface, and are difficult to implement for rapid online inspection in production environments. With the development of machine vision and optical sensing technologies, non-contact optical measurement methods (such as laser triangulation and structured light scanning) are increasingly being applied to industrial online inspection due to their high efficiency and non-destructive nature. However, in the actual production environment of complex workpieces such as automotive swing arms, the circular arc to be measured often suffers from structural obstruction and limited installation space, resulting in only a small, incomplete arc (usually less than 90°) with a narrow central angle—a "non-complete arc"—that can be obtained. Simultaneously, factors such as vibration, oil contamination, lighting variations, and workpiece surface reflection characteristics in the workshop environment introduce a large number of noise points, leading to a low signal-to-noise ratio and scarce effective feature information in the acquired point cloud data. These factors collectively make it difficult for existing conventional fitting algorithms to achieve robust arc parameter extraction, becoming a major technical bottleneck restricting the accuracy and reliability of online inspection.
[0004] To address the fitting problem of incomplete circular arcs, existing technologies have proposed several solutions. For example, some studies have employed punching section quality inspection algorithms based on edge feature extraction, but these are primarily designed for sharp edges, are sensitive to noise, and are prone to mis-extraction in noisy scenarios with sparse point clouds. Another approach is fillet modeling algorithms based on rounded section lines, which typically rely on ideal geometric model assumptions and are insufficiently adaptable to random errors and outliers in actual measurements. Furthermore, visual measurement methods for pin shaft circular holes based on multiple anti-interference strategies, while improving anti-interference capabilities through multiple strategies, suffer from high algorithm complexity and inherent defects when fitting incomplete circular arcs with very limited information, including unstable convergence, susceptibility to initial value influences, and poor robustness to noise and outliers. These methods still have significant limitations in practical industrial applications, especially for parts such as automotive swing arms, where high-efficiency online inspection is required. They cannot stably and accurately perform precise inverse calculations of circular arc parameters under the dual constraints of strong noise interference and scarce data points. Summary of the Invention
[0005] In view of this, the present invention aims to provide a method for measuring the diameter of an arc, which significantly improves the fitting accuracy and robustness of incomplete arcs under strong noise and sparse point cloud conditions, effectively avoids the problem of traditional methods easily getting trapped in local optima, and realizes fast, stable and high-precision online detection of small arc radii in parts such as automobile swing arms.
[0006] To achieve the above objectives, the technical solution created by this invention is implemented as follows:
[0007] This invention provides a method for measuring the diameter of an arc, comprising:
[0008] S1: Acquire the 3D point cloud data of the test piece;
[0009] S2: Extract the two-dimensional cross-sectional contour line formed by the intersection of three-dimensional point cloud data and a spatial plane, use a conformal filter to denoise and differentiate the two-dimensional cross-sectional contour line, and identify the target arc segment based on the curvature and slope of each point in the denoised and differentiated two-dimensional cross-sectional contour line.
[0010] S3: The Bat Algorithm, based on a dynamic frequency search mechanism and a cooperative mutation mode, is used to perform optimal circle fitting on the target circular arc segment.
[0011] A search space is constructed with the center coordinates and radius of the optimal circle as the objective function. The optimal circle parameter solution is searched in the search space through a dynamic frequency search mechanism. The dynamic frequency search mechanism is as follows: a nonlinear adaptive attenuation factor is introduced to dynamically adjust the emission frequency of each bat in the bat algorithm, and a gradient-guided strategy is used to adjust the velocity vector of each bat.
[0012] The minimum value of the objective function is used as the fitness value. The cooperative mutation mode of each bat is dynamically selected based on the rate of change of the fitness value. The cooperative mutation modes include: Gaussian perturbation, optimal guidance mutation and boundary reflection mutation.
[0013] The bat's position is iteratively updated based on a dynamic frequency search mechanism and a cooperative mutation mode, and the optimal bat position is output. Based on the optimal bat position, the center coordinates and radius of the optimal circle corresponding to the target arc segment are determined.
[0014] Preferably, before extracting the two-dimensional cross-sectional contour line formed by the intersection of the three-dimensional point cloud data and a spatial plane, the process further includes:
[0015] The 3D point cloud data is converted to a standard coordinate system to eliminate errors caused by the placement and pose of the measured object.
[0016] Preferably, the conformal filter denoises and differentiates the two-dimensional cross-sectional contour line using a quadratic polynomial fitting method. The conformal filter is as follows:
[0017] ;
[0018] in, This represents the y-axis coordinate of any i-th point on the two-dimensional cross-sectional profile line of the conformal filter fitting output. The index of the center point of the current differential window. is the fitting coefficient, and k is the polynomial order.
[0019] Preferably, the curvature of each point in the denoised and differentiated two-dimensional cross-sectional profile. The calculation formula is:
[0020] ;
[0021] in, Represents the x-coordinate of a point. Represents the ordinate of a point. , represents the first derivative of the x-axis with respect to the parameter t. , represents the first derivative of the ordinate with respect to the parameter t. , representing the second derivative of the x-axis with respect to the parameter t. , representing the second derivative of the ordinate with respect to the parameter t;
[0022] The slope of each point in the denoised and differentiated 2D cross-sectional profile The calculation formula is:
[0023] ;
[0024] in, It is the arctangent function.
[0025] Preferably, the identification of target circular arc segments based on the fusion of curvature and slope at each point in the denoised and differentiated two-dimensional cross-sectional contour includes:
[0026] Set the curvature confidence level for each point for:
[0027] ;
[0028] in, Indicates the size of the differential window. This represents the curvature at that point calculated when the differential window size is 5. This represents the curvature at that point calculated when the differential window size is 7. It is a function for maximizing the value;
[0029] Based on curvature confidence Determine whether each point belongs to the target arc segment:
[0030] like The point is considered to belong to the target arc segment;
[0031] like The judgment is based on the curvature continuity between the point and its adjacent points;
[0032] like The geometric consistency between the rate of change of slope and curvature at a point is determined. If the error between the rate of change of slope and curvature is less than a preset value, the point is considered to belong to the target circular arc segment.
[0033] Preferably, before using the bat algorithm based on dynamic frequency search mechanism and cooperative mutation mode to perform optimal circle fitting on the target arc segment, the following parameters need to be initialized:
[0034] Population size N, maximum number of iterations T, objective function The initial position of each bat Initial position change Initial sound loudness Initial pulse emission rate and frequency range .
[0035] Preferably, the objective function for:
[0036] ;
[0037] in, The total number of two-dimensional point cloud data corresponding to the target arc segment, i.e., the population size. and Let these be the coordinates of the center of the optimal circle. Let be the radius of the optimal circle.
[0038] Preferably, the search space is constructed as follows:
[0039] ;
[0040] in, and This is an empirical coefficient. Let i be the coordinates of the i-th point in the target arc segment. Let the coordinates of the centroid of the point set representing the target circular arc segment be given. Tolerance for the optimal center position of the circle This represents the optimal circle radius tolerance.
[0041] Preferably, the optimal circular parameter solution is searched within the search space using a dynamic frequency search mechanism, including:
[0042] Define the initial position vector of any k-th bat. for:
[0043] ;
[0044] in, The initial guess is the coordinates of the center and radius of the initial guessed circle, and U is a uniformly distributed random number.
[0045] The emission frequency of the k-th bat in the bat algorithm is dynamically adjusted by a nonlinear adaptive attenuation factor. The formula for calculation is:
[0046] ;
[0047] in, Minimum transmission frequency, The maximum transmission frequency is given by t, the current iteration number is given by t, and the maximum iteration number is given by T.
[0048] The velocity vector of the kth bat is adjusted using a gradient-guided strategy as follows:
[0049] ;
[0050] in, Let the velocity vector of the k-th bat in generation t be denoted as . This represents the optimal bat position in generation t. This represents the position vector of the k-th bat in generation t. Indicates the gradient learning rate. Indicates the objective function in The gradient at that point.
[0051] Preferably, the Gaussian perturbation is expressed as:
[0052] ;
[0053] in, This is the updated bat position vector. Let be the noise loudness of generation t. Let Variance be the variance of the Gaussian perturbation. The numbers are Gaussian distributed random numbers.
[0054] The optimal guidance mutation is represented as:
[0055] ;
[0056] in, The difference coefficient of variation, and Let the position vectors of two randomly selected bats be given.
[0057] Boundary reflection variation is represented as:
[0058] ;
[0059] in, For the j-th dimension component after mutation, Let j be the j-th dimension component of the k-th bat in generation t. Let j be the lower bound of the search space. This is the upper bound of the j-th dimension search space.
[0060] Compared with the prior art, the present invention can achieve the following beneficial effects:
[0061] To address the problems of incomplete point cloud pre-data processing and high noise interference in existing technologies, this invention employs a coordinate system automatic correction method based on principal component analysis to eliminate errors introduced by workpiece placement and pose. It extracts 3D point cloud data and 2D point cloud data intersecting a spatial plane to form a circular arc 2D cross-sectional contour. A curvature-slope fusion strategy is introduced to identify and segment the 2D cross-sectional contour, effectively eliminating interference from straight lines, isolated noise points, and measurement anomalies, providing clean input data for subsequent fitting. To address the shortcomings of existing fitting algorithms, such as getting trapped in local optima and unstable convergence under conditions of low information and high noise, this invention uses a dynamic frequency search mechanism and a bat algorithm with a cooperative mutation mode for optimal circle fitting. A data-driven strategy is used to construct a target-oriented search space, avoiding blind searching. A nonlinear adaptive decay factor is introduced to balance global exploration and local exploitation capabilities. A bat algorithm with three cooperative mutation modes—Gaussian perturbation, optimal guided mutation, and boundary reflection mutation—is designed. The mutation mode is dynamically selected based on the ranking and standard rate of change of each bat, significantly improving convergence speed and solution accuracy while maintaining population diversity. This invention can stably and accurately complete the precision measurement of the arc diameter under harsh conditions where point cloud data is sparse and contains a lot of noise. It meets the requirements of high precision and high efficiency for online inspection of complex parts such as automotive swing arm assemblies and has good application prospects. Attached Figure Description
[0062] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments and descriptions of the invention are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0063] Figure 1 This is a flowchart of a method for measuring the diameter of an arc according to an embodiment of the present invention;
[0064] Figure 2 This is a schematic diagram of a three-dimensional point cloud of a test piece provided according to an embodiment of the present invention;
[0065] Figure 3 This is a schematic diagram of a three-dimensional point cloud after the pose correction of the test piece according to an embodiment of the present invention;
[0066] Figure 4 This is a schematic diagram of the position of the two-dimensional cross-sectional contour line of the test piece according to an embodiment of the present invention;
[0067] Figure 5 This is a schematic diagram of the identification and separation of the two-dimensional cross-sectional contour line of the test piece according to an embodiment of the present invention;
[0068] Figure 6 This is a schematic diagram of optimal circle fitting based on the bat algorithm according to an embodiment of the present invention. Detailed Implementation
[0069] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only for explaining the invention and do not constitute a limitation thereof. Similar elements in different embodiments are referred to by associated similar element reference numerals. In the following embodiments, many details are described to facilitate a better understanding of the invention. However, those skilled in the art will readily recognize that some features may be omitted in different situations, or may be replaced by other elements, materials, or methods. In some cases, some operations related to the invention are not shown or described in the specification. This is to avoid obscuring the core parts of the invention with excessive description. For those skilled in the art, detailed description of these related operations is not necessary; the relevant operations can be fully understood based on the description in the specification and general technical knowledge in the art.
[0070] It should be noted that, unless otherwise specified, the embodiments and features described in this invention can be combined to form various implementations. Furthermore, the order of the steps or actions in the method description can be changed or adjusted in a manner readily apparent to those skilled in the art. Therefore, the various orders in the specification and drawings are merely for the clear description of a particular embodiment and do not imply a mandatory order, unless otherwise stated that a particular order must be followed.
[0071] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on this invention. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.
[0072] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0073] The invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0074] Please see Figure 1 In one embodiment of the present invention, a method for measuring the diameter of an arc is provided, comprising:
[0075] S1: Acquire the 3D point cloud data of the test piece;
[0076] S2: Extract the two-dimensional cross-sectional contour line formed by the intersection of three-dimensional point cloud data and a spatial plane, use a conformal filter to denoise and differentiate the two-dimensional cross-sectional contour line, and identify the target arc segment based on the curvature and slope of each point in the denoised and differentiated two-dimensional cross-sectional contour line.
[0077] S3: The Bat Algorithm, based on a dynamic frequency search mechanism and a cooperative mutation mode, is used to perform optimal circle fitting on the target circular arc segment.
[0078] A search space is constructed with the center coordinates and radius of the optimal circle as the objective function. The optimal circle parameter solution is searched in the search space through a dynamic frequency search mechanism. The dynamic frequency search mechanism is as follows: a nonlinear adaptive attenuation factor is introduced to dynamically adjust the emission frequency of each bat in the bat algorithm, and a gradient-guided strategy is used to adjust the velocity vector of each bat.
[0079] The minimum value of the objective function is used as the fitness value. The cooperative mutation mode of each bat is dynamically selected based on the rate of change of the fitness value. The cooperative mutation modes include: Gaussian perturbation, optimal guidance mutation and boundary reflection mutation.
[0080] The bat's position is iteratively updated based on a dynamic frequency search mechanism and a cooperative mutation mode, and the optimal bat position is output. Based on the optimal bat position, the center coordinates and radius of the optimal circle corresponding to the target arc segment are determined.
[0081] In step S1, the small arc diameter measurement on the workpiece can be performed using a non-contact optical measuring device, such as a laser 3D contour measuring instrument. The workpiece includes, but is not limited to, parts such as automotive swing arms, where the R-arc is typically located in a concave or corner position. Compared to traditional contact measurement, non-contact visual measurement significantly improves workpiece measurement efficiency. During the measurement process, the laser 3D contour measuring instrument can acquire 3D point cloud data along a certain length of the arc cross-section of the workpiece, providing a data foundation for subsequent arc extraction and optimal circle fitting. The acquired original 3D point cloud data is shown below. Figure 2 As shown.
[0082] In step S2, the original 3D point cloud data needs to be corrected and its contours accurately segmented to extract the point cloud data corresponding to the target arc segment. The correction and segmentation process of the 3D point cloud data is as follows:
[0083] S21: To achieve coordinate system alignment, an automatic coordinate system correction method based on principal component analysis is adopted. The covariance matrix of the 3D point cloud data is calculated, and then eigenvalue decomposition is used to transform the original 3D point cloud data to the standard coordinate system. This coordinate system transformation aligns the measured part from the measurement coordinate system to the standard coordinate system, thereby compensating for unavoidable physical placement deviations and preventing errors introduced by the workpiece's placement pose from interfering with subsequent arc diameter measurements. The corrected 3D point cloud data is as follows: Figure 3 As shown.
[0084] S22: After the 3D point cloud data is calibrated, a specified spatial plane is selected in the standard coordinate system, and this spatial plane intersects with the 3D point cloud data. All points on the intersecting plane are extracted to form a graph as shown below. Figure 4 The two-dimensional cross-sectional profile of the measured part on the specified spatial plane is shown.
[0085] After obtaining the two-dimensional cross-sectional contour line, a conformal filter is used to preprocess the contour line, achieving noise reduction and differential calculation. This eliminates noise points introduced during visual measurement due to factors such as vibration, oil stains, lighting changes, and workpiece surface reflectivity in the workshop environment. In this embodiment, a high-precision conformal filter with quadratic polynomial fitting is used, simultaneously performing noise reduction and differential calculation on the two-dimensional cross-sectional contour line. The mathematical expression of the conformal filter is:
[0086] ;
[0087] in, This represents the y-axis coordinate of any i-th point on the two-dimensional cross-sectional profile line of the conformal filter fitting output. The index of the center point of the current differential window. Here, k represents the fitting coefficients, and k is the polynomial order. This is because the y-axis coordinate values... In reality, this represents the smoothed coordinates of the dependent variable, while the independent variable is the index position i. Therefore, in the actual processing, only the y-coordinate is processed.
[0088] The aforementioned conformal filter simultaneously achieves denoising and differentiation of the two-dimensional cross-sectional contour. Further steps require obtaining the curvature of each point within the differentiation window. and slope Based on the curvature and slope of each point in the denoised and differentiated 2D cross-sectional contour, the 2D cross-sectional contour is fused, identified, and segmented, such as... Figure 5 As shown, the two-dimensional cross-sectional contour line includes arcs, straight line segments, transition segments, and R-angle portions. The target circular arc segment corresponding to the R-angle is extracted. Specifically, during the target circular arc segment identification process, the curvature of each point is calculated. The process is as follows:
[0089] First, the two-dimensional cross-sectional profile is parameterized, and its parametric equation is expressed as:
[0090] ;
[0091] Where r(t) is the position vector. For each parameter value t, the vector r(t) corresponds to a point on the two-dimensional cross-sectional contour line. t is a parameter, x(t) is the abscissa function of the point on the curve, and y(t) is the abscissa function of the point on the curve.
[0092] The curvature of any point in the denoised and differentiated two-dimensional cross-sectional profile is then... It can be represented as:
[0093] ;
[0094] in, Represents the x-coordinate of a point. Represents the ordinate of a point. , represents the first derivative of the x-axis with respect to the parameter t. , represents the first derivative of the ordinate with respect to the parameter t. , representing the second derivative of the x-axis with respect to the parameter t. , which represents the second derivative of the ordinate with respect to the parameter t. It measures the rate of change in velocity direction, reflecting the degree of local curvature of the curve; This is used to offset the influence of parameter selection on the magnitude of the derivative, thereby ensuring that curvature is a geometric quantity independent of the parameterization method, thus guaranteeing curvature. It can accurately describe the degree of curvature of a curve at a certain point.
[0095] After obtaining the curvature, it is possible to determine whether each point in the point cloud belongs to the target arc segment based on the curvature and curvature distribution of each point, so as to accurately segment the part of the point cloud corresponding to the target arc segment from the overall point cloud. For each point to determine whether it belongs to the target arc segment, this embodiment of the invention sets a curvature confidence level. As an evaluation metric, the curvature confidence score at each point for:
[0096] ;
[0097] in, Indicates the size of the differential window. This represents the curvature at that point calculated when the differential window size is 5. This represents the curvature at that point calculated when the differential window size is 7. It is a function for maximizing the value.
[0098] Curvature confidence The confidence level is assessed by comparing curvature calculation results under different window sizes. Specifically:
[0099] For any point, if If the curvature of the point matches the curvature characteristics of the target arc segment, then the point is considered to belong to the target arc segment.
[0100] like If the curvature calculated by the two windows differs slightly, it could be because the point is located in a geometric transition zone (such as a region that gradually bends from a straight line to an arc), or it could be a slight isolated noise point or a measurement anomaly. In this case, a secondary verification needs to be initiated based on the curvature of the point's neighboring points. The continuity of curvature between the point and its neighboring points should be used to distinguish between true geometric transition zones, isolated noise points, and measurement anomalies. For example, if the curvature of the point's neighboring points changes gradually, the point may be in a geometric transition zone; if the point is completely discontinuous with its neighboring points, showing a curvature jump, the point may be an isolated noise point or a measurement anomaly and needs to be removed.
[0101] like This indicates a significant difference in curvature calculated by the two windows. In this case, a simple curvature determination is unreliable, and the point might be a very sharp noise point or an extremely weak curvature. Such low-confidence regions require joint decision-making combining curvature and slope; that is, relying solely on curvature is insufficient, and slope features must be introduced. Joint decision-making utilizes a dual check of curvature and slope. By calculating the geometric consistency between the rate of change of slope and curvature, weights are used to fuse the features of both, with the slope weight increased when a region is identified as a low-confidence region.
[0102] The slope of each point in the denoised and differentiated 2D cross-sectional profile The calculation formula is:
[0103] ;
[0104] in, It is the arctangent function. This represents the first derivative of the x-coordinate on the curve with respect to the arc length parameter. It represents the first derivative of the coordinate y on the curve with respect to the arc length parameter.
[0105] A point can only be considered part of the target circular arc segment if the error between the rate of change of slope and curvature is less than a preset value. The rate of change of slope can effectively distinguish between straight lines and curves: the standard deviation of the slope for a straight line segment should be less than 5°, while the rate of change of slope for a circular arc segment must meet the following requirements:
[0106] ;
[0107] Where R is the radius and s is the arc length parameter.
[0108] When the rate of change of the slope at that point satisfies If the slope change conforms to the law of circular arc, then even if the calculated curvature is inconsistent, the point is considered to be part of the target circular arc segment.
[0109] This completes the extraction of the target circular arc segment.
[0110] In step S3, since the extracted target arc segment is only a non-complete arc with a small central angle, optimal circle fitting is required to achieve accurate measurement of the radius (R) parameter of the measured part. Figure 6 As shown, the diameter is measured based on the optimal circle obtained through fitting. Specifically, in this embodiment of the invention, the Bat Algorithm, based on a dynamic frequency search mechanism and a cooperative mutation mode, is used to perform optimal circle fitting on the target arc segment, which includes the following steps:
[0111] S31: Initialize the bat algorithm parameters. The parameters that need to be initialized include:
[0112] Population size N, maximum number of iterations T, objective function The initial position of each bat Initial position change Initial sound loudness Initial pulse emission rate and frequency range .
[0113] The point cloud data of the target arc segment obtained in step S2 is further expressed as follows: , i=1,2,…,N.
[0114] Therefore, an optimization model that minimizes geometric error is established, i.e., the objective function. for:
[0115] ;
[0116] in, The total number of two-dimensional point cloud data corresponding to the target arc segment, i.e., the population size. and Let these be the coordinates of the center of the optimal circle. Let be the radius of the optimal circle.
[0117] S32: To improve the convergence speed and target retrieval accuracy of the algorithm, this embodiment of the invention improves upon the traditional bat algorithm by innovatively designing a dynamic frequency search mechanism and a cooperative mutation mode. This enhances the ability to refine local searches while avoiding getting trapped in local optima. Specifically, to avoid blindly searching for the optimal value of the objective function, the search space is first initialized as follows:
[0118] ;
[0119] in, and This is an empirical coefficient. , , Let i be the coordinates of the i-th point in the target arc segment. Let the coordinates of the centroid of the point set representing the target circular arc segment be given. Tolerance for the optimal center position of the circle To achieve the optimal circle radius tolerance, Let represent the Euclidean distance from the i-th point to the centroid of the point set.
[0120] By constructing the aforementioned search space to replace traditional random or traversal search methods, the blindness of the search is effectively avoided.
[0121] Within the search space, define the initial position vector of any k-th bat. for:
[0122] ;
[0123] in, The initial guess solution is the coordinates of the center and radius of the initial guess circle, U is a uniformly distributed random number, and k is the index of the individual bat.
[0124] To enhance the bats' ability to perform refined local searches of the solution space, a dynamic frequency search mechanism is implemented to search for optimal circular parameter solutions within the search space. This mechanism introduces a nonlinear adaptive attenuation factor to dynamically adjust algorithm parameters, dynamically adjusting the firing frequency of each bat according to different stages, thereby automatically adjusting the search step size and search range. The firing frequency determines the bat's flight speed and the magnitude of position updates. In the initial stage of searching a large area where the optimal solution might exist, the number of iterations is small, and the bats fly at a high frequency with large speed variations, enabling them to quickly scan the entire search space, find areas where the center of the arc might exist, and quickly understand the overall situation of the search space. As the number of iterations increases, the frequency gradually decreases, shifting from initial "random flight" to moving closer to the optimal solution. When the number of iterations reaches a certain level, the bats fly at a low frequency, performing refined searches within local areas, and finding the optimal solution.
[0125] The emission frequency of the k-th bat in the bat algorithm is dynamically adjusted by a nonlinear adaptive attenuation factor. The formula for calculation is:
[0126] ;
[0127] in, Minimum transmission frequency, The maximum transmission frequency is denoted by t, the current iteration number is t, and the maximum iteration number is T.
[0128] To further improve search efficiency and reduce algorithm convergence time, a gradient-guided strategy is adopted to adjust the bat's velocity vector and control the bat's update direction. During the iteration process, the algorithm autonomously balances global exploration and local development behaviors to improve the convergence speed and solution accuracy.
[0129] The velocity vector of the kth bat is adjusted using a gradient-guided strategy as follows:
[0130] ;
[0131] in, Let the velocity vector of the k-th bat in generation t be denoted as . This represents the optimal bat position in generation t. This represents the position vector of the k-th bat in generation t. Indicates the gradient learning rate. Indicates the objective function in The gradient at that point.
[0132] Furthermore, to avoid getting trapped in local optima, a cooperative mutation mode was designed for bat updates, including three specific mutation directions: Gaussian perturbation, optimal guidance mutation, and boundary reflection mutation. By using the minimum value of the objective function as the fitness value, the cooperative mutation mode of each bat is dynamically selected according to the rate of change of the fitness value, which can improve convergence efficiency while maintaining population diversity.
[0133] The Gaussian perturbation is represented as:
[0134] ;
[0135] in, This is the updated bat position vector. Let be the noise loudness of generation t. Let Variance be the variance of the Gaussian perturbation. The numbers are Gaussian distributed random numbers.
[0136] The optimal guidance mutation is represented as:
[0137] ;
[0138] in, The difference coefficient of variation, and Let the position vectors of two randomly selected bats be given.
[0139] Boundary reflection variation is represented as:
[0140] ;
[0141] in, For the j-th dimension component after mutation, Let j be the j-th dimension component of the k-th bat in generation t. Let j be the lower bound of the search space. This is the upper bound of the j-th dimension search space.
[0142] S33: Based on the search strategy of S32, the objective function is used to solve for the positions of all bats after flight. Each iteration finds multiple new predicted solutions, i.e., the bat position obtained in the current iteration represents a solution to the optimization problem. All new predicted solutions in the current iteration are compared to determine the next update search strategy. All bats are updated to the next iteration state according to the update search strategy, and the above process is repeated until the optimal bat position is obtained. Based on the optimal bat position, the center coordinates and radius of the optimal circle corresponding to the target arc segment are determined. The termination condition is reaching the maximum number of iterations or the difference between the optimal solution and the target solution for 20 consecutive iterations being less than 1. .
[0143] In summary, the above description is merely a preferred embodiment of this specification and is not intended to limit the scope of protection of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.
[0144] The systems, apparatuses, modules, or units described in one or more of the above embodiments may be implemented by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer. Specifically, a computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.
[0145] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0146] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
Claims
1. A method of measuring the diameter of a circular arc, characterized by, include: S1: Acquire the 3D point cloud data of the test piece; S2: Extract the two-dimensional cross-sectional contour line formed by the intersection of the three-dimensional point cloud data and a spatial plane, use a conformal filter to denoise and differentiate the two-dimensional cross-sectional contour line, and identify the target arc segment based on the curvature and slope of each point in the denoised and differentiated two-dimensional cross-sectional contour line. The method for identifying target arc segments based on the curvature and slope fusion of each point in the denoised and differentiated two-dimensional cross-sectional contour includes: Setting the curvature confidence of each point is: ; wherein, denotes the size of the differentiation window, denotes the curvature of the point calculated with a differentiation window size of 5, denotes the curvature of the point calculated with a differentiation window size of 7, is a maximum function; Curvature confidence-based determining whether each point belongs to the target arc segment: If , the point is considered to belong to the target arc segment; If , the curvature continuity between the point and the adjacent point is judged; If , the geometric consistency of the slope change rate and the curvature is judged, and when the error between the slope change rate and the curvature is less than a preset value, it is considered that the point belongs to the target circular arc segment; S3: The target arc segment is fitted with the optimal circle using the bat algorithm based on dynamic frequency search mechanism and cooperative mutation mode: A search space is constructed with the center coordinates and radius of the optimal circle as the objective function. The optimal circle parameter solution is searched in the search space through the dynamic frequency search mechanism. The dynamic frequency search mechanism is as follows: a nonlinear adaptive attenuation factor is introduced to dynamically adjust the emission frequency of each bat in the bat algorithm, and a gradient-guided strategy is used to adjust the velocity vector of each bat. The minimum value of the objective function is used as the fitness value, and the cooperative mutation mode of each bat is dynamically selected according to the rate of change of the fitness value. The cooperative mutation modes include: Gaussian perturbation, optimal guidance mutation and boundary reflection mutation. The bat's position is iteratively updated based on the dynamic frequency search mechanism and the cooperative mutation mode, and the optimal bat position is output. The center coordinates and radius of the optimal circle corresponding to the target arc segment are determined based on the optimal bat position.
2. The arc diameter measurement method according to claim 1, wherein Before extracting the two-dimensional cross-sectional contour line formed by the intersection of the three-dimensional point cloud data and a spatial plane, the following steps are also included: The three-dimensional point cloud data is converted to a standard coordinate system to eliminate errors caused by the placement and pose of the measured object.
3. The arc diameter measurement method according to claim 1, wherein The conformal filter denoises and differentiates the two-dimensional cross-sectional contour line using a quadratic polynomial fitting method. The conformal filter is as follows: ; wherein, represents a y-axis coordinate value of an arbitrary i-th point on a two-dimensional cross-sectional profile line of the conformal filter fit output, is a center point index of the current differential window, is a fitting coefficient, and k is a polynomial order.
4. The method for measuring the diameter of a circular arc according to claim 1, characterized in that, curvature of each point in the two-dimensional cross-sectional profile after denoising and differentiation The calculation formula is: ; wherein denotes the abscissa of the point, denotes the ordinate of the point, denotes the first derivative of the abscissa with respect to the parameter t, denotes the first derivative of the ordinate with respect to the parameter t, denotes the second derivative of the abscissa with respect to the parameter t, denotes the second derivative of the ordinate with respect to the parameter t; The slope of each point in the denoised and differentiated 2D cross-sectional profile The calculation formula is: ; in, It is the arctangent function.
5. The method for measuring the diameter of a circular arc according to claim 2, characterized in that, Before using the bat algorithm based on dynamic frequency search mechanism and cooperative mutation mode to perform optimal circle fitting on the target circular arc segment, the following parameters need to be initialized: Population size N, maximum number of iterations T, objective function The initial position of each bat Initial position change Initial sound loudness Initial pulse emission rate and frequency range .
6. The method for measuring the diameter of an arc according to claim 5, characterized in that, The objective function for: ; in, The total number of two-dimensional point cloud data corresponding to the target arc segment, i.e., the population size. and Let these be the coordinates of the center of the optimal circle. Let be the radius of the optimal circle.
7. The method for measuring the diameter of a circular arc according to claim 6, characterized in that, The search space is constructed as follows: ; in, and This is an empirical coefficient. Let i be the coordinates of the i-th point in the target arc segment. Let the coordinates of the centroid of the point set representing the target circular arc segment be given. Tolerance for the optimal center position of the circle This represents the optimal circle radius tolerance.
8. The method for measuring the diameter of an arc according to claim 7, characterized in that, The process of searching for the optimal circular parameter solution within the search space using the dynamic frequency search mechanism includes: Define the initial position vector of any k-th bat. for: ; in, The initial guess solution is the coordinates of the center and radius of the initial guess circle, and U is a uniformly distributed random number. The emission frequency of the k-th bat in the bat algorithm is dynamically adjusted using a nonlinear adaptive attenuation factor. The formula for calculation is: ; in, Minimum transmission frequency, The maximum transmission frequency is given by t, the current iteration number is given by t, and the maximum iteration number is given by T. The velocity vector of the kth bat is adjusted using a gradient-guided strategy as follows: ; in, Let the velocity vector of the k-th bat in generation t be denoted as . This represents the optimal bat position in generation t. This represents the position vector of the k-th bat in generation t. Indicates the gradient learning rate. Indicates the objective function in The gradient at that point.
9. The method for measuring the diameter of a circular arc according to claim 8, characterized in that, The Gaussian perturbation is represented as: ; in, This is the updated bat position vector. Let be the noise loudness of generation t. Let Variance be the variance of the Gaussian perturbation. The numbers are Gaussian distributed random numbers. The optimal guided mutation is represented as: ; in, The difference coefficient of variation, and Let the position vectors of two randomly selected bats be given. The boundary reflection variation is represented as: ; in, For the j-th dimension component after mutation, Let j be the j-th dimension component of the k-th bat in generation t. Let j be the lower bound of the search space. This is the upper bound of the j-th dimension search space.
Citation Information
Patent Citations
Visual measurement method and system for small circular arc of angle R of incomplete vehicle body
CN116086355A
Unmanned aerial vehicle three-dimensional path planning method based on dynamic adaptive differential bat algorithm
CN119063724A