A method and system for adaptive tracking and measurement of two-dimensional contour width and height using line laser
By using the Kalman filter algorithm to denoise and segment the line laser measurement data, combined with height reference point search, the accuracy and efficiency problems of measuring the width and height of a two-dimensional object using line laser measurement are solved, achieving high-precision and high-efficiency width measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-18
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies for measuring the width and height of a two-dimensional object using line lasers suffer from problems such as high noise levels, significant influence from the light source angle, and large systematic errors, resulting in low measurement accuracy, poor robustness, high computational load, and low efficiency.
The Kalman filter algorithm is used to process the initial contour data in real time to remove noise, detect the number of target objects and process them in segments, obtain the height value based on the segmented search, use the height reference point for search and moving search, and calculate the width value of the target object.
It improves the accuracy and efficiency of contour width and height measurement, reduces the amount of calculation, enhances the robustness of measurement, and realizes adaptive tracking measurement of width values.
Smart Images

Figure CN116576801B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual measurement technology, and in particular to a method, system, device, and computer storage medium for adaptive tracking measurement of two-dimensional contour width and height using line laser. Background Technology
[0002] Currently, industry is upgrading from the Information Age to the Intelligent Age, achieving intelligent manufacturing and improving production efficiency through the integration of technologies such as Artificial Intelligence (AI), Big Data, and Computer Vision. While most computer vision technologies currently rely on 2D vision for defect detection and measurement, 3D vision technology is becoming a standard feature of Industry 4.0 applications to better reconstruct realistic objects. Its main functions include object dimensional measurement, defect detection, and scene reconstruction. With the improvement of hardware computing power, the frame rate of mainstream line laser-based 3D reconstruction calculations has been significantly increased. However, the requirements for the accuracy and reliability of contour measurement data are becoming increasingly prominent. This is especially true when using line lasers to measure the two-dimensional contour width and height of objects and using this as a basis for defect detection; the accuracy and stability of the contour width and height measurement algorithm are crucial to the defect detection effect.
[0003] Current technologies primarily measure the width of target objects using slope variation methods. However, due to the prevalence of noise, significant influence from light source angles, and large system errors in 3D point cloud data, the following problems arise: First, when searching for local maxima or multiple inflection points from the top of the contour to both sides based on contour height, noise data makes it impossible to accurately measure the object's width. Second, when contour data changes rapidly, the slope transformation is also high, making methods such as finding inflection points or using slope variation very limited and lacking robustness. Third, since contour data consists of discrete points, data loss due to speckle noise and glare often prevents direct use, thus hindering accurate measurement of the target object's width and height through curve slope search. Fourth, processing discrete contour data as continuous data requires filling and sampling operations on discrete points before using slope variation or inflection point finding methods. This process necessitates continuous calculation of the contour's slope and intercept, increasing the computational load and resulting in low measurement efficiency.
[0004] Therefore, there is an urgent need for a measurement method that can improve the efficiency and accuracy of measuring the width and height of target objects, and is also robust. Summary of the Invention
[0005] Therefore, it is necessary to provide a method, system, device, and computer storage medium for adaptive tracking and measurement of two-dimensional contour width and height using line laser to address the aforementioned technical problems.
[0006] A line laser two-dimensional contour width and height adaptive tracking measurement method includes the following steps: acquiring initial contour data including at least one target object; processing the initial contour data in real time using a Kalman filter algorithm to obtain denoised contour data; detecting the number of target objects in the contour data; segmenting the contour data according to the number of target objects; obtaining the height value of the target object based on the segmented search; obtaining a height reference point based on the height value; performing a search and moving search based on the height reference point to obtain the search result; and calculating the width value of the target object based on the search result.
[0007] In one embodiment, detecting the number of target objects in the contour data, segmenting the contour data according to the number of target objects, and obtaining the height value of the target objects based on the segments includes: detecting the number of target objects in the contour data; when there is only one target object, dividing the contour data into a segment, querying the maximum value in the contour height direction in the segment to obtain the height value of the target object; when there are two or more target objects, obtaining the physical distance between the target objects, dividing the contour data into multiple segments, querying each segment separately to obtain the maximum value of each segment, calculating the adjacent distance between the maximum values of two adjacent segments, comparing the relationship between the adjacent distance and the corresponding physical distance, and identifying the two corresponding maximum values as target maximum values when the adjacent distance is greater than the physical distance; iterating repeatedly until all segments of the contour data are traversed, and sorting all the obtained target maximum values in descending order, taking the same number of target maximum values as the target objects from top to bottom as the height values of multiple target objects.
[0008] In one embodiment, the step of obtaining a height reference point based on the height value, performing a search and movement search based on the height reference point, and calculating the width value of the target object based on the search results includes: obtaining a height reference point based on the height value; performing a search and movement search based on the height reference point to obtain a left minimum point set and a right minimum point set; selecting the left minimum point and the right minimum point from the left minimum point set and the right minimum point set, respectively; and calculating the width value of the target object based on the left minimum point and the right minimum point obtained from the left minimum point set and the right minimum point set.
[0009] In one embodiment, when searching with the height reference point, the process includes: setting the ordinate of the height reference point to zero to obtain a first reference point; determining a search direction and obtaining all directional contour data corresponding to the search direction from the contour data; calculating the Euclidean distance between the first reference point and all points in the directional contour data, and comparing them to obtain a first minimum distance point; and adding the obtained first minimum distance point to the left minimum point set or the right minimum point set according to the search direction.
[0010] In one embodiment, when performing a moving search using the height reference point, the process includes: moving the height reference point by a preset distance to obtain a second reference point; determining a search direction and obtaining all directional contour data corresponding to the search direction from the contour data; calculating the Euclidean distance between the second reference point and all points in the directional contour data, and comparing them to obtain a second minimum distance point; and adding the second minimum distance point to the left minimum point set or the right minimum point set according to the search direction.
[0011] In one embodiment, calculating the width value of the target object based on the left and right minimum points obtained from the left and right minimum point sets includes: obtaining the abscissa values of the left and right minimum points according to the left and right minimum points; and calculating the absolute value of the difference between the abscissa values of the left and right minimum points to obtain the width value of the target object.
[0012] A line laser two-dimensional contour width and height adaptive tracking measurement system is provided to implement the line laser two-dimensional contour width and height adaptive tracking measurement method described above. The system includes: a contour data acquisition module for acquiring initial contour data including at least one target object, and processing the initial contour data in real time using a Kalman filter algorithm to obtain denoised contour data; a height value search module for detecting the number of target objects in the contour data, segmenting the contour data according to the number of target objects, and obtaining the height value of the target object based on the segmented search; and a width value calculation module for obtaining a height reference point based on the height value, performing a search and movement search based on the height reference point to obtain a search result, and calculating the width value of the target object based on the search result.
[0013] A line laser two-dimensional contour width and height adaptive tracking measurement device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps of the line laser two-dimensional contour width and height adaptive tracking measurement method described in the above embodiments.
[0014] A computer storage medium storing a computer program that, when executed by a processor, implements the steps of the line laser two-dimensional profile width and height adaptive tracking measurement method described in the above embodiments.
[0015] Compared with existing technologies, the advantages and beneficial effects of this invention are as follows: By using a Kalman filter algorithm, the initial contour data, including at least one target object, is processed in real time to obtain denoised contour data, thereby improving the measurement accuracy of the target object's width and height. The number of target objects in the contour data is detected, and the contour data is segmented based on the number of target objects. The height value of the target object is obtained based on the segmented search, thus achieving adaptive tracking measurement of the height value and improving the accuracy and efficiency of height measurement. Based on the obtained height value, a corresponding height reference point is obtained. Search and movement searches are performed using the height reference point to obtain search results. The width value of the target object is calculated based on the search results, thereby achieving adaptive tracking measurement of the width value, improving the measurement accuracy of the width value, reducing the computational load, improving computational efficiency, and exhibiting strong robustness. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating a line laser two-dimensional contour width and height adaptive tracking measurement method in one embodiment;
[0017] Figure 2 This is a scatter plot of the denoised contour data in one embodiment;
[0018] Figure 3 This is a path diagram for width calculation searching to the left from the height reference point in one embodiment;
[0019] Figure 4 This is a path diagram for width calculation searching to the right from a height reference point in one embodiment;
[0020] Figure 5 This is a path diagram for width calculation in one embodiment, where the search is performed by moving leftward from the height reference point.
[0021] Figure 6 This is a path diagram for width calculation in one embodiment, where the search is performed by moving rightward from the height reference point.
[0022] Figure 7 This is a schematic diagram illustrating the measurement of width values in one embodiment;
[0023] Figure 8 This is a schematic diagram of target object size tracking and measurement in one embodiment;
[0024] Figure 9 This is a schematic diagram of target object size tracking and measurement obtained using the slope change method in one embodiment.
[0025] Figure 10 This is a schematic diagram of target object size tracking and measurement obtained using the present invention in one embodiment;
[0026] Figure 11 This is a schematic diagram of target object size tracking and measurement obtained by using the slope change method in the presence of noise in one embodiment.
[0027] Figure 12 This is a schematic diagram illustrating the target object size tracking measurement obtained using the present invention under noisy conditions in one embodiment.
[0028] Figure 13 This is a schematic diagram of a line laser two-dimensional contour width and height adaptive tracking measurement system in one embodiment;
[0029] Figure 14 This is a schematic diagram of the internal structure of the device in one embodiment. Detailed Implementation
[0030] Before describing the specific embodiments of the present invention, the overall concept of the present invention will be explained as follows:
[0031] This invention is mainly based on the research and development of laser object reconstruction process. Currently, the calculation of the width and height of the target object is large, the accuracy is low and the robustness is poor.
[0032] The inventors, through analysis, discovered that the main reasons for the aforementioned problems were the high noise levels in the point cloud data and its significant influence from the light source angle. Therefore, this invention proposes a line laser two-dimensional contour width and height adaptive tracking measurement method. Using a Kalman filter algorithm, the initial contour data, including at least one target object, is processed in real time to obtain denoised contour data, improving the measurement accuracy of the target object's width and height. The method detects the number of target objects in the contour data, segments the contour data based on the number of target objects, and searches the segments to obtain the height value of the target object, thus achieving adaptive tracking measurement of the height value and improving the accuracy and efficiency of height measurement. Based on the obtained height value, a corresponding height reference point is obtained. Searching and moving searches are performed using the height reference point to obtain the search results. The width value of the target object is calculated based on the search results, thus achieving adaptive tracking measurement of the width value, improving the measurement accuracy of the width value, reducing the computational load, improving computational efficiency, and exhibiting strong robustness.
[0033] Having introduced the overall concept of the present invention, to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.
[0034] In one embodiment, such as Figure 1 As shown, a line laser two-dimensional contour width and height adaptive tracking measurement method is provided, including the following steps:
[0035] Step S101: Obtain initial contour data including at least one target object, and use the Kalman filter algorithm to process the initial contour data in real time to obtain denoised contour data.
[0036] Specifically, since the noise data generated by the system affects the accuracy of object size measurement, it is necessary to denoise and smooth the obtained initial contour data. To avoid lag in data processing, a Kalman filter algorithm is used to process the contour data in real time. The Kalman filter algorithm includes a prediction phase and an update phase. The prediction phase is used to calculate the state estimate and the estimated covariance, while the update phase is used to calculate the Kalman gain and the predicted value, and update the predicted value and the estimated covariance. The pseudocode for the initial contour data processing flow is shown in Algorithm 1 below.
[0037]
[0038] in, This indicates that the input contains noisy contour data. Size Indicates the size of the contour data point set. This represents the output value (i.e., the set of noise-reduced points). Predicted (prior) state estimation, state transition matrix terms Input control matrix = 0.0, external state item ; Predictive (prior) estimate of covariance, process covariance matrix terms ; For Kalman gain, Transformation matrix ; Indicates the predicted value. Represented as the updated estimated covariance, the identity matrix subscript k This indicates the current position of the data. During calculation, it can be taken as... , , This represents the expected value of the first 50 data points. This represents the variance of the first 50 data points.
[0039] The algorithm described above outputs all the denoised contour data, such as... Figure 2 As shown, this method enables denoising and real-time processing of contour data, thereby improving measurement accuracy.
[0040] Point cloud data is composed of contour data stitched together along a specified direction, meaning that multiple contour data are combined to form point cloud data.
[0041] Step S102: Detect the number of target objects in the contour data, segment the contour data according to the number of target objects, and obtain the height value of the target objects based on the segment search.
[0042] Specifically, data processing methods are used to process the denoised contour data, detect the number of target objects in the contour data, segment the contour data according to the number of target objects, and calculate the height of the target objects according to the segments to obtain the height value of the target objects. This enables adaptive tracking and measurement of the height value of the target objects, improves the accuracy and robustness of the obtained height value, reduces the amount of calculation, and improves the efficiency of tracking and measurement.
[0043] Step S102 includes: detecting the number of target objects in the contour data, obtaining the physical distance between the target objects; when there is only one target object, dividing the contour data into a segment, querying the maximum value in the contour height direction in a segment to obtain the height value of the target object; when there are two or more target objects, dividing the contour data into multiple segments, querying each segment separately to obtain the maximum value of each segment, calculating the adjacent distance between the maximum values of two adjacent segments, and comparing the relationship between the adjacent distance and the corresponding physical distance; when the adjacent distance is greater than the physical distance, identifying the two corresponding maximum values as the target maximum values; iterating repeatedly until all segments of the contour data are traversed, and sorting all the obtained target maximum values in descending order, taking the target maximum values that are the same as the number of target objects from top to bottom as the height values of multiple target objects.
[0044] Specifically, based on target recognition algorithms, such as YOLOv3 target detection and R-NN convolutional neural network algorithms, the number of target objects in the denoised contour data is detected, and the physical distance between the detected target objects is determined. When calculating the height, it is necessary to process the detected target objects separately.
[0045] When there is only one target object, the contour data is segmented based on the number of target objects. That is, the contour data is divided into a whole, and the maximum value in the contour height direction is queried in the contour data to obtain the height value of the target object.
[0046] When there are two or more target objects, the contour data is divided into multiple segments, such as 4, 8, 16, etc. Each segment is queried separately to obtain the maximum value of each segment. The adjacency distance between the maximum values of two adjacent segments is calculated, that is, the horizontal coordinate distance between two adjacent maximum values is calculated as the adjacency distance. The adjacency distance is compared with the physical distance of the target object. When the adjacency distance is greater than the physical distance, it means that the height of the corresponding target object has been found, and the two corresponding maximum values are identified as the target maximum values. The above method is iterated repeatedly until all segments are traversed. All the target maximum values are sorted in descending order and taken from top to bottom to obtain the target maximum values that are the same as the number of target objects. These are the height values of multiple target objects. The target maximum values are then matched with the target objects based on the contour data.
[0047] Step S103: Obtain the height reference point based on the height value, perform a search and movement search based on the height reference point to obtain the search results, and calculate the width value of the target object based on the search results.
[0048] Specifically, after obtaining the height value of the target object, the width measurement of the target object is performed using the same method as for one target object and multiple target objects. That is, the corresponding height reference point is obtained based on the height value, and a search and movement search is performed based on the height reference point to obtain the corresponding search results. The width value of the target object is then calculated based on the search results, thereby achieving adaptive tracking measurement of the width value of the target object and improving the accuracy and efficiency of the width measurement.
[0049] Step S103 includes: obtaining a height reference point based on the height value; performing a search and movement search based on the height reference point to obtain a left minimum point set and a right minimum point set; selecting the left minimum point and the right minimum point from the left minimum point set and the right minimum point set respectively; and calculating the width value of the target object based on the left minimum point and the right minimum point obtained from the left minimum point set and the right minimum point set.
[0050] Specifically, when measuring the width value, the corresponding height reference point is obtained based on the height value. The search and movement search are performed based on the height reference point. During the search, the search direction needs to be divided according to the height reference point. The contour data is divided by a straight line passing through the height reference point and perpendicular to the horizontal axis, obtaining the contour data located to the left and right of the height reference point. The corresponding search is performed separately to obtain the left minimum point set and the right minimum point set. The left minimum point and the right minimum point are selected from the two minimum point sets respectively. Based on the left minimum point and the right minimum point, the width value of the target object is calculated, thereby realizing adaptive measurement of the width value of the target object with high calculation efficiency and accuracy.
[0051] The process of searching using a height reference point includes: setting the ordinate of the height reference point to zero to obtain a first reference point; determining the search direction and obtaining all directional contour data corresponding to the search direction from the contour data; calculating the Euclidean distance between the first reference point and all points in the directional contour data, and comparing them to obtain a first minimum distance point; and adding the obtained first minimum distance point to the left minimum point set or the right minimum point set according to the search direction.
[0052] like Figure 3 and Figure 4 As shown, when searching using a height reference point, the ordinate of the height reference point is set to zero to obtain the first reference point A, and the search direction is determined, as follows. Figure 3 As shown, when the search direction is left, the points of point A and all points in the contour data in the left direction are calculated respectively. The Euclidean distance is calculated using the following formula:
[0053] ,
[0054] From the calculated Euclidean distances, the point with the minimum distance when the search direction is left is selected; similarly, as... Figure 4 As shown, the Euclidean distance with the right search direction is calculated, and the first minimum distance point with the right search direction is selected from the calculated Euclidean distance. The first minimum distance point is then added to the left minimum point set or the right minimum point set according to the search direction.
[0055] The process of moving the search based on the height reference point includes: moving the height reference point by a preset distance to obtain a second reference point; determining the search direction and obtaining all directional contour data corresponding to the search direction from the contour data; calculating the Euclidean distance between the second reference point and all points in the directional contour data and comparing them to obtain the second minimum distance point; and adding the second minimum distance point to the left minimum point set or the right minimum point set according to the search direction.
[0056] like Figure 5 and Figure 6 As shown, when performing a moving search based on a height reference point, according to a preset distance... Move the height reference point A to obtain the second reference point. Determine the search direction as left or right, and calculate accordingly. The Euclidean distances to all points in the directional contour data corresponding to the search direction are calculated. Among all the obtained Euclidean distances, the points with the second minimum distance in the left and right search directions are selected respectively, and the points with the second minimum distance are added to the left minimum point set or the right minimum point set according to the search direction.
[0057] The steps for calculating the width of the target object are as follows: based on the left and right minimum points, obtain the x-coordinates of the left and right minimum points; calculate the absolute value of the difference between the x-coordinates of the left and right minimum points to obtain the width of the target object.
[0058] like Figure 7 and Figure 8 As shown, an adaptive width measurement method is used, based on the obtained left and right minimum points, as follows: and Two points are used to obtain the corresponding x-coordinate values. Based on the absolute value of the difference between the two x-coordinate values, the width value W of the target object is obtained. Finally, the height value H and width value W of the target object are obtained. Figure 8 As shown.
[0059] In this embodiment, the initial contour data, including at least one target object, is processed in real time using a Kalman filter algorithm to obtain denoised contour data, thereby improving the measurement accuracy of the target object's width and height. The algorithm detects the number of target objects in the contour data, segments the contour data based on the number of target objects, and searches the segments to obtain the height value of the target object, thus achieving adaptive tracking measurement of the height value and improving the accuracy and efficiency of height measurement. Based on the obtained height value, a corresponding height reference point is obtained. Search and movement searches are performed using the height reference point to obtain search results, and the width value of the target object is calculated based on the search results, thereby achieving adaptive tracking measurement of the width value, improving the measurement accuracy of the width value, reducing the computational load, improving computational efficiency, and exhibiting strong robustness.
[0060] In one embodiment, the effectiveness of the adaptive width and height measurement of the present invention is compared with that of a conventional method for calculating slope changes, as well as the time consumption of the program. In the process of width measurement, the conventional flow of the slope change method is as follows:
[0061] The least squares method is used to fit the contour point set, and the fitting expression is: ,in ; m Indicates data dimension, n Denotes the order of a polynomial. Denotes the coefficients of the terms in a polynomial. x To represent sample data and prevent "ill-conditioned" equations, this invention uses n=3 for testing. The coefficients of the polynomials are calculated using a matrix method. Here, matrices X and Y are constructed using the sample data, where X is a Vandermonde matrix. The expression for solving the polynomial coefficients is: C represents the coefficient matrix.
[0062] Boundary point search for width measurement can be done in two ways: Method 1: Calculate the slope along both sides (positive and negative x-axis) based on the profile height reference. The change in slope indicates whether the point is a boundary point for width measurement. Method 2: Calculate the inflection point of the fitted curve, i.e., determine whether it is a boundary point for width measurement based on whether the second derivative of the curve has opposite signs. For example... Figure 9 and Figure 10 Compared to adaptive measurement methods, slope variation methods cannot accurately measure contour width when used for contour width tracking, and the same applies to inflection point methods.
[0063] Furthermore, contour data in the presence of noise, such as Figure 12 The adaptive width tracking measurement method (including noise) of this invention and Figure 11 The slope variation method (including noise) width tracking measurement results show that the adaptive width tracking measurement method can accurately measure the object width and has strong robustness to noisy contour data. The test results for the slope variation method and the adaptive tracking measurement method show that the adaptive measurement method takes significantly less time than the slope variation method, specifically 0.0021ms and 0.04ms respectively.
[0064] As can be seen from the above comparison, the tracking measurement method of the present invention can achieve accurate measurement of the contour width and height, has strong robustness, and consumes less time.
[0065] like Figure 13 As shown, a line laser two-dimensional contour width and height adaptive tracking measurement system 20 is provided to implement the line laser two-dimensional contour width and height adaptive tracking measurement method described above. It includes: a contour data acquisition module 21, a height value search module 22, and a width value calculation module 23, wherein:
[0066] The contour data acquisition module 21 is used to acquire initial contour data including at least one target object, and to process the initial contour data in real time using a Kalman filter algorithm to obtain denoised contour data.
[0067] The height value search module 22 is used to detect the number of target objects in the contour data, segment the contour data according to the number of target objects, and obtain the height value of the target objects based on the segment search.
[0068] The width value calculation module 23 is used to obtain a height reference point based on the height value, perform a search and movement search based on the height reference point, obtain the search results, and calculate the width value of the target object based on the search results.
[0069] In one embodiment, the height value search module 22 is specifically used to: detect the number of target objects in the contour data, obtain the physical distance between the target objects, and when there is only one target object, divide the contour data into a segment, query the maximum value in the contour height direction in a segment, and obtain the height value of the target object; when there are two or more target objects, divide the contour data into multiple segments, query each segment separately, obtain the maximum value of each segment, calculate the adjacent distance between the maximum values of two adjacent segments, and compare the relationship between the adjacent distance and the corresponding physical distance. When the adjacent distance is greater than the physical distance, the two corresponding maximum values are identified as the target maximum values; iterate repeatedly until all segments of the contour data are traversed, and sort all the obtained target maximum values in descending order, and take the target maximum values that are the same as the number of target objects from top to bottom as the height values of multiple target objects.
[0070] In one embodiment, the width value calculation module 23 is specifically used to: obtain a height reference point based on the height value; perform a search and movement search based on the height reference point to obtain a left minimum point set and a right minimum point set; select the left minimum point and the right minimum point from the left minimum point set and the right minimum point set respectively; and calculate the width value of the target object based on the left minimum point and the right minimum point obtained from the left minimum point set and the right minimum point set.
[0071] In one embodiment, the width value calculation module 23 is further configured to: set the ordinate of the height reference point to zero to obtain a first reference point; determine the search direction and obtain all directional contour data corresponding to the search direction from the contour data; calculate the Euclidean distance between the first reference point and all points in the directional contour data, and compare to obtain a first minimum distance point; and add the obtained first minimum distance point to the left minimum point set or the right minimum point set according to the search direction.
[0072] In one embodiment, the width value calculation module 23 is further configured to: move the height reference point according to a preset distance to obtain a second reference point; determine the search direction and obtain all directional contour data corresponding to the search direction from the contour data; calculate the Euclidean distance between the second reference point and all points in the directional contour data, and compare to obtain a second minimum distance point; and add the second minimum distance point to the left minimum point set or the right minimum point set according to the search direction.
[0073] In one embodiment, the width value calculation module 23 is further configured to: obtain the abscissa values of the left minimum point and the right minimum point based on the left minimum point and the right minimum point; calculate the absolute value of the difference between the abscissa values of the left minimum point and the right minimum point to obtain the width value of the target object.
[0074] In one embodiment, a line laser two-dimensional contour width and height adaptive tracking measurement device is provided. This device can be a server, and its internal structure diagram can be as follows: Figure 14As shown, the device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides the environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores configuration templates and can also be used to store target webpage data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a line laser two-dimensional profile width and height adaptive tracking measurement method.
[0075] Those skilled in the art will understand that Figure 14 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the device to which the present application is applied. Specific devices may include more or fewer components than those shown in the figure, or may combine certain components, or may have different component arrangements.
[0076] In one embodiment, a computer storage medium may also be provided, the storage medium storing a computer program, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the method described in the foregoing embodiments, the computer being part of the aforementioned line laser two-dimensional profile width and height adaptive tracking measurement system.
[0077] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0078] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a computer storage medium (ROM / RAM, magnetic disk, optical disk) for execution by the computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Therefore, the present invention is not limited to any particular hardware and software combination.
[0079] The above description, in conjunction with specific embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such deductions or substitutions should be considered within the scope of protection of the present invention.
Claims
1. A method for adaptive tracking and measurement of two-dimensional contour width and height using line laser, characterized in that, include: Initial contour data including at least one target object is obtained, and the initial contour data is processed in real time using the Kalman filter algorithm to obtain denoised contour data. The process involves detecting the number of target objects in the contour data, segmenting the contour data according to the number of target objects, and obtaining the height value of the target objects based on segment search. This includes: detecting the number of target objects in the contour data; when only one target object exists, dividing the contour data into a segment, querying the maximum value in the contour height direction within that segment to obtain the height value of the target object; when two or more target objects exist, obtaining the physical distance between the target objects, dividing the contour data into multiple segments, querying each segment separately to obtain the maximum value of each segment, calculating the adjacent distance between the maximum values of two adjacent segments, comparing the adjacent distance with the corresponding physical distance, and identifying the two corresponding maximum values as target maximum values when the adjacent distance is greater than the physical distance; iterating repeatedly until all segments of the contour data are traversed, and sorting all obtained target maximum values in descending order, extracting the same number of target maximum values as the target objects from top to bottom as the height values of multiple target objects. The process involves obtaining a height reference point based on the height value, performing a search and movement search based on the height reference point to obtain search results, and calculating the width value of the target object based on the search results. This includes: obtaining a height reference point based on the height value; performing a search and movement search based on the height reference point to obtain a left minimum point set and a right minimum point set; selecting the left minimum point and the right minimum point from the left minimum point set and the right minimum point set, respectively; and calculating the width value of the target object based on the left minimum point and the right minimum point obtained from the left minimum point set and the right minimum point set. The process of searching using the height reference point includes: setting the ordinate of the height reference point to zero to obtain a first reference point; determining the search direction and obtaining all directional contour data corresponding to the search direction from the contour data; calculating the Euclidean distance between the first reference point and all points in the directional contour data, and comparing them to obtain a first minimum distance point; and adding the obtained first minimum distance point to the left minimum point set or the right minimum point set according to the search direction. When performing a moving search using the height reference point, the process includes: moving the height reference point by a preset distance to obtain a second reference point; determining a search direction and obtaining all directional contour data corresponding to the search direction from the contour data; calculating the Euclidean distance between the second reference point and all points in the directional contour data, and comparing them to obtain a second minimum distance point; and adding the second minimum distance point to the left minimum point set or the right minimum point set according to the search direction.
2. The line laser two-dimensional contour width and height adaptive tracking measurement method according to claim 1, characterized in that, The calculation of the target object's width value based on the left and right minimum points obtained from the left and right minimum point sets includes: Based on the left minimum point and the right minimum point, obtain the x-coordinate values of the left minimum point and the right minimum point; The absolute value of the difference between the x-coordinates of the left minimum point and the right minimum point is calculated to obtain the width value of the target object.
3. A line laser two-dimensional contour width and height adaptive tracking measurement system, characterized in that, A method for implementing a line laser two-dimensional profile width and height adaptive tracking measurement as described in any one of claims 1-2 includes: The contour data acquisition module is used to acquire initial contour data including at least one target object, and to process the initial contour data in real time using a Kalman filter algorithm to obtain denoised contour data. The height value search module is used to detect the number of target objects in the contour data, segment the contour data according to the number of target objects, and obtain the height value of the target objects based on the segment search. This includes: detecting the number of target objects in the contour data; when only one target object exists, dividing the contour data into a segment, querying the maximum value in the contour height direction within that segment to obtain the height value of the target object; when two or more target objects exist, obtaining the physical distance between the target objects, dividing the contour data into multiple segments, querying each segment separately to obtain the maximum value of each segment, calculating the adjacent distance between the maximum values of two adjacent segments, comparing the adjacent distance with the corresponding physical distance, and identifying the two corresponding maximum values as target maximum values when the adjacent distance is greater than the physical distance; iterating repeatedly until all segments of the contour data are traversed, and sorting all obtained target maximum values in descending order, taking the same number of target maximum values as the target objects from top to bottom as the height values of multiple target objects. The width value calculation module is used to obtain a height reference point based on the height value, perform a search and movement search based on the height reference point to obtain search results, and calculate the width value of the target object based on the search results. This includes: obtaining a height reference point based on the height value; performing a search and movement search based on the height reference point to obtain a left minimum point set and a right minimum point set; selecting the left minimum point and the right minimum point from the left minimum point set and the right minimum point set, respectively; and calculating the width value of the target object based on the left minimum point set and the right minimum point obtained from the left minimum point set and the right minimum point set. The process of searching using the height reference point includes: setting the ordinate of the height reference point to zero to obtain a first reference point; determining the search direction and obtaining all directional contour data corresponding to the search direction from the contour data; calculating the Euclidean distance between the first reference point and all points in the directional contour data, and comparing them to obtain a first minimum distance point; and adding the obtained first minimum distance point to the left minimum point set or the right minimum point set according to the search direction. When performing a moving search using the height reference point, the process includes: moving the height reference point by a preset distance to obtain a second reference point; determining a search direction and obtaining all directional contour data corresponding to the search direction from the contour data; calculating the Euclidean distance between the second reference point and all points in the directional contour data, and comparing them to obtain a second minimum distance point; and adding the second minimum distance point to the left minimum point set or the right minimum point set according to the search direction.
4. A line laser two-dimensional contour width and height adaptive tracking measurement device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 2.
5. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 2.
Citation Information
Patent Citations
Two-dimensional-laser real-time detection method of workpiece surface profile
CN104880160A
Method for measuring ice shaped contour based on line structured light
CN105783770A