An automatic marking method for contact profilometer measurement data
Automatic labeling templates are obtained through contact profilers and template workpieces, combined with expansion and shrinkage technology and sliding mode, the problems of inconsistency and inefficiency in batch automated labeling of traditional contact profilers are solved, and automatic matching, alignment and batch labeling of workpiece profile data are realized, which improves detection efficiency and accuracy.
Patent Information
- Application Number
- CN202510188564.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-02-20
AI Technical Summary
When traditional contact profilers automatically label workpiece contour measurement data in batches, there are problems such as differences in processing quality, clamping points and angle differences, differences in contact stylus starting point, contact stylus jump points and incomplete contour measurements, resulting in inconsistent marking results and inefficient efficiency.
By using a contact profiler and template workpiece to obtain automatic labeling templates, the complete contour of the line segment and arc is accurately determined by expanding first and then shrinking, combining large-spaced sliding and small-spaced sliding modes to achieve phased matching and alignment of feature vectors for the contour shape description of the workpiece to be labeled, and ultimately automatic labeling is achieved.
The automatic matching, alignment and batch labeling of contour measurement data of workpieces of different batches is realized, which improves the efficiency of workpiece contour detection and the accuracy of labeling, and reduces the inconsistency caused by human differences.
Smart Images

Figure CN119649074B_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] A contact profilometer is an instrument used to test and inspect the contour, two-dimensional dimensions, and two-dimensional displacement of an object. As a precision measuring instrument, it is widely used in the automotive manufacturing and railway industries. The contact profilometer measures by sliding the stylus against the surface being measured. The measurement principle is rectangular coordinate measurement, where the coordinate points of the surface contour of the measured part are mapped using X-axis and Z-axis sensors. The coordinate point data measured by the sensors is then transmitted to the host PC via electrical components. The software then performs mathematical operations on the collected raw coordinate data and marks the required engineering measurement items. Its main advantage is that it can directly measure the surface roughness of certain difficult-to-measure parts, such as holes and grooves, and can directly read readings according to certain evaluation standards or depict the shape of the surface contour curve. It also features fast measurement speed, reliable results, and easy operation, making it an important means of detecting workpiece processing quality.
[0003] Traditionally, annotators use human-computer interaction to select specific contour areas within workpiece measurement data and then calculate various metrics for these areas. The accuracy and efficiency of annotating specific workpiece areas depend on the annotator's proficiency. Automated batch annotation of contour measurement data for the same workpiece model during production and quality monitoring can significantly improve efficiency while overcoming inconsistencies in annotation results caused by differences in personnel.
[0004] However, due to differences in the processing quality of different batches of workpieces, differences in clamping points and angles during workpiece contour measurement, differences in the starting point of the stylus, stylus jump points, and incomplete contour measurement, the realization of batch automatic labeling requires solving key issues such as the matching and alignment of measurement data from different batches, and accurate automatic detection of the 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:
[0006] In a first aspect, an embodiment of the present application provides a method for automatically labeling measurement data of a contact profilometer, comprising:
[0007] Using a contact profilometer and a selected template workpiece to obtain workpiece contour measurement data, the automatic annotation template includes: a line segment and arc template set of the template workpiece;
[0008] 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;
[0009] 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.
[0010] In a possible implementation, the method of automatically marking a template by obtaining workpiece contour measurement data using a contact profilometer and a selected workpiece with qualified processing quality includes:
[0011] Use a contact profilometer to detect the complete contour of the workpiece whose processing quality meets the 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, where the x-axis step length of the stylus is ,Right now ;
[0012] 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 j-th arc segment;
[0013] The complete outline of the line segment and the complete outline of the arc are accurately located by first expanding and then contracting to obtain the template set of all detected line segments. and a template set for detecting arcs .
[0014] In one possible implementation, the complete outline of the line segment is precisely located by first expanding and then contracting, including:
[0015] 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;
[0016] For the Line segments, first analyze the number of measurement points selected, if less than , then based on the line segment measurement data selected by the frame, 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;
[0017] 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;
[0018] Adopt iterative expansion method, expand along the x-axis each time In a step-by-step manner, first expand forward along the x-axis to fit a 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;
[0019] Starting from the forward expansion of the last fitted line segment, the line segment is expanded 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.
[0020] For the line segment contour measurement point set obtained in the above expansion stage, the absolute error of single point estimation is calculated point by point from both ends using the contraction method. 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 .
[0021] In one possible implementation, the full contour of the arc is precisely positioned by first expanding and then contracting, including:
[0022] 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;
[0023] For the jth arc, first analyze the number of measurement points of the arc selected by the frame. If it is less than , then based on the arc measurement points selected by the frame, 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;
[0024] 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 fitting 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;
[0025] Adopt iterative expansion method, expand along the x-axis each time The method of step size is to expand the previous arc and fit the 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 contains the forward endpoint;
[0026] Starting from the last fitted arc extended forward, the arc is extended backward along the x-axis in the same way. After multiple iterations, the contour containing the endpoints on both sides of the arc is obtained.
[0027] For the arc obtained in the above expansion stage, the square of the estimated error between the distance between the center of the measuring point and the fitting radius is calculated point by point 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 to finally obtain a template set of all detected arcs. .
[0028] 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:
[0029] The middle segment of the workpiece contour measurement data to be marked is cut for matching alignment analysis, that is, the workpiece contour measurement data to be marked is , set the interception ratio , then only take The set of measurement points is used to match, symbol Indicates rounding up;
[0030] Construct a shape description feature vector of the contour of the matching part of the workpiece to be marked;
[0031] 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;
[0032] Using a small interval sliding mode, the precise matching position points are searched based on the coarse matching alignment data to obtain the precise matching area;
[0033] Construct a set of matching point pairs on both sides, and then solve the homography transformation matrix for matching alignment , to mark the workpiece contour data Perform transformation to achieve matching alignment with template data coordinates.
[0034] In a possible implementation, constructing a shape description feature vector of the contour of the matching portion of the workpiece to be annotated includes:
[0035] by The median measurement point of the x-axis coordinate value of the intercepted measurement point set is the origin , select the distance from the origin on both sides along the x-axis for Measurement points of step length and , and get two line segments , ;
[0036] according to The interval of the step length is gradually expanded to both ends to obtain For two line segments with endpoints, , , calculate the forward segment and The angle between
[0037] Calculate the backward segment and The angle between the line segments finally gives the shape description feature vector of the contour of the matching part of the workpiece to be marked. .
[0038] In a possible implementation, the use of the large-interval sliding mode in combination with the shape description feature vector to achieve coarse matching alignment between the contour measurement data of the workpiece to be annotated and the automatic annotation template includes:
[0039] Using large interval sliding mode, from template contour data The starting segment, every x-axis step length, intercept measurement points;
[0040] 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;
[0041] Use cosine similarity 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 determined, 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.
[0042] In a possible implementation, the small interval sliding mode is used to search for exact matching position points based on the coarse matching alignment data, and the obtained exact matching area includes:
[0043] Adopt small interval sliding mode and extend to both ends according to the segmented contour data obtained x-axis step size to obtain the exact matching search area;
[0044] Then every x-axis step length, intercept measurement points;
[0045] Calculate the feature vector describing each segment shape and search for the position point with the highest similarity as the exact matching position point.
[0046] 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:
[0047] Search for the line segment template set based on the x-axis coordinate value range after the contour data of the workpiece to be marked is transformed and arc template collection ;
[0048] Determine the template line segment subset and template arc subset contained in the range of the workpiece contour data to be annotated, that is, the basic shape set that can be annotated for the workpiece measurement contour;
[0049] 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;
[0050] 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;
[0051] After the marking is completed, the various parameters of the basic shape are used to evaluate the processing quality of the batch of workpieces.
[0052] In the embodiments of the present application, the automatic annotation template obtained from the template workpiece can be automatically aligned with the contour measurement data of the same type of workpiece, thereby automatically annotating the final contour data. In this way, for different batches of workpieces or different workpiece types, as long as the corresponding template workpiece is selected to obtain the automatic annotation template, batch annotation can be achieved, improving the efficiency of workpiece contour detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 A schematic flow chart of a method for automatically labeling measurement data of a contact profilometer provided in an embodiment of the present application;
[0054] Figure 2 Schematic diagram of line segment and arc annotation of template workpiece A provided in an embodiment of the present application;
[0055] Figure 3 Schematic diagram of workpiece B profile measurement data provided in an embodiment of the present application;
[0056] Figure 4 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;
[0057] Figure 5 Schematic diagram of the alignment of the contour measurement data of workpiece B and the contour of workpiece A provided in an embodiment of the present application;
[0058] Figure 6 This is 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
[0059] The present invention will be described below with reference to the accompanying drawings and specific implementation methods.
[0060] See also Figure 1 This is a powerful method for automatically labeling contact profilometer measurement data, including:
[0061] S101 , using a contact profilometer and a selected template workpiece to obtain workpiece contour measurement data and automatically mark a template, wherein the automatic marking template includes: a line segment and arc template set of the template workpiece.
[0062] Use a contact profilometer to detect the complete contour of the workpiece whose processing quality meets the 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 .
[0063] 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 data.
[0064] Table 1 Sample table of template workpiece contour measurement data (unit: cm)
[0065]
[0066] By using human-computer interaction, the line segments and arc basic shapes in the template contour measurement data are selected to obtain ,in is the partial contour measurement data of the i-th line segment; ,in 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 a total of 8 line segments and 2 arcs are selected for the template workpiece, as shown in Table 2:
[0067] Table 2 Example of single-point selection of basic shape of template workpiece A
[0068]
[0069] 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.
[0070] 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 frame, 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 segment fitting, the linear regression is used as the basic model, and the RANSAC algorithm is used to obtain a stable segment parameter estimation, which is marked as a 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.
[0071] Adopt iterative expansion method, expand along the x-axis each time In a step-by-step manner, first expand forward along the x-axis to fit a new line segment ,calculate and The angle between two line segments. When the angle exceeds a certain threshold , it is determined that the contour structure of the front end of the line segment has changed, that is, it has reached the forward end of the line segment and includes the front end endpoint. Further, starting from the last fitted 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 containing the endpoints on both sides of the line segment is obtained.
[0072] In order to obtain accurate endpoints of the line segment contour, the line segment contour measurement point set obtained in the above expansion stage is contracted to calculate the single point estimation absolute error 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 , repeated twice in this embodiment; finally, the set of all detection line segment templates is obtained .
[0073] In this embodiment, setting =200, , The obtained line segment template set is shown in Table 3:
[0074] Table 3 Line segment template set tag example table
[0075]
[0076] 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.
[0077] For the jth arc, first analyze the number of measurement points of the arc selected by the frame. If it is less than , then based on the arc measurement points selected by the frame, expand to both ends of the x-axis to obtain at least The initial fitting measurement point set of the arc is a set 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 fitting 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.
[0078] Adopt iterative expansion method, expand along the x-axis each time The method of step size is to expand the previous arc and fit the new arc. ,calculate and When a certain threshold is exceeded , the contour structure of the front end of the arc is determined to have 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 fitted arc extended forward, the same method is used to extend the arc backward along the x-axis. After multiple iterations, the contour containing the endpoints on both sides of the arc is obtained.
[0079] In order to obtain the precise endpoints of the arc contour, the arc obtained in the aforementioned expansion stage is contracted to calculate the square of the estimated error between the distance between the center of the measuring 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, the 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:
[0080] Table 4 Arc template set example table
[0081]
[0082] S102, obtaining a contour shape description feature vector of the workpiece to be marked, and automatically matching and aligning the feature vector with the automatic marking template in stages.
[0083] Usually, the first and last sections of the stylus's complete stroke are not the key parts of the workpiece, and the stylus may slide abnormally at the end. Therefore, the middle section of the workpiece contour measurement data to be marked is intercepted for matching and alignment analysis, that is, the workpiece contour measurement data 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 . Figure 3 This is a schematic diagram of the contour measurement data of workpiece B. Abnormal sliding of the stylus occurred at the end. Figure 4 Figure 2 shows 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 that of workpiece A.
[0084] 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 the distance from the origin on both sides along the x-axis for Measurement points of step length and , and get two line segments , . Further, according to The interval of the step length is gradually expanded to both ends to obtain For two line segments with endpoints, , , calculate the forward segment and , calculate the backward line segment and The angle between the line segments finally gives the shape description feature vector of the contour of the matching part of the workpiece to be marked. In this embodiment, it is set .
[0085] 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 obtain the shape description feature vector set D of each segment of the template data. The shape description feature vector of the contour of the workpiece to be matched is calculated using cosine similarity. The similarity with the feature vectors describing the shape of each segment of the template is determined, 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.
[0086] Use small interval sliding mode to extend the segmented contour data to both ends x-axis step size 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.
[0087] 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 the matching alignment is solved. , to mark the workpiece contour data Perform transformation to achieve matching alignment with template data coordinates, Figure 5 This is the result of the workpiece B contour being aligned with the workpiece A contour after coordinate transformation.
[0088] S103 , automatically marking the contour of the workpiece to be marked based on the automatic marking template and the matched and aligned feature vectors.
[0089] Search the line segment template set in S101 according to the x-axis coordinate value range after the transformed contour data of the workpiece to be marked 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 marked, that is, the basic shape set that can be marked for the workpiece.
[0090] 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. Taking into account the differences in workpiece processing and measurement, half of the x-axis length of the line segment i, that is, the middle part is taken as the initial center point. The measurement points are used as the initial measurement point set of the line segments to be annotated, and the line segments are automatically detected and annotated according to the method in S101. In this embodiment, the contour measurement of workpiece B includes 7 line segments, all of which are automatically detected. The results are shown in Table 5:
[0091] Table 5 Example of automatic line segment detection set for workpiece B contour measurement data
[0092]
[0093] 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 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 as the initial center point of the arc to be marked. 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 according to the method in S101. In this embodiment, only a portion of the first arc is measured, and the results are shown in Table 6:
[0094] Table 6 Example of arc automatic detection set of workpiece B contour measurement data
[0095]
[0096] Figure 6 The automatic marking results of the workpiece B contour measurement data 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.
[0097] In the embodiments of the present application, "at least one" refers to one or more, and "more" 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 next 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.
[0098] The above description is merely a specific embodiment of the present application. Any person skilled in the art may easily conceive of variations or substitutions within the technical scope disclosed in this application, and such variations or substitutions shall be within the scope of protection of this application. The scope of protection of this application shall be subject to the scope of protection of the claims.
Claims
1. A method for automatically labeling 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, the automatic annotation template includes: a line segment and arc template set of the template workpiece; The method of automatically marking a template for obtaining workpiece contour measurement data using a contact profilometer and a selected workpiece with qualified processing quality comprises: Use a contact profilometer to detect the complete contour of the workpiece whose processing quality meets the 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, where 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 j-th arc segment; The complete outline of the line segment and the complete outline of the arc are accurately located by first expanding and then contracting to obtain the template set of all detected line segments. and a template set for detecting arcs ; 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, including: The middle segment of the workpiece contour measurement data to be marked is cut for matching alignment analysis, that is, the workpiece contour measurement data 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 marked; 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; Using a small interval sliding mode, the precise matching position points are searched based on the coarse matching alignment data to obtain the precise 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 workpiece contour data Perform transformation to achieve matching alignment with template data coordinates; The step of 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 the distance from the origin on both sides along the x-axis for Measurement points of step length and , and get two line segments , ; according to The interval of the step length is gradually expanded to both ends to obtain For two line segments with endpoints, , , calculate the forward segment and Angle; Calculate the backward segment and The angle between the line segments finally gives the shape description feature vector of the contour of the matching part of the workpiece to be marked. ; 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: Use expansion followed by contraction to precisely 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 the Line segments, first analyze the number of measurement points selected, if less than , then based on the line segment measurement data selected by the frame, 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 , They represent the slope, intercept, starting and ending x-axis coordinates of the initial fitting segment, and the arithmetic mean deviation of the profile respectively; Adopt iterative expansion method, expand along the x-axis each time In a step-by-step manner, first expand forward along the x-axis to fit a 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 forward expansion of the last fitted line segment, the line segment is expanded 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. For the line segment contour measurement point set obtained in the expansion phase, 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 , and finally get the template set of all detection segments .
3. The automatic labeling method for contact profilometer measurement data according to claim 1, characterized in that: The full contour of the arc is precisely positioned using expansion followed by contraction, 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 of the arc selected by the frame. If it is less than , then based on the arc measurement points selected by the frame, 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 fitting 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 The method of step size is to expand the previous arc and fit the 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 contains 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, the contour containing the endpoints on both sides of the arc is obtained. For the arc obtained in the expansion stage, the contraction method is used to calculate the estimated error square of the distance between the center of the measuring 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 , and finally get the template set of all detected arcs .
4. The automatic labeling method for contact profilometer measurement data according to claim 1, 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; Use cosine similarity 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 determined, 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.
5. The automatic labeling method for contact profilometer measurement data according to claim 4, characterized in that: The small interval sliding mode is used to search for exact matching position points 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 segmented contour data obtained x-axis step size to obtain the exact matching search area; Then every x-axis step length, intercept measurement points; Calculate the feature vector describing each segment shape and search for the position point with the highest similarity as the exact matching position point.
6. The automatic labeling method for contact profilometer measurement data 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 based on the x-axis coordinate value range after the contour data of the workpiece to be marked is transformed and arc template collection ; Determine the template line segment subset and template arc subset contained in the range of the workpiece contour data to be annotated, that is, the 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