Detection methods and systems
By selecting actual points on the workpiece and using the cross product of vectors to determine their positional relationship with the ideal contour, the problem of cumbersome detection steps in the existing technology is solved, and the rapid and accurate detection of the workpiece line profile is realized.
Patent Information
- Application Number
- CN202110807884.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-16
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2041-07-16
AI Technical Summary
In existing technologies, determining whether a point is located inside or outside the ideal contour during workpiece profile inspection is a rather cumbersome process.
A detection method is provided, which selects actual points on the workpiece to be inspected, obtains measurement points that are in the same coordinate system as the ideal contour, and uses the cross product of the vectors of adjacent first reference points and second reference points to determine the position of the measurement points, and determines whether they are located inside, outside or on the ideal contour.
It simplifies the workpiece line contour inspection process, improves the accuracy and efficiency of inspection, and can quickly determine the positional relationship of actual points.
Smart Images

Figure CN115615350B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of contour detection, and more particularly to a detection method and system thereof. Background Technology
[0002] With the advancement of automated processing technology in modern manufacturing, it is now possible to process workpieces with linear profiles to meet diverse functional requirements. Specifically, linear profile refers to the requirements for the shape of a curve. The definition of linear profile tolerance is that linear profile is an indicator that limits the variation of the actual curve from the ideal curve; it is a requirement for the shape accuracy of non-circular curves. Linear profile tolerance is the allowable variation of the actual measured element (profile element) from the ideal profile.
[0003] In order to ensure the quality of workpiece formation, strict inspection procedures need to be performed on the workpiece, and line profile is an important indicator for measuring the amount of workpiece distortion.
[0004] In the existing technology, the process of detecting the line profile of a workpiece and determining whether the actual point to be detected on the workpiece is inside or outside the ideal profile of the workpiece is quite cumbersome. Summary of the Invention
[0005] The problem solved by the embodiments of the present invention is to provide a detection method and system to determine whether the measurement point is located inside, outside or on the ideal contour of the workpiece to be tested, and then to determine whether the actual point on the workpiece to be tested is located inside, outside or on the ideal contour.
[0006] To address the aforementioned problems, embodiments of the present invention provide a detection method for detecting the line profile of a workpiece. The detection method includes: providing an ideal profile of the workpiece, the ideal profile including multiple reference points; selecting an actual point on the workpiece; obtaining a measurement point where the actual point and the ideal profile are in the same coordinate system; obtaining adjacent first and second reference points on the ideal profile, at least one of the first and second reference points being the reference point with the smallest distance from the measurement point; the direction from the first reference point to the second reference point being clockwise around a point inside the ideal profile; obtaining a first vector formed by the first reference point or any point between the first and second reference points and the second reference point; obtaining a second vector formed by the second reference point and the measurement point; and determining, based on the cross product of the first and second vectors, whether the measurement point is located inside, outside, or on the ideal profile of the workpiece.
[0007] This invention also provides a detection system for detecting the line profile of a workpiece. The detection system includes: a workpiece ideal profile module for providing an ideal profile of the workpiece, the ideal profile including multiple reference points; a measurement point acquisition module for selecting actual points on the workpiece and acquiring measurement points where the actual points and the ideal profile are in the same coordinate system; a feature reference point acquisition module for acquiring adjacent first and second reference points on the ideal profile, at least one of the first and second reference points being the reference point with the smallest distance from the measurement point; the direction from the first reference point to the second reference point being clockwise around a point inside the ideal profile; and a measurement point position determination module for acquiring a first vector formed by the first reference point or any point between the first and second reference points and the second reference point; acquiring a second vector formed by the second reference point and the measurement point; and determining, based on the cross product of the first and second vectors, whether the measurement point is located inside, outside, or on the ideal profile of the workpiece.
[0008] Compared with the prior art, the technical solution of the embodiments of the present invention has the following advantages:
[0009] In the detection method provided by this invention, an actual point is selected on the workpiece to be detected, and a measurement point is obtained in the same coordinate system as the ideal contour. Adjacent first and second reference points are obtained on the ideal contour, where at least one of the first and second reference points is the reference point with the smallest distance from the measurement point. The direction from the first reference point to the second reference point is clockwise around a point inside the ideal contour. A first vector is obtained, formed by the first reference point or any point between the first and second reference points and the second reference point. A second vector is obtained, formed by the second reference point and the measurement point. Based on the cross product of the first and second vectors, it is determined whether the measurement point is located inside, outside, or on the ideal contour of the workpiece to be detected. Correspondingly, it is determined whether the actual point in the workpiece to be detected is located inside, outside, or on the ideal contour. Attached Figure Description
[0010] Figure 1 This is a flowchart illustrating a detection method;
[0011] Figure 2 This is a schematic diagram of the ideal contour of the workpiece to be inspected according to the present invention;
[0012] Figure 3 The present invention obtains measurement points from the ideal contour of the workpiece to be inspected;
[0013] Figure 4This is a function graph of the arctangent values of each reference point in the ideal contour of the workpiece to be tested in the present invention, in four quadrants.
[0014] Figure 5 This is a schematic diagram of selecting corresponding measurement points on the ideal contour of the workpiece to be inspected according to the present invention;
[0015] Figure 6 This is a schematic diagram of obtaining the first reference point and the second reference point in the workpiece to be inspected according to the present invention;
[0016] Figure 7 This is a schematic diagram of the vector from the first reference point to the second reference point and the vector from the second reference point to the measurement point in the workpiece to be inspected according to the present invention, where the measurement point is located within the ideal contour.
[0017] Figure 8 This is a schematic diagram of the vector from the first reference point to the second reference point and the vector from the second reference point to the measurement point in the workpiece to be inspected according to the present invention, where the measurement point is located outside the ideal contour.
[0018] Figure 9 This is a schematic diagram showing that the measurement point in the workpiece to be tested according to the present invention is located on the ideal contour between the first reference point and the second reference point;
[0019] Figure 10 This is a schematic diagram of the workpiece to be tested in this invention, in which the measuring point is located on the extension line of the first reference point and the second reference point, and the measuring point is located on the side of the first reference point away from the second reference point;
[0020] Figure 11 This is a schematic diagram of the workpiece to be tested in this invention, in which the measuring point is located on the extension line of the first reference point and the second reference point, and the measuring point is located on the side of the second reference point away from the first reference point;
[0021] Figure 12 This is a functional block diagram of the detection system of the present invention. Detailed Implementation
[0022] As can be seen from the background art, in the existing technology, the process of detecting the line profile of a workpiece and determining whether the actual point to be detected on the workpiece is inside or outside the ideal profile of the workpiece is quite cumbersome.
[0023] To address the aforementioned technical problem, embodiments of the present invention provide a detection method for detecting the line profile of a workpiece. The detection method includes: providing an ideal profile of the workpiece, the ideal profile including multiple reference points; selecting an actual point on the workpiece; obtaining a measurement point where the actual point and the ideal profile are in the same coordinate system; obtaining adjacent first and second reference points on the ideal profile, at least one of the first and second reference points being the reference point with the smallest distance to the measurement point; the direction from the first reference point to the second reference point being clockwise around a point inside the ideal profile; obtaining a first vector formed by the first reference point or any point between the first and second reference points and the second reference point; obtaining a second vector formed by the second reference point and the measurement point; and determining, based on the cross product of the first and second vectors, whether the measurement point is located inside, outside, or on the ideal profile of the workpiece.
[0024] In the detection method provided by this invention, an actual point is selected on the workpiece to be detected, and a measurement point is obtained in the same coordinate system as the ideal contour. Adjacent first and second reference points are obtained on the ideal contour, where at least one of the first and second reference points is the reference point with the smallest distance from the measurement point. The direction from the first reference point to the second reference point is clockwise around a point inside the ideal contour. A first vector is obtained, formed by the first reference point or any point between the first and second reference points and the second reference point. A second vector is obtained, formed by the second reference point and the measurement point. Based on the cross product of the first and second vectors, it is determined whether the measurement point is located inside, outside, or on the ideal contour of the workpiece to be detected. Correspondingly, it is determined whether the actual point in the workpiece to be detected is located inside, outside, or on the ideal contour.
[0025] To make the above-mentioned objects, features and advantages of the embodiments of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0026] refer to Figure 1 and Figure 2 Step S1, providing an ideal profile 100 of the workpiece to be inspected, the ideal profile 100 including multiple reference points ( Figure 2 (Only the reference points on the ideal profile 100 are shown in the diagram).
[0027] In this embodiment, the ideal contour 100 is a two-dimensional model provided by engineering drawing software, including SolidWorks, Creo (PRO / E), or AutoCAD.
[0028] In this embodiment, the ideal contour 100 is composed of straight line segments or curve segments connecting adjacent reference points. Specifically, the ideal contour 100 is composed of straight line segments connecting adjacent reference points, and the ideal contour composed of straight line segments connecting adjacent reference points can increase the accuracy of subsequent judgments.
[0029] As an example, the ideal contour model 100 of the workpiece to be inspected is a two-dimensional graphic with convex edges. In other embodiments, the ideal contour model of the workpiece to be inspected may also be a three-dimensional model.
[0030] It should be noted that in the step of obtaining the ideal contour 100 of the workpiece to be inspected, the smaller the interval between adjacent reference points, the finer the reference line segment obtained by connecting the reference points. In this case, even if the actual point is very close to the edge of the workpiece to be inspected, the measurement point corresponding to the actual point can still accurately determine whether the measurement point is inside or outside the ideal contour 100.
[0031] Combination Figure 1 Step S2: Select an actual point on the workpiece to be tested.
[0032] In this embodiment, in the step of selecting actual points on the workpiece to be inspected, the actual points are irregular points that are prepared for measurement in advance.
[0033] Combination Figure 1 ,refer to Figure 3 Step S3: Obtain the measurement point P where the actual point and the ideal contour 100 are in the same coordinate system.
[0034] The measurement point P, which is in the same coordinate system as the actual point and the ideal contour 100, is obtained by comparing the measurement point P with the ideal contour 100. The measurement point P is determined to be inside, outside or on the ideal contour 100 of the workpiece to be measured, and thus the actual point is determined to be inside, outside or on the ideal contour 100 of the workpiece to be measured.
[0035] The fact that the actual point and the ideal contour 100 are in the same coordinate system means that the measurement point is the corresponding point of the actual point on the ideal contour 100. That is, the ideal contour completely coincides with the contour of the workpiece when there is no distortion. The actual workpiece will be distorted, causing the points on the workpiece to deviate from the ideal contour. The obtained measurement point makes the positional relationship between the measurement point and the ideal contour the same as the positional relationship between the actual point and the workpiece without distortion.
[0036] Specifically, when the coordinate system of the ideal contour is a two-dimensional coordinate system, the measurement point is a two-dimensional point with two coordinate components; when the coordinate system of the ideal contour is a three-dimensional coordinate system (the coordinate system of the 3D model), the measurement point is a three-dimensional point with three coordinate components.
[0037] The step of obtaining the measurement point in the same coordinate system as the actual point and the ideal contour 100 includes: inspecting the workpiece to be inspected, obtaining the measurement coordinates of the actual point in the first coordinate system; obtaining the transformation relationship between the first coordinate system and the second coordinate system in which the ideal contour 100 is located; and unifying the measurement coordinates and the ideal contour 100 to the same coordinate system according to the transformation relationship to obtain the measurement point.
[0038] The steps for detecting the workpiece to be detected include: the image acquisition unit obtaining an image of the workpiece to be detected; and obtaining the actual outline of the workpiece to be detected based on the area of the workpiece to be detected in the image.
[0039] In this embodiment, the image acquisition unit includes an imaging device or a three-dimensional detection device. Specifically, the imaging device includes an area array image sensor or a linear array image sensor. In other embodiments, the imaging device further includes a lens; the unit detection device is a dispersive confocal device, a white light interferometer, or a coordinate measuring machine.
[0040] The steps for establishing the first coordinate system include: selecting a first reference point inside the workpiece to be inspected, and establishing the first coordinate system with the first reference point as the origin. Each point on the actual contour of the workpiece to be inspected has a unique position coordinate relative to the origin.
[0041] As an example, the first reference point of the workpiece to be tested is the center or center of gravity of the workpiece.
[0042] The step of establishing a second coordinate system in the ideal contour 100 includes: selecting a second reference point O inside the ideal contour 100 of the workpiece to be inspected, and establishing a second coordinate system with the second reference point O as the origin.
[0043] A second coordinate system is established with the second reference point O as the origin, so that each point on the ideal contour 100 of the workpiece to be inspected has a definite position relative to the origin, in preparation for obtaining the coordinate position of the points on the ideal contour 100 in the future.
[0044] In this embodiment, the origin of the second coordinate system is the origin O, and the horizontal coordinate x and the vertical coordinate y are perpendicular to each other. Each point on the ideal contour 100 of the workpiece to be inspected has a definite and unique position coordinate relative to the origin.
[0045] As an example, the second reference point is the center or centroid of the ideal profile 100. In other embodiments, the second reference point may not be the center or centroid of the ideal profile 100.
[0046] In this embodiment, the step of obtaining the transformation relationship between the first coordinate system and the second coordinate system where the ideal contour 100 is located includes: detecting the workpiece to be detected and obtaining the first feature coordinates of at least three feature points in the first coordinate system; obtaining the second feature coordinates of the feature points of the workpiece in the second coordinate system; obtaining the transformation relationship based on the first feature coordinates and the second feature coordinates of at least three feature points, wherein the transformation relationship is used to make the first feature coordinates and the second feature coordinates of the same feature point coincide in the same coordinate system.
[0047] The step of obtaining the first feature coordinates of at least three feature points in the first coordinate system includes: detecting the workpiece to be tested to obtain the measurement profile of the workpiece to be tested; fitting the measurement profile according to the shape of the ideal profile 100 to obtain the fitted profile of the measurement profile; obtaining the center of the fitted profile and the first feature direction, wherein the first feature direction is the extension direction of the feature dimension of the fitted profile.
[0048] In this embodiment, one of the three feature points is the center of the fitted contour, and the other two feature points constitute the first feature direction. Obtaining the first feature coordinates of at least three feature points in the first coordinate system includes obtaining the center of the fitted contour and the first feature direction of the workpiece to be measured.
[0049] The ideal contour 100 has a second characteristic direction, which is the extension direction of the characteristic dimension of the fitted contour. Obtaining the second characteristic coordinates of at least three feature points in the second coordinate system includes obtaining the center of the fitted contour and the second characteristic direction of the workpiece to be measured.
[0050] The step of obtaining the transformation relationship based on the first feature coordinates and the second feature coordinates of at least three feature points includes: rotating and / or translating the first coordinate system and the second coordinate system to make the fitting center coincide with the center of the ideal contour 100, and making the first feature direction the same as the second feature direction; and obtaining the transformation relationship based on the rotation and / or translation transformation.
[0051] In other embodiments, the workpiece to be tested includes a feature structure, the feature structure includes the feature point, and the feature structure has rotational asymmetry about an axis other than the feature point. Obtaining the first feature coordinates of at least three feature points in a first coordinate system includes: obtaining the first feature coordinates of the feature points of the at least three feature structures in a first coordinate system. The feature structure can be a hole or a sphere, the feature point is the center of the feature structure, or the feature structure has a vertex angle, and the feature point is the vertex angle of the feature structure.
[0052] The step of detecting the workpiece to be tested and obtaining the first feature coordinates of at least three feature points in the first coordinate system includes: detecting the workpiece to be tested and obtaining the first feature coordinates of at least three feature points in the first coordinate system.
[0053] The step of obtaining the transformation relationship based on the first feature coordinates and the second feature coordinates of at least three feature points includes: rotating and / or translating the first coordinate system and the second coordinate system to make the first coordinates and the second coordinates of the same feature point coincide; and obtaining the transformation relationship based on the rotation and / or translation transformation.
[0054] In other embodiments, the workpiece to be tested includes a feature structure, the feature structure including the feature point, and the feature structure having rotational symmetry about an axis other than the feature point.
[0055] The ideal contour of the workpiece to be tested is circular, and the first feature direction and the second feature direction are both radial directions; or, the ideal contour of the workpiece to be tested is rectangular, and the first feature direction and the second feature direction are the extension directions of the corresponding sides of the ideal contour.
[0056] Combination Figure 1 ,refer to Figures 4 to 6 Step S4: Obtain adjacent first reference point and second reference point on the ideal contour 100. At least one of the first reference point and the second reference point is the reference reference point with the smallest distance from the measurement point. The direction from the first reference point to the second reference point is a clockwise direction around a point inside the ideal contour 100.
[0057] The ideal reference line segment is obtained to obtain the first reference point and the second reference point at both ends of the ideal reference line segment, in order to prepare for subsequent determination that the measurement point P is located inside or outside the ideal contour 100 of the workpiece to be inspected.
[0058] The step of obtaining adjacent first and second reference points on the ideal contour 100, wherein at least one of the first and second reference points is a reference reference point with the smallest distance from the measurement point, includes: Figure 5 As shown, the line connecting two adjacent reference points forms a reference line segment; as... Figure 6 As shown, the measurement distance L from the measurement point P to the plurality of reference line segments is obtained respectively; the plurality of measurement distances L are compared, and the reference line segment corresponding to the shortest measurement distance L is obtained as the ideal reference line segment, and the two ends of the ideal reference line segment are the first reference point and the second reference point, respectively.
[0059] The measured distance from the measurement point P to the baseline segment is the shortest distance from the measurement point P to the baseline segment.
[0060] Subsequently, using the baseline segment as a reference boundary, based on the measurement point on one side of the baseline segment, it is determined whether the measurement point is inside or outside the ideal contour 100, thereby determining whether the actual point is inside or outside the workpiece to be inspected.
[0061] In this embodiment, Figure 5 The baseline segments shown include P1P2, P2P3, P3P4, P4P5, P5P6, P6P7, P7P8, P8P9, P9P10, P10P11, P11P12, and P12P13.
[0062] In this embodiment, the measurement distances from the measurement point P to the plurality of baseline segments are repeatedly obtained, and the shortest measurement distance is obtained by comparing the plurality of measurement distances, thereby obtaining an ideal baseline segment. The two ends of the ideal baseline segment are the first reference point and the second reference point, respectively, and at least one of the first reference point and the second reference point is the reference reference point with the smallest distance from the measurement point.
[0063] As an example, a For loop statement is used to repeatedly obtain the measured distances from the measurement point P to the multiple baseline segments.
[0064] It should be noted that in the step of obtaining the ideal reference line segment with the smallest distance from the measurement point P among the plurality of reference line segments, the projection of the measurement point P along the direction perpendicular to the ideal reference line segment is located in the ideal reference line segment.
[0065] When a portion of the ideal contour 100 of the workpiece to be inspected is a straight line, the projection of the measurement point P along the shortest distance direction is located within the ideal reference line segment, thus avoiding the situation where the measurement point has multiple corresponding ideal reference line segments.
[0066] In other embodiments, the step of obtaining adjacent first and second reference points on the ideal contour, wherein at least one of the first and second reference points is a reference reference point with the smallest distance to the measurement point, includes: obtaining the distance from the measurement point to the plurality of reference points respectively; comparing the distances from the measurement point to the plurality of reference points, obtaining the reference point with the shortest distance to the measurement point as a reference reference point, and designating the reference reference point and the reference point adjacent to the reference reference point as the first reference point and the second reference point, respectively. Specifically, the reference point adjacent to the reference reference point can be a reference point arranged clockwise or counterclockwise around a point within the ideal contour.
[0067] In this embodiment, the direction from the first reference point to the second reference point is a clockwise direction around a point inside the ideal contour 100, including: the four-quadrant inverse trigonometric function of the first reference point is greater than the four-quadrant inverse trigonometric function of the second reference point.
[0068] Specifically, the four-quadrant inverse trigonometric functions include: four-quadrant arctangent, four-quadrant arcsine, four-quadrant inverse cotangent, or four-quadrant inverse cosine.
[0069] As an example, the detection method includes: before acquiring adjacent first and second reference points on the ideal contour 100, obtaining the arctangent value of each reference point in four quadrants based on the coordinates of each reference point; sorting the arctangent values of each reference point in four quadrants according to the function graph of the arctangent values, thereby sorting the reference points corresponding to each arctangent value in four quadrants; according to the sorting of the reference points corresponding to each arctangent value in four quadrants; and sequentially connecting the reference points corresponding to the arctangent values in four quadrants from largest to smallest. In this embodiment, after sequentially connecting the reference points corresponding to the arctangent values in four quadrants from largest to smallest, the direction of the first vector is made to be the same as the direction of the reference point arrangement when acquiring the first vector.
[0070] Specifically, the function for the arctangent value in the four quadrants is D1 = atan2d(Y,X), where X and Y are the x-coordinate and y-coordinate values of the reference point in the coordinate system, such as... Figure 4 As shown, D1 represents the angle value range of [-180, 180].
[0071] Sort the reference points according to the arctangent values of their coordinates in the four quadrants. This makes it easier to connect the obtained reference line segments in sequence, and the reference line segments will not intersect.
[0072] Taking the arcsine of the four quadrants as an example, the method for determining the angle of each reference point in the coordinate system based on the coordinates of each reference point is as follows:
[0073] In the first quadrant, the x-coordinate and y-coordinate of the reference point are both greater than 0, so D = arcsin(y). 2 / exp(x 2 +y 2 ));
[0074] In the second quadrant, the x-coordinate of the reference point is less than 0, and the y-coordinate is greater than 0. The second quadrant is D = 180° - arcsin(y). 2 / exp(x 2 +y 2 ));
[0075] In the third quadrant, the x-coordinate of the reference point is less than 0, and the y-coordinate is less than 0. Therefore, D = 180° - arcsin(y / y). 2 / exp(x2 +y 2 ));
[0076] In the fourth quadrant, the x-coordinate of the reference point is greater than 0, and the y-coordinate is less than 0. Therefore, D = 360° + arcsin(y). 2 / exp(x 2 +y 2 )).
[0077] In this embodiment, the arctangent values of the four quadrants are obtained based on the horizontal and vertical coordinates of the locations of the reference points.
[0078] Taking the four-quadrant inverse cosine value as an example, the method for determining the angle of each reference point in the coordinate system based on the coordinates of each reference point is as follows:
[0079] In the first quadrant, the x-coordinate and y-coordinate of the reference point are both greater than 0, and D = arccos(y). 2 / exp(x 2 +y 2 ));
[0080] In the second quadrant, the x-coordinate of the reference point is less than 0, and the y-coordinate is greater than 0. The second quadrant is D = 180 + arccos(y). 2 / exp(x 2 +y 2 ));
[0081] In the third quadrant, the x-coordinate of the reference point is less than 0, the y-coordinate is less than 0, and D = 180° - arccos(y). 2 / exp(x 2 +y 2 ));
[0082] In the fourth quadrant, the x-coordinate of the reference point is greater than 0, and the y-coordinate is less than 0. Therefore, D = 360° - arccos(y). 2 / exp(x 2 +y 2 )).
[0083] Taking the four-quadrant inverse cotangent value as an example, the method for determining the angle of each reference point in the coordinate system based on the coordinates of each reference point is as follows:
[0084] In the first quadrant, the x-coordinate and y-coordinate of the reference point are both greater than 0, and D = arccot(x / y);
[0085] In the second quadrant, the x-coordinate of the reference point is less than 0 and the y-coordinate is greater than 0, so D = 180 + arccot(x / y);
[0086] In the third quadrant, the x-coordinate of the reference point is less than 0, the y-coordinate is less than 0, and D = 180° + arccot(x / y);
[0087] In the fourth quadrant, the x-coordinate of the reference point is greater than 0, and the y-coordinate is less than 0. Therefore, D = 360° + arccot(x / y).
[0088] Step S5: Obtain the first vector formed by the first reference point or any point between the first reference point and the second reference point and the second reference point; obtain the second vector formed by the second reference point and the measurement point.
[0089] The cross product of the first vector and the second vector is used to determine whether the measurement point is located inside, outside or on the ideal contour 100 of the workpiece to be measured.
[0090] In this embodiment, the direction from the first reference point to the second reference point, or from any point between the first and second reference points to the second reference point, is the first direction, which is clockwise. The direction from the second reference point to the measurement point is the second direction.
[0091] Combination Figure 1 ,refer to Figures 7 to 11 Step S6: Based on the cross product of the first vector and the second vector, determine whether the measurement point is located inside, outside or on the ideal contour 100 of the workpiece to be measured.
[0092] In this embodiment of the invention, an actual point is selected on the workpiece to be inspected, and a measurement point is obtained in the same coordinate system as the actual point and the ideal contour 100. Adjacent first and second reference points are obtained on the ideal contour 100, where at least one of the first and second reference points is the reference point with the smallest distance to the measurement point. The direction from the first reference point to the second reference point is clockwise around a point inside the ideal contour 100. A first vector is obtained formed by the first reference point or any point between the first and second reference points and the second reference point. A second vector is obtained formed by the second reference point and the measurement point. Based on the cross product of the first and second vectors, it is determined whether the measurement point is located inside, outside, or on the ideal contour 100 of the workpiece to be inspected. Correspondingly, it is determined whether the actual point in the workpiece to be inspected is located inside, outside, or on the ideal contour 100.
[0093] Determining whether the measurement point is located inside, outside, or on the ideal contour 100 of the workpiece under test based on the cross product of the first vector and the second vector includes: determining whether the measurement point is located on the ideal contour 100 if the cross product is zero; and determining whether the measurement point is located inside or outside the ideal contour 100 based on the sign of the cross product.
[0094] Specifically, determining whether the measurement point is located within or outside the ideal contour 100 based on the sign of the cross product includes:
[0095] As a first example, the direction of the first vector is the same as the first direction, and the direction of the second vector is the same as the second direction, such as... Figure 7 As shown, the cross product of the first vector and the second vector is greater than zero, and the measurement point is located inside the ideal contour 100 of the workpiece to be measured; Figure 8 As shown, the cross product of the first vector and the second vector is less than zero, and the measurement point is located outside the ideal contour 100 of the workpiece to be measured.
[0096] Correspondingly, In the At that time, the measuring point P is inside the ideal contour 100; in the... At that time, the measurement point P is outside the ideal profile 100.
[0097] As a second example, the direction of the first vector is the same as the first direction, the direction of the second vector is opposite to the second direction, the cross product of the first vector and the second vector is greater than zero, and the measurement point is located outside the ideal contour 100 of the workpiece to be measured; the cross product of the first vector and the second vector is less than zero, and the measurement point is located inside the ideal contour 100 of the workpiece to be measured.
[0098] Correspondingly, In the At that time, the measurement point P is outside the ideal profile 100; in the... At that time, the measurement point P is inside the ideal profile 100.
[0099] As a third example, the direction of the first vector is opposite to the first direction, the direction of the second vector is the same as the second direction, the cross product of the first vector and the second vector is greater than zero, and the measurement point is located outside the ideal contour 100 of the workpiece to be measured; the cross product of the first vector and the second vector is less than zero, and the measurement point is located inside the ideal contour 100 of the workpiece to be measured.
[0100] Correspondingly, Measurement point P is outside the ideal profile 100. The measurement point P is inside the ideal profile 100.
[0101] As a fourth example, the direction of the first vector is opposite to the first direction, the direction of the second vector is opposite to the second direction, the cross product of the first vector and the second vector is greater than zero, and the measurement point is located inside the ideal contour 100 of the workpiece to be measured; the cross product of the first vector and the second vector is less than zero, and the measurement point is located outside the ideal contour 100 of the workpiece to be measured.
[0102] Measurement point P is inside the ideal profile 100. The measurement point P is outside the ideal profile 100.
[0103] Specifically, based on the fact that the cross product is zero, that is... Determining whether the measurement point is located on the ideal profile 100 includes:
[0104] As a fifth example, such as Figure 9 As shown, the cross product of the first vector and the second vector is zero, and the measurement point is located on the line segment where the first reference point and the second reference point are located. Therefore, the measurement point is located on the ideal contour 100.
[0105] As a sixth example, such as Figure 10 As shown and Figure 11 As shown, the cross product of the first vector and the second vector is zero, and the measurement point is located on the extension line of the line segment where the first reference point and the second reference point are located. Obtain the nearest reference point P3 that is adjacent to the reference reference point, excluding the first reference point and the second reference point. Use the reference reference point and the nearest reference point P3 as the new first reference point and the second reference point, and repeat the step of determining whether the measurement point is located inside, outside or on the ideal contour 100 of the workpiece to be measured based on the cross product of the first vector and the second vector.
[0106] In one example, after obtaining the cross product, it is determined whether the cross product is zero: if the cross product is zero, it is determined whether the measurement point is located on the ideal contour; otherwise, it is determined whether the measurement point is located inside or outside the ideal contour based on the sign of the cross product.
[0107] In another embodiment, before obtaining the cross product, it is determined whether the measurement point is on the line segment where the first reference point and the second reference point are located, as well as on the line segment between the reference reference point and the adjacent reference point: if the measurement point is on the line segment where the first reference point and the second reference point are located, then the measurement point is located on the ideal contour; otherwise, the measurement point is determined to be inside or outside the ideal contour according to the sign of the cross product.
[0108] Figure 10 include Figure 10 a and Figure 10b, Figure 10 b represents the first and second reference points that are redefined after the initial reference point is determined. When the first reference point is the initial reference point, that is, the obtained neighboring reference point P3 is located at the end of the first reference point P1 that is far away from the second reference point P2. Therefore, the direction from the new first reference point to the second reference point, or the direction from any point between the first and second reference points to the second reference point, is clockwise relative to a point inside the ideal contour.
[0109] Specifically, such as Figure 10 a. When the cross product is zero, the reference reference point is the first reference point P1, and P is located outside the line segment between P1 and P2, and the nearest reference point is P3, then the nearest reference point is taken as the new first reference point, and the first reference point P2 is taken as the new second reference point. Based on the new first reference point and the second reference point, and based on the cross product value of the first vector and the second vector, the step of determining whether the measurement point is located inside, outside or on the ideal contour of the workpiece to be measured includes: determining that the measurement point is located on the ideal contour based on the cross product being zero.
[0110] As the first example, when In the At that time, the measuring point P is inside the ideal contour 100; in the... When the measurement point P is outside the ideal contour 100, the other three examples refer to the aforementioned transformations and will not be repeated here.
[0111] Figure 11 include Figure 11 a and Figure 11 b, Figure 11 b represents the first and second reference points that are redefined after the initial reference point is determined. When the first reference point is the initial reference point, that is, when the obtained neighboring reference point P3 is located on the side of the second reference point P2 that is far away from the first reference point P1, the direction from the new first reference point to the second reference point, or the direction from any point between the first and second reference points to the second reference point, is clockwise relative to a point inside the ideal profile.
[0112] like Figure 11 a. When the cross product is zero, the reference reference point is the second reference point P2, and P is located outside the line segment between P1 and P2, and the nearest reference point is P3, then the second reference point is taken as the new first reference point, and the nearest point is taken as the new second reference point. Based on the new first reference point and the second reference point, and based on the cross product value of the first vector and the second vector, the step of determining whether the measurement point is located inside, outside or on the ideal contour of the workpiece to be measured includes: determining that the measurement point is located on the ideal contour based on the cross product being zero.
[0113] As the first example, when In the At that time, the measurement point P is outside the ideal profile 100; in the... When the measurement point P is inside the ideal contour 100, the other three examples refer to the aforementioned transformations and will not be repeated here.
[0114] Accordingly, the present invention also provides a detection system. (See reference) Figure 12 The diagram shows a functional block diagram of the detection system of the present invention.
[0115] Reference Figure 12 The detection system includes: a module 10 for detecting the line profile of a workpiece to be inspected, characterized in that it includes: a workpiece ideal profile 100 module 10, used to provide an ideal profile 100 of the workpiece to be inspected, the ideal profile 100 including multiple reference points; a measurement point acquisition module 20, used to select actual points on the workpiece to be inspected, and to acquire measurement points where the actual points and the ideal profile 100 are in the same coordinate system; a feature reference point acquisition module 30, used to acquire adjacent first reference points and second reference points on the ideal profile 100, at least one of the first reference points and the second reference point being the reference point with the smallest distance from the measurement point; the direction from the first reference point to the second reference point is a clockwise direction around a point inside the ideal profile 100; and a measurement point position determination module 40, used to acquire a first vector formed by the first reference point or any point between the first reference point and the second reference point and the second reference point; acquire a second vector formed by the second reference point and the measurement point; and determine, based on the cross product of the first vector and the second vector, whether the measurement point is located inside, outside, or on the ideal profile 100 of the workpiece to be inspected.
[0116] In this embodiment of the invention, a feature reference point acquisition module 30 is used to acquire adjacent first reference points and second reference points on the ideal contour 100, wherein at least one of the first reference point and the second reference point is a reference reference point with the smallest distance from the measurement point; the direction from the first reference point to the second reference point is a clockwise direction around a point inside the ideal contour 100; a measurement point position determination module 40 is used to acquire a first vector formed by the first reference point or any point between the first reference point and the second reference point and the second reference point; acquire a second vector formed by the second reference point and the measurement point; and determine, based on the cross product of the first vector and the second vector, whether the measurement point is located inside, outside, or on the ideal contour 100 of the workpiece to be measured, and correspondingly determine whether the actual point in the workpiece to be measured is located inside or outside the ideal contour 100.
[0117] The workpiece ideal profile 100 module 10 is used to provide the ideal profile 100 of the workpiece to be inspected.
[0118] In this embodiment, the ideal contour 100 is a two-dimensional model provided by engineering drawing software, including SolidWorks, Creo (PRO / E), or AutoCAD.
[0119] In this embodiment, the ideal contour 100 is composed of straight line segments or curved segments connecting adjacent reference points. When the ideal contour 100 is composed of curved segments connecting adjacent reference points, the reference points can be connected by smooth curves.
[0120] As an example, the ideal contour model 100 of the workpiece to be inspected is a two-dimensional graphic with convex edges. In other embodiments, the ideal contour model of the workpiece to be inspected may also be a three-dimensional model.
[0121] It should be noted that the smaller the interval between adjacent reference points, the finer the reference line segment obtained by connecting the subsequent reference points. In this case, even if the actual point is very close to the edge of the workpiece to be inspected, the measurement point corresponding to the actual point can still accurately determine whether the measurement point is inside or outside the ideal contour 100.
[0122] The measurement point acquisition module 20 is used to take the pre-prepared abnormal points as the actual points.
[0123] The measurement point P, which is in the same coordinate system as the actual point and the ideal contour 100, is obtained by comparing the measurement point P with the ideal contour 100. The measurement point P is determined to be inside, outside or on the ideal contour 100 of the workpiece to be measured, and thus the actual point is determined to be inside, outside or on the ideal contour 100 of the workpiece to be measured.
[0124] The fact that the actual point and the ideal contour 100 are in the same coordinate system means that the measurement point is the corresponding point of the actual point on the ideal contour 100. That is, the ideal contour completely coincides with the contour of the workpiece when there is no distortion. The actual workpiece will be distorted, causing the points on the workpiece to deviate from the ideal contour. The obtained measurement point makes the positional relationship between the measurement point and the ideal contour the same as the positional relationship between the actual point and the workpiece without distortion.
[0125] Specifically, when the coordinate system of the ideal contour is a two-dimensional coordinate system, the measurement point is a two-dimensional point with two coordinate components; when the coordinate system of the ideal contour is a three-dimensional coordinate system (the coordinate system of the 3D model), the measurement point is a three-dimensional point with three coordinate components.
[0126] The measurement point acquisition module 20 includes: an actual point position unit 21, used to detect the workpiece to be inspected and acquire the measurement coordinates of the actual point in a first coordinate system; a transformation unit 22, used to acquire the transformation relationship between the first coordinate system and the second coordinate system in which the ideal contour 100 is located; and a measurement point position unit 23, used to unify the measurement coordinates and the ideal contour 100 to the same coordinate system according to the transformation relationship, and obtain the measurement point.
[0127] The actual point position unit 21 is used to obtain an image of the workpiece to be inspected through the image acquisition unit; and to obtain the actual outline of the workpiece to be inspected based on the area of the workpiece to be inspected in the image.
[0128] The image acquisition unit includes an imaging device or a three-dimensional detection device. Specifically, the imaging device includes an area array image sensor or a linear array image sensor. In other embodiments, the imaging device further includes a lens; the unit detection device is a dispersive confocal device, a white light interferometer, or a coordinate measuring machine.
[0129] A first reference point is located inside the workpiece to be inspected, and a first coordinate system is established with the first reference point as the origin. Each point on the actual contour of the workpiece to be inspected has a unique position coordinate relative to the origin.
[0130] A second reference point O is located inside the ideal contour 100, and the second coordinate system is established with the second reference point O as the center. The second coordinate system is established with the second reference point O as the origin, so that each point on the ideal contour 100 of the workpiece to be inspected has a definite position relative to the origin, which prepares for obtaining the coordinate positions of the points on the ideal contour 100 in the future.
[0131] In this embodiment, the origin of the second coordinate system is the origin O, and the horizontal coordinate x and the vertical coordinate y are perpendicular to each other. Each point on the ideal contour 100 of the workpiece to be inspected has a definite and unique position coordinate relative to the origin.
[0132] It should be noted that the first reference point of the workpiece to be inspected is the center or center of gravity of the workpiece, and correspondingly, the selected second reference point O is the center or center of gravity of the ideal contour 100. In other embodiments, the second reference point may not be the center or center of gravity of the ideal contour 100.
[0133] The conversion unit 22 is used to detect the workpiece to be inspected, obtain the first feature coordinates of at least three feature points in the first coordinate system; obtain the second feature coordinates of the feature points of the workpiece in the second coordinate system; and obtain the conversion relationship based on the first feature coordinates and the second feature coordinates of at least three feature points, wherein the conversion relationship is used to make the first feature coordinates and the second feature coordinates of the same feature point coincide in the same coordinate system.
[0134] The conversion unit 22 is used to detect the workpiece to be tested to obtain the measurement contour of the workpiece to be tested; to fit the measurement contour according to the shape of the ideal contour 100 to obtain the fitted contour of the measurement contour; and to obtain the center of the fitted contour and the first feature direction, wherein the first feature direction is the extension direction of the feature dimension of the fitted contour.
[0135] In this embodiment, one of the three feature points is the center of the fitted contour, and the other two feature points constitute the first feature direction. Obtaining the first feature coordinates of at least three feature points in the first coordinate system includes obtaining the center of the fitted contour and the first feature direction of the workpiece to be measured.
[0136] The ideal contour 100 has a second characteristic direction, which is the extension direction of the characteristic dimension of the fitted contour. Obtaining the second characteristic coordinates of at least three feature points in the second coordinate system includes obtaining the center of the fitted contour and the second characteristic direction of the workpiece to be measured.
[0137] The transformation unit 22 is used to rotate and / or translate the first coordinate system and the second coordinate system to make the fitting center coincide with the center of the ideal contour 100 and make the first feature direction the same as the second feature direction; and to obtain the transformation relationship according to the rotation and / or translation transformation.
[0138] In other embodiments, the workpiece to be tested includes a feature structure, the feature structure includes the feature point, and the feature structure has rotational asymmetry about an axis other than the feature point. Obtaining the first feature coordinates of at least three feature points in a first coordinate system includes: obtaining the first feature coordinates of the feature points of the at least three feature structures in a first coordinate system. The feature structure can be a hole or a sphere, the feature point is the center of the feature structure, or the feature structure has a vertex angle, and the feature point is the vertex angle of the feature structure.
[0139] The conversion unit 22 is used to detect the workpiece to be tested and obtain the first feature coordinates of at least three feature points in the first coordinate system; to make the first coordinates and second coordinates of the same feature point coincide by rotating and / or translating the first coordinate system and the second coordinate system; and to obtain the conversion relationship according to the rotation and / or translation changes.
[0140] In other embodiments, the workpiece to be tested includes a feature structure, the feature structure including the feature point, and the feature structure having rotational symmetry about an axis other than the feature point.
[0141] The ideal contour of the workpiece to be tested is circular, and the first feature direction and the second feature direction are both radial directions; or, the ideal contour of the workpiece to be tested is rectangular, and the first feature direction and the second feature direction are the extension directions of the corresponding sides of the ideal contour.
[0142] The feature reference point acquisition module 30 is used to acquire the first reference point and the second reference point at both ends of the ideal reference line segment, in order to prepare for subsequent determination that the measurement point P is located inside or outside the ideal contour 100 of the workpiece to be inspected.
[0143] The feature reference point acquisition module 30, such as Figure 5 As shown, a baseline segment is formed by connecting two adjacent reference points; as... Figure 6 As shown, the measurement distance L from the measurement point P to the plurality of reference line segments is obtained respectively; the plurality of measurement distances L are compared, and the reference line segment corresponding to the shortest measurement distance L is obtained as the ideal reference line segment, and the two ends of the ideal reference line segment are the first reference point and the second reference point, respectively.
[0144] The measured distance from the measurement point P to the baseline segment is the shortest distance from the measurement point P to the baseline segment.
[0145] The baseline segment provides a reference boundary for the measurement point position determination module 40. Based on the measurement point on one side of the baseline segment, it is determined whether the measurement point is inside or outside the ideal contour 100, thereby determining whether the actual point is inside or outside the workpiece to be inspected.
[0146] In this embodiment, Figure 5 The baseline segments shown include P1P2, P2P3, P3P4, P4P5, P5P6, P6P7, P7P8, P8P9, P9P10, P10P11, P11P12, and P12P13.
[0147] In this embodiment, the measurement distances from the measurement point P to the plurality of baseline segments are repeatedly obtained, and the shortest measurement distance is obtained by comparing the plurality of measurement distances, thereby obtaining an ideal baseline segment. The two ends of the ideal baseline segment are the first reference point and the second reference point, respectively, and at least one of the first reference point and the second reference point is the reference reference point with the smallest distance from the measurement point.
[0148] As an example, a For loop statement is used to repeatedly obtain the measured distances from the measurement point P to the multiple baseline segments.
[0149] It should be noted that in the step of obtaining the ideal reference line segment with the smallest distance from the measurement point P among the plurality of reference line segments, the projection of the measurement point P along the direction perpendicular to the ideal reference line segment is located in the ideal reference line segment.
[0150] When a portion of the ideal contour 100 of the workpiece to be inspected is a straight line, the projection of the measurement point P along the shortest distance direction is located within the ideal reference line segment, thus avoiding the situation where the measurement point has multiple corresponding ideal reference line segments.
[0151] In other embodiments, the feature reference point acquisition module 30 is used to acquire the distance from the measurement point to the plurality of reference points respectively; to compare the distances from the measurement point to the plurality of reference points, and to obtain the reference point with the shortest distance from the measurement point as a reference reference point, and to designate the reference reference point and the reference point adjacent to the reference reference point as the first reference point and the second reference point, respectively. Specifically, the reference point adjacent to the reference reference point can be a reference point arranged clockwise or counterclockwise around a point within the ideal contour.
[0152] In this embodiment, the feature reference point acquisition module 30 is used to make the four-quadrant inverse trigonometric function of the first reference point greater than the four-quadrant inverse trigonometric function of the second reference point.
[0153] Specifically, the four-quadrant inverse trigonometric functions include: four-quadrant arctangent, four-quadrant arcsine, four-quadrant inverse cotangent, or four-quadrant inverse cosine.
[0154] As an example, the feature reference point acquisition module 30 is used to obtain the arctangent value of each reference point in the four quadrants based on the coordinates of each reference point; to sort the arctangent values of each reference point in the four quadrants according to the function graph of the arctangent values, so that the reference points corresponding to each arctangent value in the four quadrants are sorted; and to connect the reference points corresponding to the arctangent values in the four quadrants from largest to smallest in order of sorting, to form the reference line segment. In this embodiment, after connecting the reference points corresponding to the arctangent values in the four quadrants from largest to smallest in order, the direction of the first vector is made to be the same as the direction of the reference point arrangement when obtaining the first vector.
[0155] Specifically, the function for the arctangent value in the four quadrants is D = atan2d(Y,X), where X and Y are the x-coordinate and y-coordinate values of the reference point in the coordinate system, such as... Figure 4 As shown, D represents the angle value range of [-180, 180].
[0156] Sort the reference points according to the arctangent values of their coordinates in the four quadrants. This makes it easier to connect the obtained reference line segments in sequence, and the reference line segments will not intersect.
[0157] Taking the arcsine of the four quadrants as an example, the method for determining the angle of each reference point in the coordinate system based on the coordinates of each reference point is as follows:
[0158] In the first quadrant, the x-coordinate and y-coordinate of the reference point are both greater than 0, so D = arcsin(y). 2 / exp(x 2 +y 2 ));
[0159] In the second quadrant, the x-coordinate of the reference point is less than 0, and the y-coordinate is greater than 0. The second quadrant is D = 180° - arcsin(y). 2 / exp(x 2 +y 2 ));
[0160] In the third quadrant, the x-coordinate of the reference point is less than 0, and the y-coordinate is less than 0. Therefore, D = 180° - arcsin(y / y). 2 / exp(x 2 +y 2 ));
[0161] In the fourth quadrant, the x-coordinate of the reference point is greater than 0, and the y-coordinate is less than 0. Therefore, D = 360° + arcsin(y). 2 / exp(x 2 +y 2 )).
[0162] In this embodiment, the arctangent values of the four quadrants are obtained based on the horizontal and vertical coordinates of the locations of the reference points.
[0163] Taking the four-quadrant inverse cosine value as an example, the method for determining the angle of each reference point in the coordinate system based on the coordinates of each reference point is as follows:
[0164] In the first quadrant, the x-coordinate and y-coordinate of the reference point are both greater than 0, and D = arccos(y). 2 / exp(x 2 +y 2 ));
[0165] In the second quadrant, the x-coordinate of the reference point is less than 0, and the y-coordinate is greater than 0. The second quadrant is D = 180 + arccos(y). 2 / exp(x 2 +y 2 ));
[0166] In the third quadrant, the x-coordinate of the reference point is less than 0, the y-coordinate is less than 0, and D = 180° - arccos(y). 2 / exp(x 2 +y 2 ));
[0167] In the fourth quadrant, the x-coordinate of the reference point is greater than 0, and the y-coordinate is less than 0. Therefore, D = 360° - arccos(y). 2 / exp(x 2 +y 2 )).
[0168] Taking the four-quadrant inverse cotangent value as an example, the method for determining the angle of each reference point in the coordinate system based on the coordinates of each reference point is as follows:
[0169] In the first quadrant, the x-coordinate and y-coordinate of the reference point are both greater than 0, and D = arccot(x / y);
[0170] In the second quadrant, the x-coordinate of the reference point is less than 0 and the y-coordinate is greater than 0, so D = 180 + arccot(x / y);
[0171] In the third quadrant, the x-coordinate of the reference point is less than 0, the y-coordinate is less than 0, and D = 180° + arccot(x / y);
[0172] In the fourth quadrant, the x-coordinate of the reference point is greater than 0, and the y-coordinate is less than 0. Therefore, D = 360° + arccot(x / y).
[0173] The cross product of the first vector and the second vector is used to determine whether the measurement point is located inside, outside or on the ideal contour 100 of the workpiece to be measured.
[0174] In this embodiment, the direction from the first reference point to the second reference point, or from any point between the first and second reference points to the second reference point, is the first direction, which is clockwise. The direction from the second reference point to the measurement point is the second direction.
[0175] The measurement point position determination module 40 is used to determine whether the measurement point is located on the ideal contour 100 based on the cross product being zero; and to determine whether the measurement point is located inside or outside the ideal contour 100 based on the sign of the cross product.
[0176] Specifically, determining whether the measurement point is located within or outside the ideal contour 100 based on the sign of the cross product includes:
[0177] As a first example, the measurement point position determination module 40 is used to ensure that the direction of the first vector is the same as the first direction, and the direction of the second vector is the same as the second direction, such as... Figure 7 As shown, the cross product of the first vector and the second vector is greater than zero, and the measurement point is located inside the ideal contour 100 of the workpiece to be measured; Figure 8 As shown, the cross product of the first vector and the second vector is less than zero, and the measurement point is located outside the ideal contour 100 of the workpiece to be measured.
[0178] Correspondingly, In the At that time, the measuring point P is inside the ideal contour 100; in the... At that time, the measurement point P is outside the ideal profile 100.
[0179] As a second example, the measurement point position determination module 40 is used to make the direction of the first vector the same as the first direction, the direction of the second vector opposite to the second direction, and the cross product of the first vector and the second vector greater than zero, and the measurement point is located outside the ideal contour 100 of the workpiece to be measured; or the cross product of the first vector and the second vector is less than zero, and the measurement point is located inside the ideal contour 100 of the workpiece to be measured.
[0180] Correspondingly, In the The measurement point P is outside the ideal profile 100; in the... At that time, the measurement point P is inside the ideal profile 100.
[0181] As a third example, the measurement point position determination module 40 is used to make the direction of the first vector opposite to the first direction, the direction of the second vector the same as the second direction, and the cross product of the first vector and the second vector greater than zero, wherein the measurement point is located outside the ideal contour 100 of the workpiece to be measured; and the cross product of the first vector and the second vector is less than zero, wherein the measurement point is located inside the ideal contour 100 of the workpiece to be measured.
[0182] Correspondingly, Measurement point P is outside the ideal profile 100. The measurement point P is inside the ideal profile 100.
[0183] As a fourth example, the measurement point position determination module 40 is used to make the direction of the first vector opposite to the first direction, the direction of the second vector opposite to the second direction, and the cross product of the first vector and the second vector greater than zero, wherein the measurement point is located inside the ideal contour 100 of the workpiece to be measured; and the cross product of the first vector and the second vector is less than zero, wherein the measurement point is located outside the ideal contour 100 of the workpiece to be measured.
[0184] Measurement point P is inside the ideal profile 100. The measurement point P is outside the ideal profile 100.
[0185] Specifically, determining that the measurement point is located on the ideal contour 100 based on the cross product being zero includes the following:
[0186] As a fifth example, such as Figure 9 As shown, the cross product of the first vector and the second vector is zero, and the measurement point is located on the line segment where the first reference point and the second reference point are located. Therefore, the measurement point is located on the ideal contour 100.
[0187] As a sixth example, such as Figure 10 As shown and Figure 11 As shown, the cross product of the first vector and the second vector is zero, and the measurement point is located on the extension line of the line segment where the first reference point and the second reference point are located. Obtain the nearest reference point P3 that is adjacent to the reference reference point, excluding the first reference point and the second reference point. Use the reference reference point and the nearest reference point P3 as the new first reference point and the second reference point, and repeat the step of determining whether the measurement point is located inside, outside or on the ideal contour 100 of the workpiece to be measured based on the cross product of the first vector and the second vector.
[0188] In one example, after obtaining the cross product, it is determined whether the cross product is zero: if the cross product is zero, it is determined whether the measurement point is located on the ideal contour; otherwise, it is determined whether the measurement point is located inside or outside the ideal contour based on the sign of the cross product.
[0189] In another embodiment, before obtaining the cross product, it is determined whether the measurement point is on the line segment where the first reference point and the second reference point are located, as well as on the line segment between the reference reference point and the adjacent reference point: if the measurement point is on the line segment where the first reference point and the second reference point are located, then the measurement point is located on the ideal contour; otherwise, the measurement point is determined to be inside or outside the ideal contour according to the sign of the cross product.
[0190] Figure 10 include Figure 10 a and Figure 10 b, Figure 10 b represents the first and second reference points that are redefined after the initial reference point is determined. When the first reference point is the initial reference point, that is, the obtained neighboring reference point P3 is located at the end of the first reference point P1 that is far away from the second reference point P2. Therefore, the direction from the new first reference point to the second reference point, or the direction from any point between the first and second reference points to the second reference point, is clockwise relative to a point inside the ideal contour.
[0191] Specifically, such as Figure 10 a. When the cross product is zero, the reference reference point is the first reference point P1, and P is located outside the line segment between P1 and P2, and the nearest reference point is P3, then the nearest reference point is taken as the new first reference point, and the first reference point P2 is taken as the new second reference point. Based on the new first reference point and the second reference point, and based on the cross product value of the first vector and the second vector, the step of determining whether the measurement point is located inside, outside or on the ideal contour of the workpiece to be measured includes: determining that the measurement point is located on the ideal contour based on the cross product being zero.
[0192] As the first example, when In the At that time, the measuring point P is inside the ideal contour 100; in the... When the measurement point P is outside the ideal contour 100, the other three examples refer to the aforementioned transformations and will not be repeated here.
[0193] Figure 11 include Figure 11 a and Figure 11 b, Figure 11 b represents the first and second reference points that are redefined after the initial reference point is determined. When the first reference point is the initial reference point, that is, when the obtained neighboring reference point P3 is located on the side of the second reference point P2 that is far away from the first reference point P1, the direction from the new first reference point to the second reference point, or the direction from any point between the first and second reference points to the second reference point, is clockwise relative to a point inside the ideal profile.
[0194] like Figure 11 a. When the cross product is zero, the reference reference point is the second reference point P2, and P is located outside the line segment between P1 and P2, and the nearest reference point is P3, then the second reference point is taken as the new first reference point, and the nearest point is taken as the new second reference point. Based on the new first reference point and the second reference point, and based on the cross product value of the first vector and the second vector, the step of determining whether the measurement point is located inside, outside or on the ideal contour of the workpiece to be measured includes: determining that the measurement point is located on the ideal contour based on the cross product being zero.
[0195] As the first example, when In the At that time, the measurement point P is outside the ideal profile 100; in the... When the measurement point P is inside the ideal contour 100, the other three examples refer to the aforementioned transformations and will not be repeated here.
[0196] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.
Claims
1. A detection method for detecting the line profile of a workpiece, characterized in that, The detection method includes: Provide an ideal profile of the workpiece to be inspected, the ideal profile including multiple reference points; Based on the coordinates of each reference point, obtain the arctangent value of each reference point in the four quadrants; sort the arctangent values of each reference point in the four quadrants according to the function graph of the arctangent values, so that the reference points corresponding to each arctangent value in the four quadrants are sorted; according to the sorting of the reference points corresponding to each arctangent value in the four quadrants, connect the reference points corresponding to the arctangent values in the four quadrants in descending order. Select an actual point on the workpiece to be tested; Obtain measurement points where the actual point and the ideal contour are in the same coordinate system; On the ideal contour, obtain adjacent first reference point and second reference point, at least one of the first reference point and the second reference point is the reference reference point with the smallest distance from the measurement point; the direction from the first reference point to the second reference point is a clockwise direction around a point inside the ideal contour; Obtain a first vector formed by the first reference point or any point between the first and second reference points and the second reference point; obtain a second vector formed by the second reference point and the measurement point. Based on the cross product of the first vector and the second vector, it is determined whether the measurement point is located inside, outside or on the ideal contour of the workpiece to be measured.
2. The detection method as described in claim 1, characterized in that, Determining whether the measurement point is located inside, outside, or on the ideal contour of the workpiece based on the cross product of the first and second vectors includes: Based on the fact that the cross product is zero, it is determined whether the measurement point is located on the ideal contour; The sign of the cross product determines whether the measurement point is located inside or outside the ideal contour.
3. The detection method as described in claim 2, characterized in that, The direction from the first reference point to the second reference point, or from any point between the first and second reference points to the second reference point, is the first direction; the direction from the second reference point to the measurement point is the second direction. Determining whether the measurement point is located inside or outside the ideal contour based on the sign of the cross product includes: The direction of the first vector is the same as the first direction, the direction of the second vector is the same as the second direction, the cross product of the first vector and the second vector is greater than zero, and the measurement point is located inside the ideal contour of the workpiece to be measured; if the cross product of the first vector and the second vector is less than zero, the measurement point is located outside the ideal contour of the workpiece to be measured. Alternatively, if the direction of the first vector is the same as the first direction, and the direction of the second vector is opposite to the second direction, and the cross product of the first vector and the second vector is greater than zero, the measurement point is located outside the ideal contour of the workpiece to be measured; if the cross product of the first vector and the second vector is less than zero, the measurement point is located inside the ideal contour of the workpiece to be measured. Alternatively, if the direction of the first vector is opposite to the first direction, and the direction of the second vector is the same as the second direction, and the cross product of the first vector and the second vector is greater than zero, the measurement point is located outside the ideal contour of the workpiece to be measured; if the cross product of the first vector and the second vector is less than zero, the measurement point is located inside the ideal contour of the workpiece to be measured. Alternatively, if the direction of the first vector is opposite to the first direction, and the direction of the second vector is opposite to the second direction, and the cross product of the first vector and the second vector is greater than zero, the measurement point is located inside the ideal contour of the workpiece to be measured; if the cross product of the first vector and the second vector is less than zero, the measurement point is located outside the ideal contour of the workpiece to be measured.
4. The detection method as described in claim 2, characterized in that, Determining whether the measurement point is located on the ideal contour based on the fact that the cross product is zero includes: if the cross product of the first vector and the second vector is zero, and the measurement point is located on the line segment where the first reference point and the second reference point are located, then the measurement point is located on the ideal contour. The cross product of the first vector and the second vector is zero, and the measurement point is located on the extension line of the line segment where the first reference point and the second reference point are located. Obtain the nearest reference point that is adjacent to the reference reference point, excluding the first reference point and the second reference point. Use the reference reference point and the nearest reference point as the new first reference point and the second reference point, and repeat the step of determining whether the measurement point is located inside, outside or on the ideal contour of the workpiece to be measured based on the cross product of the first vector and the second vector.
5. The detection method according to any one of claims 1 to 4, characterized in that, The ideal profile consists of straight line segments or curved segments connecting adjacent reference points.
6. The detection method as described in claim 1, characterized in that, The step of obtaining adjacent first and second reference points on the ideal contour, wherein at least one of the first and second reference points is a reference reference point with the smallest distance from the measurement point, includes: The line connecting two adjacent reference points forms a reference line segment; The measurement distances from the measurement points to multiple baseline segments are obtained respectively; The measured distances are compared to obtain the baseline segment corresponding to the shortest measured distance as the ideal baseline segment, and the two ends of the ideal baseline segment are the first reference point and the second reference point, respectively. Alternatively, the step of obtaining adjacent first and second reference points on the ideal contour, wherein at least one of the first and second reference points is the reference reference point with the smallest distance from the measurement point, includes: The distances from the measurement points to the plurality of reference points are obtained respectively; The distances from the measurement point to the plurality of reference points are compared, and the reference point with the shortest distance from the measurement point is obtained as the reference reference point. The reference reference point and the reference point adjacent to the reference reference point are respectively the first reference point and the second reference point.
7. The detection method as described in claim 1, characterized in that, The direction from the first reference point to the second reference point is a clockwise direction around a point inside the ideal contour, including: the four-quadrant inverse trigonometric function of the first reference point is greater than the four-quadrant inverse trigonometric function of the second reference point, and the four-quadrant inverse trigonometric function includes: four-quadrant arctangent, four-quadrant arcsine, four-quadrant inverse cotangent, or four-quadrant inverse cosine.
8. The detection method as described in claim 1, characterized in that, The steps for obtaining the measurement points where the actual point and the ideal contour are in the same coordinate system include: The workpiece to be inspected is inspected to obtain the measured coordinates of the actual point in the first coordinate system; Obtain the transformation relationship between the first coordinate system and the second coordinate system containing the ideal contour; The measurement coordinates and the ideal contour are unified to the same coordinate system according to the transformation relationship to obtain the measurement point.
9. The detection method as described in claim 8, characterized in that, The steps for obtaining the transformation relationship between the first coordinate system and the second coordinate system containing the ideal contour include: The workpiece to be inspected is inspected to obtain the first feature coordinates of at least three feature points in the first coordinate system; Obtain the second feature coordinates of the feature points of the workpiece in the second coordinate system; The transformation relationship is obtained based on the first feature coordinates and the second feature coordinates of at least three feature points, and the transformation relationship is used to make the first feature coordinates and the second feature coordinates of the same feature point coincide in the same coordinate system.
10. The detection method as described in claim 9, characterized in that, The step of detecting the workpiece to be inspected and obtaining the first feature coordinates of at least three feature points in the first coordinate system includes: detecting the workpiece to be inspected to obtain the measurement profile of the workpiece to be inspected; fitting the measurement profile according to the shape of the ideal profile to obtain the fitted profile of the measurement profile; obtaining the center of the fitted profile and the first feature direction, wherein the first feature direction is the extension direction of the feature dimension of the fitted profile. The ideal contour has a second feature direction, which is the extension direction of the feature dimension of the ideal contour; the step of obtaining the transformation relationship based on the first feature coordinates and the second feature coordinates of at least three feature points includes: rotating and / or translating the first coordinate system and the second coordinate system to make the fitting center coincide with the center of the ideal contour, and making the first feature direction the same as the second feature direction; obtaining the transformation relationship based on the rotation and / or translation transformation; or, The workpiece to be tested includes a feature structure, the feature structure includes the feature points, and the feature structure has rotational asymmetry about an axis other than the feature points; the step of testing the workpiece to be tested and obtaining the first feature coordinates of at least three of the feature points in a first coordinate system includes: The workpiece to be tested is inspected to obtain the first feature coordinates of at least three feature points in the first coordinate system; The step of obtaining the transformation relationship based on the first feature coordinates and the second feature coordinates of at least three feature points includes: rotating and / or translating the first coordinate system and the second coordinate system to make the first coordinates and the second coordinates of the same feature point coincide; and obtaining the transformation relationship based on the rotation and / or translation transformation.
11. The detection method as described in claim 10, characterized in that, The workpiece to be tested includes a feature structure, the feature structure includes the feature point, and the feature structure has rotational symmetry about an axis other than the feature point; The ideal contour of the workpiece to be tested is circular, and the first feature direction and the second feature direction are both radial directions; or, the ideal contour of the workpiece to be tested is rectangular, and the first feature direction and the second feature direction are the extension directions of the corresponding sides of the ideal contour.
12. A detection system for detecting the line profile of a workpiece, characterized in that, include: The workpiece ideal contour module is used to provide the ideal contour of the workpiece to be inspected, the ideal contour including multiple reference points; The feature reference point acquisition module is used to obtain the arctangent value of each reference point in the four quadrants based on the coordinates of each reference point; to sort the arctangent values of each reference point in the four quadrants according to the function graph of the arctangent values in the four quadrants, so that the reference points corresponding to each arctangent value in the four quadrants are sorted; and to connect the reference points corresponding to the arctangent values in the four quadrants from largest to smallest in order of sorting, so as to form a reference line segment. The measurement point acquisition module is used to select actual points on the workpiece to be inspected, and to acquire measurement points in the same coordinate system as the actual points and the ideal contour. The feature reference point acquisition module is used to acquire adjacent first reference points and second reference points on the ideal contour, wherein at least one of the first reference point and the second reference point is a reference reference point with the smallest distance from the measurement point; the direction from the first reference point to the second reference point is a clockwise direction around a point inside the ideal contour. The measurement point position determination module is used to obtain a first vector formed by the first reference point or any point between the first reference point and the second reference point and the second reference point; obtain a second vector formed by the second reference point and the measurement point; and determine, based on the cross product of the first vector and the second vector, whether the measurement point is located inside, outside or on the ideal contour of the workpiece to be measured.
13. The detection system as described in claim 12, characterized in that, The measurement point position determination module is used to determine whether the measurement point is located on the ideal contour based on the fact that the cross product is zero. This is used to determine whether the measurement point is located inside or outside the ideal contour based on the sign of the cross product.
14. The detection system as described in claim 13, characterized in that, The direction from the first reference point to the second reference point, or from any point between the first and second reference points to the second reference point, is the first direction; the direction from the second reference point to the measurement point is the second direction. The measurement point position determination module is used to ensure that the direction of the first vector is the same as the first direction, the direction of the second vector is the same as the second direction, and the cross product of the first vector and the second vector is greater than zero, indicating that the measurement point is located inside the ideal contour of the workpiece to be measured; or the cross product of the first vector and the second vector is less than zero, indicating that the measurement point is located outside the ideal contour of the workpiece to be measured. Alternatively, the first vector is positioned in the same direction as the first direction, the second vector is positioned in the opposite direction to the second direction, the cross product of the first and second vectors is greater than zero, and the measurement point is located outside the ideal contour of the workpiece to be measured. The cross product of the first vector and the second vector is less than zero, and the measurement point is located inside the ideal contour of the workpiece to be measured; Alternatively, the first vector is positioned opposite to the first direction, the second vector is positioned the same as the second direction, the cross product of the first and second vectors is greater than zero, and the measurement point is located outside the ideal contour of the workpiece to be measured. The cross product of the first vector and the second vector is less than zero, and the measurement point is located inside the ideal contour of the workpiece to be measured; Alternatively, the measurement point can be positioned such that the direction of the first vector is opposite to the first direction, the direction of the second vector is opposite to the second direction, the cross product of the first vector and the second vector is greater than zero, and the measurement point is located inside the ideal contour of the workpiece to be measured; or the cross product of the first vector and the second vector is less than zero, and the measurement point is located outside the ideal contour of the workpiece to be measured.
15. The detection system as described in claim 13, characterized in that, The measurement point position determination module is used to determine that when the cross product of the first vector and the second vector is zero, and the measurement point is located on the extension line of the line segment where the first reference point and the second reference point are located, then the measurement point is located on the ideal contour. Used to obtain the nearest reference point that is adjacent to the reference reference point, excluding the first and second reference points, when the cross product of the first and second vectors is zero and the measurement point is located outside the line segment where the first and second reference points are located; Using the reference datum point and the adjacent datum point as the new first datum point and second datum point, the step of determining whether the measurement point is located inside, outside or on the ideal contour of the workpiece under test is repeated based on the cross product value of the first vector and the second vector.
16. The detection system as described in claim 12, characterized in that, The feature reference point acquisition module is used to form a reference line segment by connecting two adjacent reference points; and to acquire the measurement distance from the measurement point to multiple reference line segments respectively. The module is used to compare multiple measured distances and obtain the baseline segment corresponding to the shortest measured distance as the ideal baseline segment, wherein the two ends of the ideal baseline segment are the first reference point and the second reference point, respectively; or, the feature reference point acquisition module is used to acquire the distance from the measurement point to the multiple reference points respectively. The distances from the measurement point to the plurality of reference points are compared, and the reference point with the shortest distance from the measurement point is selected as the reference reference point. The reference reference point and the reference point adjacent to the reference reference point are respectively designated as the first reference point and the second reference point.
17. The detection system as described in claim 12, characterized in that, The feature reference point acquisition module is used to make the four-quadrant inverse trigonometric function of the first reference point greater than the four-quadrant inverse trigonometric function of the second reference point. The four-quadrant inverse trigonometric function includes: four-quadrant arctangent, four-quadrant arcsine, four-quadrant inverse cotangent, or four-quadrant inverse cosine.
18. The detection system as described in claim 12, characterized in that, The measurement point acquisition module includes: The actual point position unit is used to detect the workpiece to be inspected and obtain the measured coordinates of the actual point in the first coordinate system. A transformation unit is used to obtain the transformation relationship between the first coordinate system and the second coordinate system in which the ideal contour is located; The measurement point location unit is used to unify the measurement coordinates and the ideal contour to the same coordinate system according to the transformation relationship, so as to obtain the measurement point.
19. The detection system as described in claim 18, characterized in that, The conversion unit is used to detect the workpiece to be inspected, obtain the first feature coordinates of at least three feature points in a first coordinate system; obtain the second feature coordinates of the feature points of the workpiece in a second coordinate system; and obtain the conversion relationship based on the first feature coordinates and second feature coordinates of at least three feature points, wherein the conversion relationship is used to make the first feature coordinates and second feature coordinates of the same feature point coincide in the same coordinate system.
20. The detection system as described in claim 19, characterized in that, The conversion unit is used to detect the workpiece to be tested to obtain the measurement contour of the workpiece; to fit the measurement contour according to the shape of the ideal contour to obtain the fitted contour of the measurement contour; and to obtain the center of the fitted contour and the first feature direction, wherein the first feature direction characterizes the shape of the fitted contour. The ideal contour has a second characteristic direction, which characterizes the shape of the ideal contour. The transformation unit is configured to rotate and / or translate the first coordinate system and the second coordinate system to make the fitting center coincide with the center of the ideal contour, and to make the first feature direction and the second feature direction the same; and to obtain the transformation relationship based on the rotation and / or translation transformation. Alternatively, the workpiece to be tested includes a feature structure, the feature structure includes the feature point, and the feature structure has rotational asymmetry about an axis other than the feature point; The conversion unit is used to detect the workpiece to be tested and obtain the first feature coordinates of at least three feature points in the first coordinate system. This is used to make the first and second coordinates of the same feature point coincide by rotating and / or translating the first and second coordinate systems; and to obtain the transformation relationship based on the rotation and / or translation changes.
Citation Information
Patent Citations
Calibration method for linear radar measurement system based on standard plane
CN106568381A
Ancient cultural relic three-dimensional model change detection method using contour line extraction and four-dimensional surface fitting
CN110838115A