Thread pitch diameter measuring method and device, storage medium and equipment
By acquiring preprocessed point cloud data of the thread target area and using improved algorithm processing, high-precision and low-cost internal thread diameter measurement are achieved, solving the problems of low accuracy and high cost of mechanical measurement methods.
Patent Information
- Application Number
- CN202411118074.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-20
AI Technical Summary
The existing internal thread diameter measurement method mainly relies on mechanical measurement method, which has problems such as low accuracy, high cost and inability to implement on a large scale.
Preprocessed point cloud data for the thread target area is adopted to obtain the thread target area, and based on the improved fusion area growth algorithm, eigenvalue analysis algorithm and optimized regeneration weight least squares algorithm, point cloud data is processed to obtain the middle diameter parameters of the thread.
It realizes high-precision and low-cost internal thread diameter measurement, which can be implemented on a large scale, solving the problems of small accuracy and high cost of mechanical measurement methods.
Smart Images

Figure CN119164304A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of battery charging technology, and in particular to a method, device, storage medium and equipment for measuring the mid-diameter of a thread. Background Art
[0002] Internal threads are widely used in the machinery industry, mainly in parts for fastening, sealing, power transmission and displacement. Their manufacturing level plays a vital role in the reliability, working performance and even normal function of mechanical parts connection. However, due to the complex internal structure and shape of the internal thread and the relatively small internal space, there is no tool that can easily and accurately measure the mean diameter of the internal thread at this stage. At present, the measurement of internal threads is to judge whether the processed internal threads are qualified by the through and stop ends of the thread plug gauge, and the specific mean diameter parameters of the internal threads cannot be given. For the precision thread fit used for fastening, simply judging whether the internal thread is qualified is far from meeting the engineering needs. Interference assembly requires the interference to calculate the assembly torque loaded on the bolt, and by controlling the mean diameter value of the internal thread, it has an interference when fitting, resulting in an interference fit. Too high an interference will cause thread damage, and too low an interference will cause the bolt to loosen, causing major accidents and disasters. Therefore, it is necessary to accurately measure the mean diameter of the internal thread.
[0003] At present, the main method for measuring the middle diameter of internal threads is mechanical measurement, which has the problems of low accuracy, high cost and inability to be implemented on a large scale. Summary of the invention
[0004] The main purpose of the present application is to provide a method, device, storage medium and equipment for measuring the mean diameter of a thread, aiming to solve the technical problems that the current method for measuring the mean diameter of an internal thread is mainly a mechanical measurement method, which has the disadvantages of low precision, high cost and inability to be implemented on a large scale.
[0005] To achieve the above-mentioned objectives, the present application provides a thread mean diameter measurement method, device, storage medium and equipment, including obtaining pre-processed point cloud data within a thread target area; processing the cloud data based on an improved fusion region growing algorithm to obtain point cloud contour data of the thread; processing the point cloud contour data based on an eigenvalue analysis algorithm to obtain mean diameter point cloud data of the thread; processing the mean diameter point cloud data based on an optimized regeneration weighted least squares algorithm to obtain fitted thread mean diameter parameters.
[0006] Optionally, the obtaining of preprocessed point cloud data within the thread target area includes: obtaining point cloud data in three-dimensional coordinates; processing the point cloud data using a moving least squares algorithm to obtain denoised point cloud data; and processing the denoised point cloud data using a curvature filtering algorithm to obtain preprocessed point cloud data.
[0007] Optionally, the point cloud data is processed based on the improved fusion region growing algorithm to obtain the point cloud contour data of the thread, including: processing the point cloud data to be processed based on the k-means algorithm to obtain the grouped point cloud data to be processed; replacing the neighborhood radius calculation formula in the fusion region growing algorithm with a preset formula to obtain an improved fusion region growing algorithm; processing the grouped point cloud data to be processed based on the improved fusion region growing algorithm to obtain the point cloud contour data after boundary merging and clustering.
[0008] Optionally, before processing the point cloud contour data based on the eigenvalue analysis algorithm to obtain the mid-diameter point cloud data of the thread, the thread mid-diameter measurement method further includes: processing the point cloud contour data using a random sample consistency algorithm to obtain each straight line in the point cloud contour data and all point cloud data on the straight line.
[0009] Optionally, the point cloud contour data is processed based on the eigenvalue analysis algorithm to obtain the mid-diameter point cloud data of the thread, including: calculating the local covariance matrix of each straight line and all the point cloud data on the straight line; performing eigenvalue decomposition on the local covariance matrix to obtain eigenvalues and eigenvectors; and obtaining the mid-diameter point cloud data of the thread based on the eigenvalues and the eigenvectors.
[0010] Optionally, the method of processing the mid-diameter point cloud data based on the optimized regenerative weighted least squares algorithm to obtain the fitted cylindrical point cloud of the mid-diameter of the thread includes: obtaining the mid-diameter parameter of the thread; obtaining a residual function based on the mid-diameter point cloud data and the mid-diameter parameter, and determining an objective function based on the residual function; initializing a group of beluga whales, i.e., a potential solution, using the beluga algorithm, wherein each beluga whale represents a set of parameter estimates of the mid-diameter of the thread; in each iteration of the beluga algorithm, using each potential solution in the current population to calculate the weight in the regenerative weighted least squares algorithm; simulating the social behavior of beluga whales according to the beluga algorithm and updating the positions of each beluga whale after each iteration; calculating the residual value of the residual function based on the updated positions of each beluga whale as the potential solution, and updating the weight value of the objective function based on the residual value; calculating the objective function value based on the updated weight value and the positions of each beluga whale; determining the position of the beluga whale according to the optimal solution of the objective function, and determining the mid-diameter parameter of the thread based on the position of the beluga whale.
[0011] Optionally, after obtaining the fitted thread pitch diameter parameter, the thread pitch diameter measurement method further includes: outputting the thread pitch diameter.
[0012] In order to achieve the above-mentioned purpose, the present invention also provides a thread mean diameter measuring device, comprising: an acquisition module, used to acquire pre-processed point cloud data within a thread target area; a contour generation module, used to process the cloud data based on an improved fusion region growing algorithm to obtain point cloud contour data of the thread; a mean diameter point cloud generation module, used to process the point cloud contour data based on an eigenvalue analysis algorithm to obtain mean diameter point cloud data of the thread; and a mean diameter calculation module, used to process the mean diameter point cloud data based on an optimized regeneration weighted least squares algorithm to obtain the fitted thread mean diameter parameters.
[0013] In order to achieve the above-mentioned object, the present invention also provides a computer-readable storage medium, which includes instructions, and when the instructions are run on a computer, the computer executes the thread pitch diameter measuring method.
[0014] In order to achieve the above-mentioned purpose, the present invention also provides an electronic device, which includes a processor, a communication interface, a memory and a communication bus. The processor, the communication interface and the memory communicate with each other through the communication bus. The memory is used to store a computer program. The processor is used to execute the computer program stored in the memory to implement the thread diameter measurement method.
[0015] The embodiments of the present application propose a method, device, storage medium and equipment for measuring the mean diameter of a thread, which obtains pre-processed point cloud data within a target area of the thread; processes the point cloud data based on an improved fusion region growing algorithm to obtain point cloud contour data of the thread; processes the point cloud contour data based on an eigenvalue analysis algorithm to obtain point cloud data of the mean diameter of the thread; processes the mean diameter point cloud data based on an optimized regenerative weighted least squares algorithm to obtain fitted parameters of the mean diameter of the thread, thereby solving the problem that the current method for measuring the mean diameter of an internal thread is mainly a mechanical measurement method, which has the technical problems of low precision, high cost and inability to be implemented on a large scale. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flow chart of a method for measuring the pitch diameter of a thread provided in an embodiment of the present application; Figure 2 A structural block diagram of a thread pitch diameter measuring device provided in an embodiment of the present application; Figure 3 A schematic diagram of the storage medium structure provided in an embodiment of the present application; Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0017] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0018] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0019] The existing methods for measuring the thread center diameter mainly include image measurement, mechanical measurement, laser point cloud measurement, etc. The image measurement method relies on image processing algorithms and cannot obtain accurate three-dimensional information. The mechanical measurement method relies on manual or automatic measurement, which brings large errors. Laser point cloud measurement mainly uses the collected point cloud data to calculate the thread center diameter. There will also be errors caused by modeling during the calculation. Therefore, there is a problem of poor accuracy.
[0020] In order to solve the above problems, the present invention provides a method for measuring the pitch diameter of a thread. Figure 1 Flow chart of the thread pitch diameter measurement method provided in the embodiment of the present application, refer to Figure 1 The method may be executed by a processor in an electronic device. The thread pitch diameter measurement method may include the following steps: S10, obtaining pre-processed point cloud data in the thread target area; The target area may be an inner area of any nut with an internal thread, and the area may be the entire area of the internal thread of the nut or a partial area of the internal thread.
[0021] Specifically, before step S10, the thread pitch diameter measurement method may further include: S51, obtaining point cloud data in a three-dimensional coordinate system; Specifically, the measurer can use a three-dimensional scanner with a scanning probe to scan the inner area of the nut circumferentially, ensure that the nut is fixed during scanning, and extend the three-dimensional scanner into the nut along the direction of the nut axis to scan, and obtain point cloud data in the machine coordinate system. The processor converts the machine coordinates of the point cloud data into three-dimensional space coordinates according to the coordinate conversion algorithm, wherein the origin of the three-dimensional space coordinates of the point cloud data is on the axis of the nut, and the XOY plane of the three-dimensional space coordinates is located at the bottom of the nut. The processor converts the coordinates of the point cloud data into three-dimensional space coordinates, which is more conducive to the subsequent processing of the point cloud data. After obtaining the three-dimensional space coordinates of the point cloud data, the processor needs to import the point cloud data into Matlab. Various file reading functions provided by Matlab can be used to read point cloud files, and various files can be in PLY, PCD or XYZ format, for example. Exemplarily, after reading the point cloud file, the processor can save the point cloud data in a matrix, where each row of the matrix represents the coordinate information of a point. Assuming that a point cloud file contains N points, each point is represented by three coordinate values (x, y, z), the processor can save the point cloud data in an Nx3 matrix.
[0022] S52, using a moving least squares algorithm to process the point cloud data to obtain noise-reduced point cloud data; Specifically, when the processor uses the moving least squares algorithm, it first determines the size of the fitting window, and uses the least squares algorithm to fit the point cloud data in each fitting window to obtain a fitting surface. The processor pushes the fitting window to fit the point cloud data on the contour of the thread, thereby removing the point cloud data that does not belong to the contour, obtaining a rough contour, and achieving the purpose of preliminary noise reduction.
[0023] S53, using a curvature filtering algorithm to process the noise-reduced point cloud data to obtain pre-processed point cloud data; Specifically, the processor calculates the curvature of each point in the contour surface point cloud data obtained in the aforementioned step S52 according to the curvature filtering algorithm. The processor retains points with curvatures lower than the threshold according to a preset curvature threshold, removes or weakens points with high curvature, and obtains preprocessed point cloud data.
[0024] By executing steps S51 to S53, the processor not only improves the efficiency of subsequent processing steps, but also improves the accuracy of the final fitting.
[0025] S20, processing the cloud data based on the improved fusion region growing algorithm to obtain point cloud contour data of the thread; In an embodiment of the present application, step S20 may specifically include the following execution steps: S21. Processing the point cloud data to be processed based on the k-means algorithm to obtain the grouped point cloud data to be processed; S22, using a preset formula to replace the neighborhood radius calculation formula in the fusion region growing algorithm to obtain an improved fusion region growing algorithm; S23. Process the grouped point cloud data to be processed based on the improved fusion region growing algorithm to obtain point cloud contour data after boundary merging and clustering.
[0026] Among them, the improved fusion region growing algorithm adds the k-means algorithm on the basis of the original fusion region growing algorithm. The processor first executes the k-means algorithm on the read point cloud data to realize the grouping of the data set and reduce the time for the subsequent clustering algorithm. Based on the above steps, the processor then adjusts the neighborhood radius Eps to better adapt to point cloud data at different distances, thereby better solving the problem of point cloud close density and far sparseness.
[0027] For example, the processor may use the formula The neighborhood radius is automatically adjusted. is the horizontal angle resolution of the 3D scanner, which is 0.16°. is the horizontal distance from the i-th point to the origin of the 3D scanner, is the neighborhood radius coefficient. The processor uses the improved Density-Based Spatial Clustering of Applications with Noise (DBSCAN) algorithm to cluster the thread profile, which is not limited by the thread profile, thereby further refining the thread profile surface. The improved fusion region growing algorithm has good robustness to noise points.
[0028] S30, processing the point cloud profile data based on an eigenvalue analysis algorithm to obtain the mid-diameter point cloud data of the thread; Before step S30, the thread pitch diameter measurement method may further include the following specific implementation steps: S60, using a random sample consensus algorithm to process the point cloud contour data, to obtain each straight line in the point cloud contour data and all point cloud data on the straight line.
[0029] Exemplarily, when fitting a straight line, the processor first randomly selects two points, then generates a straight line equation in a two-dimensional plane based on the two points, and then calculates the distance from the remaining points to the straight line. If the distance from the remaining points to the straight line is less than a predefined distance threshold, the remaining points are classified as inliers. Conversely, points exceeding this threshold are designated as outliers. Repeat this process, and finally select the straight line with the highest number of inliers as the final fitting result. Through the above process, the processor can automatically identify the straight line portions on the thread, which constitute the bevel of the thread. Through the above steps, the processor can filter out the bevel of the thread and the point cloud data on the bevel from the point cloud contour data. This step facilitates the automatic identification of the mid-diameter point cloud data in the point cloud contour data, and plays a connecting role. This process can be implemented, for example, by OpenCV, PCL (Point Cloud Library), and Open3D software.
[0030] Based on the above steps, step S30 may include the following specific implementation methods: S31, calculating the local covariance matrix of each straight line and all point cloud data on the straight line; S32, performing eigenvalue decomposition on the local covariance matrix to obtain eigenvalues and eigenvectors; S33. Obtaining the mid-diameter point cloud data of the thread according to the eigenvalues and eigenvectors.
[0031] On the basis of step S60, the processor first determines a neighborhood based on the eigenvalue analysis algorithm, then obtains the centroid of other points in the neighborhood of any point on each straight line of the point cloud contour data, and calculates the deviation vectors from other points in the neighborhood to the centroid, and uses these deviation vectors to construct a covariance matrix. The processor performs eigenvalue decomposition on each local covariance matrix to obtain a set of eigenvalues and corresponding eigenvectors. Among them, the eigenvalue represents the distribution variance of other points in the neighborhood of the point in the direction of the eigenvector, and the eigenvector represents the main direction of these distributions. Similarly, after obtaining the eigenvalues of all points on the straight line, the processor selects the point with the second largest eigenvalue as the mid-diameter point, thereby completing the calculation process of the mid-diameter point. Since the thread bevel is composed of many straight lines, the mid-diameter point cloud data can be obtained by calculating the mid-diameter point of each straight line in turn. The above steps S31-step S33 can be implemented by combining a point cloud processing library (such as PCL, Open3D, etc.) with a numerical linear algebra library (such as Eigen, LAPACK, etc.). The above steps can automatically and accurately calculate the median diameter point, laying the foundation for fitting the accurate median diameter value in the next step.
[0032] S40, processing the mid-diameter point cloud data based on the optimized regeneration weight least squares algorithm to obtain the fitted thread mid-diameter parameters.
[0033] In an embodiment of the present application, step S40 may include the following specific implementation process: S41, obtaining the pitch diameter parameter of the thread; S42, obtaining a residual function according to the median diameter point cloud data and the median diameter parameter, and determining an objective function according to the residual function; S43, using the White Whale algorithm to initialize a group of White Whales, i.e., a potential solution, wherein each White Whale represents a set of parameter estimation values of the thread pitch diameter; S44, in each iteration of the White Whale algorithm, using each potential solution in the current population to calculate the weight in the regenerative weight least squares algorithm; S45, simulating the social behavior of beluga whales according to the beluga algorithm and updating the position of each beluga whale after each iteration; S46, calculating the residual value of the residual function according to the updated positions of each beluga whale as a potential solution, and updating the weight value of the objective function according to the residual value; S47, calculating the objective function value according to the updated weight value and the position of each beluga whale; S48. Determine the white whale position according to the optimal solution of the objective function, and determine the thread pitch diameter parameter according to the white whale position.
[0034] Specifically, the processor uses the acquired mid-diameter point cloud data as observation data, uses the cylindrical surface function carrying the mid-diameter parameter as a model function, and uses the difference between the observation data and the model function as a residual.
[0035] The residual expression can be: r i = y i - f ( x i, p ) in, y i Represents the median point cloud data, x i represents the independent variable, p is the parameter vector to be estimated, r i represents the residual;
[0036] in, is the residual of the previous iteration, ϵ is a small positive number to avoid division by zero, C is a constant used to control the rate of weight update; the objective function of the least squares algorithm for regenerative weights can be expressed as:
[0037] In the embodiment of the present application, the White Whale algorithm is combined with the regeneration weight least squares algorithm to quickly determine the weight parameters of the regeneration weight least squares algorithm. Specifically, by executing steps S41 to S48, the cylindrical surface of the median diameter point cloud data can be fitted using the optimized regeneration weight least squares algorithm, thereby achieving accurate estimation of the median diameter parameters, where the median diameter is the radius of the cylindrical surface.
[0038] After step S40, the thread pitch diameter measurement method further includes the following specific implementation steps: S70, outputting the thread pitch diameter. Specifically, the embodiment of the present invention can output the thread pitch diameter data in a numerical form, and after obtaining the thread pitch diameter data, the measurer can compare it with the thread pitch diameter data in the design parameters to obtain the error range, and can also guide the production of the thread according to the thread pitch diameter data.
[0039] In summary, the present invention proposes a thread pitch diameter measurement method, device, storage medium and equipment, which obtains pre-processed point cloud data in the thread target area; processes the point cloud data based on the improved fusion region growing algorithm to obtain the point cloud contour data of the thread; processes the point cloud contour data based on the eigenvalue analysis algorithm to obtain the thread pitch diameter point cloud data; processes the pitch diameter point cloud data based on the optimized regeneration weight least squares algorithm to obtain the thread pitch diameter parameter after fitting, which solves the current measurement method of the internal thread pitch diameter mainly using the mechanical measurement method, which has the technical problems of low precision, high cost and inability to be implemented on a large scale. Based on the above embodiment, the embodiment of the present invention further provides a thread diameter measuring device, Figure 2 For the structural diagram of the thread diameter measuring device provided in the embodiment of the present application, refer to Figure 2 The thread center diameter measuring device 100 may include an acquisition module 101, a contour generation module 102, a center diameter point cloud generation module 103 and a center diameter calculation module 104, wherein the acquisition module 101 may be used to acquire pre-processed point cloud data in a thread target area; the contour generation module 102 may be used to process cloud data based on an improved fusion region growing algorithm to obtain point cloud contour data of the thread; the center diameter point cloud generation module 103 may be used to process point cloud contour data based on an eigenvalue analysis algorithm to obtain center diameter point cloud data of the thread; the center diameter calculation module 104 may be used to process center diameter point cloud data based on an optimized regenerative weighted least squares algorithm to obtain fitted thread center diameter parameters.
[0040] Specifically, the thread diameter measuring device 100 may further include a preprocessing module 105, which may be used to obtain point cloud data under three-dimensional coordinates; process the point cloud data using a moving least squares algorithm to obtain denoised point cloud data; and process the denoised point cloud data using a curvature filtering algorithm to obtain preprocessed point cloud data.
[0041] Specifically, the contour generation module 102 can be used to process the point cloud data to be processed based on the k-means algorithm to obtain the grouped point cloud data to be processed; use a preset formula to replace the neighborhood radius calculation formula in the fusion region growing algorithm to obtain an improved fusion region growing algorithm; process the grouped point cloud data to be processed based on the improved fusion region growing algorithm to obtain the point cloud contour data after boundary merging and clustering.
[0042] Specifically, the thread diameter measuring device 100 may further include a straight line acquisition module 106, which may be used to process the point cloud contour data using a random sample consensus algorithm to obtain each straight line in the point cloud contour data and all point cloud data on the straight line.
[0043] Specifically, the mid-diameter point cloud generation module 103 can be used to calculate the local covariance matrix of each straight line and all point cloud data on the straight line; perform eigenvalue decomposition on the local covariance matrix to obtain eigenvalues and eigenvectors; and obtain the mid-diameter point cloud data of the thread based on the eigenvalues and eigenvectors.
[0044] Specifically, the median diameter calculation module 104 can be used to obtain the median diameter parameters of the thread; obtain the residual function based on the median diameter point cloud data and the median diameter parameters, and determine the objective function based on the residual function; use the White Whale algorithm to initialize a group of white whales, that is, a potential solution, where each white whale represents a set of parameter estimates of the median diameter of the thread; in each iteration of the White Whale algorithm, use each potential solution in the current population to calculate the weight in the regenerative weighted least squares algorithm; simulate the social behavior of white whales according to the White Whale algorithm and update the positions of each white whale after each iteration; use the updated positions of each white whale as the potential solution, calculate the residual value of the residual function, and update the weight value of the objective function based on the residual value; calculate the objective function value based on the updated weight value and the position of each white whale; determine the position of the white whale according to the optimal solution of the objective function, and determine the median diameter parameters of the thread based on the position of the white whale.
[0045] The thread pitch diameter measuring device 100 may further include an output module 107 , and the output module 107 may be used to output the thread pitch diameter.
[0046] Based on the above embodiments, the present application also provides a computer-readable storage medium, referring to Figure 3 , the computer-readable storage medium shown is a CD 50, on which a computer algorithm (i.e., an algorithm product) is stored. When the computer algorithm is executed by the processor, it will implement the steps described in the above method implementation, for example, obtaining pre-processed point cloud data in the target area of the thread; processing the cloud data based on the improved fusion region growing algorithm to obtain the point cloud contour data of the thread; processing the point cloud contour data based on the eigenvalue analysis algorithm to obtain the mid-diameter point cloud data of the thread; processing the mid-diameter point cloud data based on the optimized regeneration weight least squares algorithm to obtain the fitted thread mid-diameter parameters. The specific implementation methods of each step will not be repeated here. It should be noted that examples of computer-readable storage media may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which will not be repeated here. On the basis of the above embodiments, an embodiment of the present application further provides an electronic device, which includes a processor, a communication interface, a memory and a communication bus. The processor, the communication interface and the memory communicate with each other through the communication bus. The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to implement a dual-voltage battery energy storage device charging method.
[0047] In addition, based on the above embodiments, the present application also provides an electronic device, Figure 4 A block diagram of an exemplary test device 60 suitable for implementing the embodiments of the present application is shown. The test device 60 may be a computer system or a server. Figure 4 The testing device 60 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0048] refer to Figure 4 , the components of the test device 60 may include, but are not limited to: one or more processors or processing units 601 , a system memory 602 , and a bus 603 connecting different system components (including the system memory 602 and the processing unit 601 ).
[0049] The test device 60 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the test device 60, including volatile and non-volatile media, removable and non-removable media.
[0050] The system memory 602 may include computer system readable media in the form of volatile memory, such as random access memory RAM 6021 and / or cache memory 6022. The test device 60 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the ROM 6023 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 is not shown in the Figure 4 As shown in the figure, a disk drive for reading and writing a removable non-volatile disk (such as a "floppy disk") and an optical disk drive for reading and writing a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical media) can be provided. In these cases, each drive can be connected to a bus 603 connecting different system components through one or more data medium interfaces. The system memory 602 may include at least one algorithm product, which has a set (such as at least one) algorithm module, which is configured to perform the functions of each embodiment of the present application.
[0051] An algorithm / utility 6025 having a set (at least one) of algorithm modules 6024 may be stored, for example, in system memory 602, and such algorithm modules 6024 include, but are not limited to: an operating system, one or more application algorithms, other algorithm modules, and algorithm data, each of which or some combination may include an implementation of a network environment. Algorithm modules 6024 generally perform the functions and / or methods of the embodiments described herein.
[0052] The test device 60 may also communicate with one or more external devices 604 (e.g., a keyboard, a pointing device, a display, etc.). Such communication may be performed via an input / output I / O interface 605. Furthermore, the test device 60 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 606. Figure 4 As shown, the network adapter 606 communicates with other modules of the test device 60 (such as the processing unit 601, etc.) via the bus 603 that connects different system components. Figure 4 Not shown, other hardware and / or software program modules may be used in conjunction with the testing device 60 .
[0053] The processing unit 601 executes various functional applications and data processing by running the algorithm stored in the system memory 602, for example, obtaining the pre-processed point cloud data in the target area of the thread; processing the cloud data based on the improved fusion region growing algorithm to obtain the point cloud contour data of the thread; processing the point cloud contour data based on the eigenvalue analysis algorithm to obtain the mid-diameter point cloud data of the thread; processing the mid-diameter point cloud data based on the optimized regeneration weight least squares algorithm to obtain the mid-diameter parameter of the thread after fitting. The specific implementation of each step is not repeated here. The specific implementation of each step is not repeated here. It should be noted that although several units / modules or sub-units / sub-modules of the motion trajectory processing device of the robot are mentioned in the above detailed description, this division is only exemplary and not mandatory. In fact, according to the embodiment of the present application, the features and functions of two or more units / modules described above can be concretized in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be concretized.
[0054] In the description of the present application, it should be noted that the terms "first", "second" and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0055] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0056] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0057] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0058] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0059] If the function is implemented in the form of a software program functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software program product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store algorithm codes.
[0060] Finally, it should be noted that the above embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
[0061] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for measuring the pitch diameter of a thread, characterized in that: include: Obtain pre-processed point cloud data within the thread target area; Processing the point cloud data based on an improved fusion region growing algorithm to obtain point cloud contour data of the thread; Processing the point cloud profile data based on an eigenvalue analysis algorithm to obtain point cloud data of the mid-diameter of the thread; The mid-diameter point cloud data is processed based on the optimized regenerative weighted least squares algorithm to obtain the fitted thread mid-diameter parameters.
2. The thread pitch diameter measuring method according to claim 1, characterized in that: The step of obtaining the pre-processed point cloud data in the thread target area includes: Obtain point cloud data of the thread target area in a three-dimensional coordinate system; Processing the point cloud data using a moving least squares algorithm to obtain denoised point cloud data; The denoised point cloud data is processed using a curvature filtering algorithm to obtain pre-processed point cloud data.
3. The thread pitch diameter measuring method according to claim 1, characterized in that: The step of processing the point cloud data based on the improved fusion region growing algorithm to obtain the point cloud contour data of the thread includes: Processing the point cloud data based on the k-means algorithm to obtain grouped point cloud data to be processed; The neighborhood radius calculation formula in the fusion region growing algorithm is replaced by a preset formula to obtain an improved fusion region growing algorithm. The grouped point cloud data to be processed are processed based on the improved fusion region growing algorithm to obtain point cloud contour data after boundary merging and clustering.
4. The method for measuring the thread pitch diameter according to claim 1, characterized in that: Before the point cloud profile data is processed based on the eigenvalue analysis algorithm to obtain the thread pitch diameter point cloud data, the thread pitch diameter measurement method further includes: The point cloud contour data is processed using a random sample consensus algorithm to obtain each straight line in the point cloud contour data and all point cloud data on the straight line.
5. The method for measuring the thread pitch diameter according to claim 4, characterized in that: The step of processing the point cloud profile data based on the eigenvalue analysis algorithm to obtain the mid-diameter point cloud data of the thread includes: Calculate the local covariance matrix of each straight line and all point cloud data on the straight line; Performing eigenvalue decomposition on the local covariance matrix to obtain eigenvalues and eigenvectors; According to the eigenvalue and the eigenvector, the mid-diameter point cloud data of the thread is obtained.
6. The method for measuring the thread pitch diameter according to claim 5, characterized in that: The method of processing the mid-diameter point cloud data based on the optimized regeneration weighted least squares algorithm to obtain the fitted cylindrical surface point cloud of the thread mid-diameter includes: Obtaining a pitch diameter parameter of the thread; Obtaining a residual function according to the median diameter point cloud data and the median diameter parameter, and determining an objective function according to the residual function; Using the White Whale algorithm, a group of White Whales is initialized, i.e., a potential solution, where each White Whale represents a set of parameter estimates of the thread pitch diameter; In each iteration of the White Whale algorithm, each potential solution in the current population is used to calculate the weight in the regenerative weight least squares algorithm; Simulating the social behavior of beluga whales according to the beluga algorithm and updating the position of each beluga whale after each iteration; Calculate the residual value of the residual function according to the updated positions of each beluga whale as a potential solution, and update the weight value of the objective function according to the residual value; Calculate the objective function value according to the updated weight value and the position of each of the beluga whales; The white whale position is determined according to the optimal solution of the objective function, and the thread pitch diameter parameter is determined according to the white whale position.
7. The thread pitch diameter measuring method according to claim 1, characterized in that: After obtaining the thread pitch diameter parameter after fitting, the thread pitch diameter measurement method further includes: Outputs the thread pitch diameter.
8. A thread diameter measuring device, characterized in that: include: An acquisition module, used to acquire pre-processed point cloud data within a thread target area; A contour generation module, used for processing the cloud data based on an improved fusion region growing algorithm to obtain point cloud contour data of the thread; A mid-diameter point cloud generation module, used for processing the point cloud profile data based on an eigenvalue analysis algorithm to obtain the mid-diameter point cloud data of the thread; The mid-diameter calculation module is used to process the mid-diameter point cloud data based on the optimized regenerative weighted least squares algorithm to obtain the fitted thread mid-diameter parameters.
9. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on a computer, enable the computer to execute the thread pitch diameter measuring method according to any one of claims 1 to 7.
10. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus, characterized in that: a memory for storing a computer program, A processor, wherein the processor is used to execute a computer program stored in a memory to implement the thread pitch diameter measurement method according to any one of claims 1 to 7.
