Automatic labeling method for measurement data of contact type contourgraph
Through the combination of contact profiler and template workpieces, the shape description feature vector is used for automatic matching and alignment, which solves the matching alignment and contour integrity detection problems of workpiece measurement data in different batches, and realizes efficient automatic labeling and improves detection efficiency.
Patent Information
- Application Number
- CN202510188564.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2045-02-20
AI Technical Summary
The automatic labeling method of existing contact profilers is difficult to achieve matching and alignment of workpieces in different batches and integrity detection of contours in specific parts, resulting in insufficiency of detection.
Automatically labeled templates are obtained by using a contact profiler and selected template workpieces, and automatic matching and alignment is used for shape description feature vectors to be labeled to achieve automatic labeling of the contours of the workpiece to be marked.
It realizes batch automatic labeling of workpiece profile measurement data in different batches, improves detection efficiency, and overcomes the inconsistency of labeling results caused by personnel differences.
Smart Images

Figure CN119649074A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of precision measurement technology, and in particular to an automatic labeling method for contact profilometer measurement data. Background Art
[0002] The contact profilometer is an instrument for testing and inspecting the contour, two-dimensional size, and two-dimensional displacement of an object. As a precision measuring instrument, it is widely used in the automobile manufacturing and railway industries. The contact profilometer measures by sliding the stylus against the measured surface. The measurement principle is the rectangular coordinate measurement method, that is, the coordinate points of the surface contour of the measured part are measured through the X-axis and Z-axis sensors. The coordinate point data measured by the sensor is transmitted to the upper PC through the electrical components. The software performs mathematical operations on the collected original coordinate data and marks the required engineering measurement items. Its main advantage is that it can directly measure the surface roughness of some parts that are difficult to measure, such as holes and grooves, and can directly read according to a certain evaluation standard or depict the shape of the surface contour curve. It has fast measurement speed, reliable results, and easy operation. It is an important detection method for workpiece processing quality.
[0003] In traditional technology, the annotator selects the specific part contour in the workpiece measurement data in the human-computer interaction mode, and then calculates various indicators of the specific part contour. The accuracy and efficiency of the annotation of specific parts of the workpiece depend on the proficiency of the annotator. In the production and quality monitoring process of the same model of workpieces, the batch automatic annotation of the contour measurement data of the same model of workpieces can greatly improve efficiency and overcome the inconsistency of the annotation results caused by personnel differences.
[0004] However, due to differences in processing quality of different batches of workpieces, differences in clamping points and angles during workpiece contour measurement, differences in stylus starting point positions, stylus jump points, and incomplete contour measurement, the realization of batch automated labeling requires solving key issues such as matching and alignment of measurement data from different batches, and accurate and automatic detection of contour integrity of specific parts, which reduces the efficiency of contour detection. Summary of the invention
[0005] In order to solve the above technical problems, this application proposes the following technical solutions: In a first aspect, an embodiment of the present application provides a method for automatically labeling measurement data of a contact profilometer, comprising: Using a contact profilometer and a selected template workpiece to obtain workpiece contour measurement data to automatically annotate a template, the automatic annotation template comprising: a line segment and arc template set of the template workpiece; Obtaining a contour shape description feature vector of the workpiece to be annotated, and automatically matching and aligning the feature vector with the automatic annotation template in stages; Automatic labeling of the contour of the workpiece to be labeled is achieved based on the automatic labeling template and the matched and aligned feature vectors.
[0006] In a possible implementation, the method of using a contact profilometer and a selected workpiece with qualified processing quality to obtain a workpiece contour measurement data automatic marking template includes: Use a contact profiler to detect the complete contour of the workpiece that meets the processing quality requirements, and use it as a reference template for the same model workpiece to obtain the contour two-dimensional measurement data ,in are the horizontal and vertical coordinate values of the stylus in the rectangular coordinate system, respectively, and the x-axis step length of the stylus is ,Right now ; Select the line segments and arc basic shapes in the template contour measurement data to obtain ,in is the partial contour measurement data of the i-th line segment; ,in is the partial profile measurement data of the jth arc segment; The complete contour of the line segment and the complete contour of the arc are accurately located by first expanding and then contracting to obtain the template set of all detected line segments. and a collection of templates for detecting arcs .
[0007] In a possible implementation, the complete outline of the line segment is precisely located by first expanding and then contracting, including: According to the specific situation of the workpiece, the minimum x-axis length of the line segment recognition is set to The minimum number of measurement points to identify a line segment is indivual; For Line segments, first analyze the number of measurement points selected by the box, if less than , then based on the line segment measurement data selected by the box, expand along both ends of the x-axis to obtain at least The initial fitting measurement point set of the line segment of the measurement points; Using linear regression as the basic model, the RANSAC algorithm is used to obtain stable segment parameter estimates, marked as segments , respectively represent the slope of the initial fitting line segment, the intercept, the starting and ending x-axis coordinate values of the line segment, and the arithmetic mean deviation of the profile; Adopt iterative expansion method, expand along the x-axis each time Step size method, first expand forward along the x-axis, and fit the new line segment ,calculate and The angle between two line segments, when the angle exceeds a certain threshold , it is determined that the front end contour structure of the line segment has changed, that is, it has reached the forward end of the line segment and contains the front end endpoint; Starting from the last fitting line segment forward expansion, the line segment is expanded backward in the same way, and after multiple iterations, a line segment contour measurement point set including the endpoints on both sides of the line segment is obtained; For the line segment contour measurement point set obtained in the previous expansion stage, the absolute error of the single point estimation is calculated point by point from both ends using the contraction method. When it is less than 0.5 When , it is identified as the endpoint truncation point of the line segment, so as to obtain the complete contour of the line segment i, and fit the line segment again, marked as This process can be repeated many times, and finally the template set of all detection segments is obtained. .
[0008] In a possible implementation, the complete contour of the arc is precisely positioned by first expanding and then contracting, including: According to the specific situation of the workpiece, the minimum x horizontal length of the arc segment recognition is set to The minimum number of measurement points to identify an arc is indivual; For the jth arc, first analyze the number of measurement points in the selected arc. If it is less than , then based on the arc measurement points selected by the box, expand to both ends of the x-axis to obtain at least The initial fitting measurement point set of the arc of the measurement points; Based on the algebraic calculation formula of the arc, the RANSAC algorithm is used to obtain a stable estimate of the arc parameters and marked as , respectively represent the coordinates of the center of the fitted arc, radius, center angle, start and end x-axis coordinates of the arc, is the arithmetic mean deviation of the profile calculated from the distance between the centers of the measured points and the estimated radius; Adopt iterative expansion method, expand along the x-axis each time Step size method, previously extended, fitting new arc ,calculate and When the ratio exceeds a certain threshold , it is determined that the contour structure of the front end of the arc changes, that is, it reaches the end of the front end of the arc and includes the forward endpoint; Starting from the last fitted arc extended forward, the arc is extended backward along the x-axis in the same way. After multiple iterations, a contour including the endpoints on both sides of the arc is obtained. For the arc obtained in the above expansion stage, the square of the estimated error between the distance between the center of the measured point and the fitting radius is calculated point by point by using the contraction method. When it is identified as the endpoint of the line segment, the arc is fitted again and marked as This process can be repeated many times, and finally a template set of all detected arcs is obtained. .
[0009] In a possible implementation, obtaining a contour shape description feature vector of the workpiece to be annotated, and automatically matching and aligning the feature vector with the automatic annotation template in stages, includes: The middle segment of the contour measurement data of the workpiece to be marked is cut for matching and alignment analysis, that is, the contour measurement data of the workpiece to be marked is , set the interception ratio , then only take The set of measurement points is used to match, symbol Indicates rounding up; Construct a shape description feature vector of the contour of the matching part of the workpiece to be annotated; A large interval sliding mode is used in combination with the shape description feature vector to achieve rough matching alignment between the contour measurement data of the workpiece to be marked and the automatic marking template; Adopt small interval sliding mode to search for exact matching position points based on coarse matching alignment data to obtain exact matching area; Construct a set of matching point pairs on both sides, and then solve the homography transformation matrix for matching alignment , to mark the contour data of the workpiece Transform to achieve matching alignment with template data coordinates.
[0010] In a possible implementation, constructing a shape description feature vector of the contour of the matching portion of the workpiece to be annotated includes: by The median measurement point of the x-axis coordinate value of the intercepted measurement point set is the origin , select two sides from the origin along the x-axis for Measurement points of step length and , and we get two line segments , ; according to The interval of the step length is gradually expanded to both ends to obtain are two line segments with endpoints, , , calculate the forward segment and The angle of Calculate the backward line segment and The angle of the line segment finally obtains the shape description feature vector of the contour of the matching part of the workpiece to be annotated .
[0011] In a possible implementation, the use of the large interval sliding mode in combination with the shape description feature vector to achieve rough matching alignment between the contour measurement data of the workpiece to be annotated and the automatic annotation template includes: Using large interval sliding mode, from template contour data The starting segment, every x-axis step length, intercept measurement points; Calculate the shape description feature vector of this segment of the contour, and finally obtain the shape description feature vector set D of each segment of the template data; The cosine similarity is used to calculate the feature vector describing the contour shape of the workpiece to be matched. The similarity with the feature vectors describing the shape of each segment of the template is used, and the segment contour with the highest similarity is determined as the area with the highest matching degree, so as to achieve fast coarse matching alignment.
[0012] In a possible implementation, the small interval sliding mode is used to search for exact matching position points based on coarse matching alignment data, and the obtained exact matching area includes: Adopt small interval sliding mode and extend to both ends according to the obtained segmented contour data x-axis step length to obtain the exact match search area; Then every x-axis step length, intercept measurement points; Calculate the feature vector describing each segmented shape and search for the position point with the highest similarity as the exact matching position point.
[0013] In a possible implementation, the automatic annotation of the contour of the workpiece to be annotated based on the automatic annotation template and the matched and aligned feature vectors includes: Search for the line segment template set according to the x-axis coordinate value range after the contour data of the workpiece to be marked is transformed and arc template collection ; Determine a subset of template line segments and a subset of template arcs contained in the data range of the workpiece contour to be annotated, that is, a basic shape set that can be annotated for the workpiece measurement contour; The coordinate value of the x-axis center point of the line segment i in the template line segment subset is used to locate the corresponding measurement point of the workpiece to be marked as the initial center point of the line segment to be marked, and half of the x-axis length of the line segment i, that is, the middle part is taken. The measurement points are used as the initial measurement point set of the line segment to be annotated, and the line segment is automatically detected and annotated; The coordinate value of the x-axis center point of arc j in the template arc subset is used to locate the corresponding measuring point of the workpiece to be marked as the initial center point of the arc to be marked; half of the x-axis length of arc j, that is, the middle part is taken The measurement points are used as the initial measurement point set of the arc to be annotated, and the arc is automatically detected and annotated; After the marking is completed, the various parameters of the basic shape are used to evaluate the processing quality of the batch of workpieces.
[0014] In the embodiment of the present application, the automatic annotation template obtained according to the template workpiece can realize automatic matching and alignment with the contour measurement data of the same type of workpiece, so as to realize the automatic annotation of the final contour data. In this way, for different batches of workpieces or different types of workpieces, as long as the corresponding template workpiece is selected to realize the acquisition of the automatic annotation template, batch annotation can be realized, thereby improving the efficiency of workpiece contour detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A schematic diagram of a flow chart of an automatic labeling method for contact profilometer measurement data provided in an embodiment of the present application; Figure 2 A schematic diagram of line segment and arc annotation of a template workpiece A provided in an embodiment of the present application; Figure 3 A schematic diagram of the contour measurement data of workpiece B provided in an embodiment of the present application; Figure 4 A schematic diagram of the original coordinate distribution of the contour measurement data of workpiece B and the contour measurement data of workpiece A provided in an embodiment of the present application; Figure 5 A schematic diagram of the alignment of the contour measurement data of workpiece B and the contour matching of workpiece A provided in an embodiment of the present application; Figure 6 A schematic diagram of the automatic labeling results of the workpiece B contour measurement data provided in an embodiment of the present application. DETAILED DESCRIPTION
[0016] The present solution is described below in conjunction with the accompanying drawings and specific implementation methods.
[0017] See also Figure 1 This is a method for automatically marking the measurement data of contact profilometers provided by Strength, including: S101, using a contact profilometer and a selected template workpiece to obtain workpiece contour measurement data and automatically annotate a template, wherein the automatic annotating template includes: a line segment and arc template set of the template workpiece.
[0018] Use a contact profiler to detect the complete contour of the workpiece that meets the processing quality requirements, and use it as a reference template for the same model workpiece to obtain the contour two-dimensional measurement data ,in are the horizontal and vertical coordinate values of the stylus in the rectangular coordinate system, respectively. The former reflects the lateral displacement of the stylus, and the latter reflects the contour change of the workpiece measuring surface. Let the x-axis step length of the stylus be ,but .
[0019] In this embodiment, the complete contour measurement data of workpiece A of the same model is selected as the reference template. The template contour has a total of 72978 measurement points, and the x-axis step length of the profiler is 2 ,Table 1 is part of the sample data of the template workpiece contour ,measurement.
[0020] Table 1 Sample table of template workpiece contour measurement data (unit: cm) By using human-computer interaction, the line segments and arc basic shapes in the template contour measurement data are framed to obtain ,in is the partial contour measurement data of the i-th line segment; ,in is the partial contour measurement data of the jth arc segment; to reduce the selection requirements, only the middle part of the basic shape contour or at least one point near the middle position can be selected; in this embodiment, only one point in the middle area of the basic shape is selected, and the template workpiece has a total of 8 line segments and 2 arcs, as shown in Table 2: Table 2 Example of single-point selection of basic shape of template workpiece A The complete outline of the line segment is accurately located by first expanding and then contracting; according to the specific conditions of the workpiece, the minimum x-axis length of the line segment recognition is set to The minimum number of measurement points to identify a line segment is indivual.
[0021] For the i-th line segment, first analyze the number of measurement points selected by the box. If it is less than , then based on the line segment measurement data selected by the box, expand along both ends of the x-axis to obtain at least The initial fitting measurement point set of the line segment of the measurement points. During the machining process of the workpiece, especially the milling process, the local contour often presents a periodic groove undulation. In order to obtain a stable line segment fitting, linear regression is used as the basic model, and the RANSAC algorithm is used to obtain a stable line segment parameter estimation, which is marked as a line segment. , respectively represent the slope of the initial fitting line segment, the intercept, the starting and ending x-axis coordinate values of the line segment, and the arithmetic mean deviation of the profile.
[0022] Adopt iterative expansion method, expand along the x-axis each time Step size method, first expand forward along the x-axis, and fit the new line segment ,calculate and The angle between two line segments. When the angle exceeds a certain threshold , it is determined that the front end contour structure of the line segment has changed, that is, it has reached the front end of the line segment and includes the front end endpoint. Further, starting from the last fitting line segment forward expansion, the line segment is extended backward in the same way. After multiple iterations, a set of line segment contour measurement points including the endpoints on both sides of the line segment is obtained.
[0023] In order to obtain accurate endpoints of the line segment contour, the line segment contour measurement point set obtained in the previous expansion stage is shrunk to calculate the single point estimation absolute error point by point from both ends. When , it is identified as the endpoint truncation point of the line segment, so as to obtain the complete contour of the line segment i, and fit the line segment again, marked as , in this embodiment, it is repeated twice; finally, the set of all detection line segment templates is obtained .
[0024] In this embodiment, setting =200, , The obtained line segment template set is shown in Table 3: Table 3 Line segment template set labeling example table The complete contour of the arc is accurately located by first expanding and then contracting. Combined with the specific conditions of the workpiece, the minimum x horizontal length of the arc segment recognition is set to The minimum number of measurement points to identify an arc is indivual.
[0025] For the jth arc, first analyze the number of measurement points in the selected arc. If it is less than , then based on the arc measurement points selected by the box, expand to both ends of the x-axis to obtain at least The initial fitting measurement point set of the arc of measurement points. Based on the algebraic calculation formula of the arc, the RANSAC algorithm is used to obtain a stable estimate of the arc parameters and marked as , respectively represent the coordinates of the center of the fitted arc, radius, center angle, start and end x-axis coordinates of the arc, It is the arithmetic mean deviation of the contour calculated from the distance between the center of the measured points and the estimated radius.
[0026] Adopt iterative expansion method, expand along the x-axis each time Step size method, previously extended, fitting new arc ,calculate and When a certain threshold is exceeded , it is determined that the contour structure of the front end of the arc has changed, that is, it has reached the end of the front end of the arc and includes the forward endpoint. Further, starting from the last fitting arc of the forward extension, the arc is extended backward along the x-axis in the same way. After multiple iterations, the contour including the endpoints on both sides of the arc is obtained.
[0027] In order to obtain the precise endpoints of the arc contour, the arc obtained in the previous expansion stage is contracted to calculate the estimated error square of the distance between the center of the measured point and the fitting radius point by point. When it is identified as the endpoint of the line segment, the arc is fitted again and marked as , repeated twice in this embodiment; finally, a set of all detection arc templates is obtained In this embodiment, set =300, , The obtained arc template set is shown in Table 4. Figure 2 The marking results of all line segments and arcs of template workpiece A are shown: Table 4 Arc template set example table S102, obtaining a contour shape description feature vector of the workpiece to be annotated, and automatically matching and aligning the feature vector with the automatic annotation template in stages.
[0028] Usually, the first and last sections of the stylus's complete stroke are not critical parts of the workpiece, and the stylus may slide abnormally at the last section. Therefore, the middle section of the contour measurement data of the workpiece to be marked is intercepted for matching and alignment analysis. That is, the contour measurement data of the workpiece to be marked is , set the interception ratio , then only take The set of measurement points is used to match, symbol In this embodiment, the incomplete contour measurement data of the same model workpiece B is used as the workpiece to be analyzed, and the following is set: . Figure 3 This is a schematic diagram of the contour measurement data of workpiece B. The stylus slipped abnormally at the end. Figure 4 Figure 2 is the original coordinate distribution of the contour measurement data of workpiece B and the contour measurement data of workpiece A. It can be seen from the figure that the starting part of the measured contour of workpiece B is incomplete relative to workpiece A.
[0029] Construct a shape description feature vector to The median measurement point of the x-axis coordinate value of the intercepted measurement point set is the origin , select two sides from the origin along the x-axis for Measurement points of step length and , and we get two line segments , . Further, according to The interval of the step length is gradually expanded to both ends to obtain are two line segments with endpoints, , , calculate the forward segment and , calculate the backward line segment and The angle of the line segment finally obtains the shape description feature vector of the contour of the matching part of the workpiece to be annotated In this embodiment, it is set .
[0030] Using large interval sliding mode, from template contour data The starting segment, every x-axis step length, intercept In this embodiment, the measurement points are set The same method as above is used to calculate the shape description feature vector of this segment of the contour, and finally the shape description feature vector set D of each segment of the template data is obtained. The cosine similarity is used to calculate the shape description feature vector of the contour of the workpiece to be matched. The similarity with the feature vectors describing the shape of each segment of the template is used, and the segment contour with the highest similarity is determined as the area with the highest matching degree, so as to achieve fast coarse matching alignment.
[0031] Use small interval sliding mode to extend the segmented contour data to both ends x-axis step length to get the exact match search area, and then every x-axis step length, intercept Measuring points, set Using the above method, the feature vector describing each segmented shape is calculated; the position point with the highest similarity is searched as the exact matching position point.
[0032] According to the obtained exact matching area, a set of matching point pairs on both sides is constructed, and then the homography transformation matrix of matching alignment is solved. , to mark the contour data of the workpiece Transform to achieve matching alignment with the template data coordinates. Figure 5 This is the result of the workpiece B contour being matched and aligned with the workpiece A contour after coordinate transformation.
[0033] S103, automatically marking the contour of the workpiece to be marked based on the automatic marking template and the matched and aligned feature vectors.
[0034] According to the x-axis coordinate value range after the contour data of the workpiece to be marked is transformed, the line segment template set in S101 is searched and arc template collection , determine the template line segment subset and template arc subset contained in the contour data range of the workpiece to be annotated, that is, the basic shape set that can be annotated for the workpiece.
[0035] According to the coordinate value of the x-axis center point of line segment i in the template line segment subset, the corresponding measurement point of the workpiece to be marked is located as the initial center point of the line segment to be marked. Taking into account the differences in workpiece processing and measurement, half of the x-axis length of line segment i, that is, the middle part is taken The measurement points are used as the initial measurement point set of the line segment to be annotated, and the line segment is automatically detected and annotated according to the method in S101; in this embodiment, the contour measurement of the workpiece B includes 7 line segments, which are all automatically detected, and the results are shown in Table 5: Table 5 Example of automatic line segment detection set for workpiece B contour measurement data According to the coordinate value of the x-axis center point of arc j in the template arc subset, the corresponding measurement point of the workpiece to be marked is located as the initial center point of the arc to be marked. Taking into account the differences in workpiece processing and measurement, half of the x-axis length of arc j, that is, the middle part is taken The measurement points are used as the initial measurement point set of the arc to be annotated, and the automatic detection and annotation of the arc is realized according to the method in S101; in this embodiment, only a part of the first arc is measured, and the results are shown in Table 6: Table 6 Example of the arc automatic detection set of workpiece B contour measurement data Figure 6 The automatic marking results of the contour measurement data of workpiece B are displayed. After the marking is completed, the various parameters of the calculated basic shape can be used to evaluate the processing quality of the batch of workpieces, such as the arithmetic mean deviation of the contour The index can be used to evaluate the roughness of the workpiece machined surface.
[0036] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0037] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for automatically marking measurement data of a contact profilometer, characterized in that: include: Using a contact profilometer and a selected template workpiece to obtain workpiece contour measurement data to automatically annotate a template, the automatic annotation template comprising: a line segment and arc template set of the template workpiece; Obtaining a contour shape description feature vector of the workpiece to be annotated, and automatically matching and aligning the feature vector with the automatic annotation template in stages; Automatic labeling of the contour of the workpiece to be labeled is achieved based on the automatic labeling template and the matched and aligned feature vectors.
2. The automatic labeling method for contact profilometer measurement data according to claim 1, characterized in that: The method of obtaining workpiece contour measurement data automatic marking template by using a contact profiler and a selected workpiece with qualified processing quality comprises: Use a contact profiler to detect the complete contour of the workpiece that meets the processing quality requirements, and use it as a reference template for the same model workpiece to obtain the contour two-dimensional measurement data ,in are the horizontal and vertical coordinate values of the stylus in the rectangular coordinate system, respectively, and the x-axis step length of the stylus is ,Right now ; Select the line segments and arc basic shapes in the template contour measurement data to obtain ,in is the partial contour measurement data of the i-th line segment; ,in is the partial contour measurement data of the jth arc segment; The complete contour of the line segment and the complete contour of the arc are accurately located by first expanding and then contracting to obtain the template set of all detected line segments. and a collection of templates for detecting arcs .
3. The automatic labeling method for contact profilometer measurement data according to claim 2, characterized in that: Use expansion followed by contraction to accurately locate the complete outline of the line segment, including: According to the specific situation of the workpiece, the minimum x-axis length of the line segment recognition is set to The minimum number of measurement points to identify a line segment is indivual; For Line segments, first analyze the number of measurement points selected by the box, if less than , then based on the line segment measurement data selected by the box, expand along both ends of the x-axis to obtain at least The initial fitting measurement point set of the line segment of the measurement points; Using linear regression as the basic model, the RANSAC algorithm is used to obtain stable segment parameter estimates, marked as segments , respectively represent the slope of the initial fitting line segment, the intercept, the starting and ending x-axis coordinate values of the line segment, and the arithmetic mean deviation of the profile; Adopt iterative expansion method, expand along the x-axis each time Step size method, first expand forward along the x-axis, and fit the new line segment ,calculate and The angle between two line segments, when the angle exceeds a certain threshold , it is determined that the front end contour structure of the line segment has changed, that is, it has reached the forward end of the line segment and contains the front end endpoint; Starting from the last fitting line segment forward expansion, the line segment is expanded backward in the same way, and after multiple iterations, a line segment contour measurement point set including the endpoints on both sides of the line segment is obtained; For the line segment contour measurement point set obtained in the previous expansion stage, the absolute error of the single point estimation is calculated point by point from both ends using the contraction method. When it is less than 0.5 When , it is identified as the endpoint truncation point of the line segment, so as to obtain the complete contour of the line segment i, and fit the line segment again, marked as This process can be repeated many times, and finally the template set of all detection segments is obtained. .
4. The automatic labeling method for contact profilometer measurement data according to claim 2, characterized in that: The full contour of the arc is precisely positioned by expanding first and then contracting, including: According to the specific situation of the workpiece, the minimum x horizontal length of the arc segment recognition is set to The minimum number of measurement points to identify an arc is indivual; For the jth arc, first analyze the number of measurement points in the selected arc. If it is less than , then based on the arc measurement points selected by the box, expand to both ends of the x-axis to obtain at least The initial fitting measurement point set of the arc of the measurement points; Based on the algebraic calculation formula of the arc, the RANSAC algorithm is used to obtain a stable estimate of the arc parameters and marked as , respectively represent the coordinates of the center of the fitted arc, radius, center angle, start and end x-axis coordinates of the arc, is the arithmetic mean deviation of the profile calculated from the distance between the centers of the measured points and the estimated radius; Adopt iterative expansion method, expand along the x-axis each time Step size method, previously extended, fitting new arc ,calculate and When the ratio exceeds a certain threshold , it is determined that the contour structure of the front end of the arc changes, that is, it reaches the end of the front end of the arc and includes the forward endpoint; Starting from the last fitted arc extended forward, the arc is extended backward along the x-axis in the same way. After multiple iterations, a contour including the endpoints on both sides of the arc is obtained. For the arc obtained in the above expansion stage, the square of the estimated error between the distance between the center of the measured point and the fitting radius is calculated point by point by using the contraction method. When it is identified as the endpoint of the line segment, the arc is fitted again and marked as This process can be repeated many times, and finally a template set of all detected arcs is obtained. .
5. The automatic labeling method for contact profilometer measurement data according to claim 1, characterized in that: The step of obtaining a contour shape description feature vector of the workpiece to be annotated, and automatically matching and aligning the feature vector with the automatic annotation template in stages, includes: The middle segment of the contour measurement data of the workpiece to be marked is cut for matching and alignment analysis, that is, the contour measurement data of the workpiece to be marked is , set the interception ratio , then only take The set of measurement points is used to match, symbol Indicates rounding up; Construct a shape description feature vector of the contour of the matching part of the workpiece to be annotated; A large interval sliding mode is used in combination with the shape description feature vector to achieve rough matching alignment between the contour measurement data of the workpiece to be marked and the automatic marking template; Adopt small interval sliding mode to search for exact matching position points based on coarse matching alignment data to obtain exact matching area; Construct a set of matching point pairs on both sides, and then solve the homography transformation matrix for matching alignment , to mark the contour data of the workpiece Transform to achieve matching alignment with template data coordinates.
6. The automatic labeling method for contact profilometer measurement data according to claim 5, characterized in that: The step of constructing a shape description feature vector of the contour of the matching part of the workpiece to be annotated includes: by The median measurement point of the x-axis coordinate value of the intercepted measurement point set is the origin , select two sides from the origin along the x-axis for Measurement points of step length and , and we get two line segments , ; according to The interval of the step length is gradually expanded to both ends to obtain Two line segments with endpoints, , , calculate the forward segment and The angle of Calculate the backward line segment and The angle of the line segment finally obtains the shape description feature vector of the contour of the matching part of the workpiece to be annotated .
7. The automatic labeling method for contact profilometer measurement data according to claim 5, characterized in that: The method of using the large interval sliding mode in combination with the shape description feature vector to achieve rough matching alignment of the contour measurement data of the workpiece to be marked with the automatic marking template includes: Using large interval sliding mode, from template contour data The starting segment, every x-axis step length, intercept measurement points; Calculate the shape description feature vector of this segment of the contour, and finally obtain the shape description feature vector set D of each segment of the template data; The cosine similarity is used to calculate the feature vector describing the contour shape of the workpiece to be matched. The similarity with the feature vectors describing the shape of each segment of the template is used, and the segment contour with the highest similarity is determined as the area with the highest matching degree, thereby achieving fast coarse matching alignment.
8. The method for automatically labeling measurement data of a contact profilometer according to claim 7, characterized in that: The small interval sliding mode is adopted to search for the exact matching position point based on the coarse matching alignment data, and the obtained exact matching area includes: Adopt small interval sliding mode and extend to both ends according to the obtained segmented contour data x-axis step length to obtain the exact match search area; Then every x-axis step length, intercept measurement points; Calculate the feature vector describing each segmented shape and search for the position point with the highest similarity as the exact matching position point.
9. The method for automatically labeling measurement data of a contact profilometer according to claim 1, characterized in that: The method of realizing automatic labeling of the contour of the workpiece to be labeled based on the automatic labeling template and the matched and aligned feature vectors includes: Search for the line segment template set according to the x-axis coordinate value range after the contour data of the workpiece to be marked is transformed and arc template collection ; Determine a subset of template line segments and a subset of template arcs contained in the data range of the workpiece contour to be annotated, that is, a basic shape set that can be annotated for the workpiece measurement contour; The coordinate value of the x-axis center point of the line segment i in the template line segment subset is used to locate the corresponding measurement point of the workpiece to be marked as the initial center point of the line segment to be marked, and half of the x-axis length of the line segment i, that is, the middle part is taken. The measurement points are used as the initial measurement point set of the line segment to be annotated, and the line segment is automatically detected and annotated; The coordinate value of the x-axis center point of arc j in the template arc subset is used to locate the corresponding measuring point of the workpiece to be marked as the initial center point of the arc to be marked; half of the x-axis length of arc j, that is, the middle part is taken The measurement points are used as the initial measurement point set of the arc to be annotated, and the arc is automatically detected and annotated; After the marking is completed, the various parameters of the basic shape are used to evaluate the processing quality of the batch of workpieces.
Citation Information
Patent Citations
Arc workpiece matching and positioning method based on high-precision geometric primitive extraction
CN111311618A
Dynamic obstacle detection method and device in agricultural machine motion state
CN111754550A
Systems and methods for obtaining 3-d images from x-ray information for deformed elongate bones
WO2019180745A1