Detection Method, Device, Equipment and Storage Medium of Snap Structure
By performing image processing and coverage point determination methods on the three-dimensional digital and analog of the snap structure, the problems of low detection efficiency and easy error detection in the prior art are solved, and more efficient and accurate detection results are achieved.
Patent Information
- Application Number
- CN202210764101.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-06-30
AI Technical Summary
In the prior art, the detection of the snap structure mainly relies on manual methods, resulting in high repetition, long time, low efficiency, and easy to detect errors and miss detection.
By obtaining the three-dimensional digital and analog of the component to be identified, the image processing is performed in the preset direction, the minimum external rectangle of each hole feature is obtained, the coverage point is determined, and whether there is a snap structure is judged based on the coverage point and the three-dimensional digital and analog.
It improves the identification accuracy and efficiency of the snap structure, reduces manual intervention, avoids missed detection, and significantly improves detection efficiency.
Smart Images

Figure CN115147830B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle assembly, and particularly to a detection method, device, equipment and storage medium for a buckle structure. Background Art
[0002] In order to ensure the matching and workability of assembly, it is necessary to detect the buckle structure. At present, the manual method is selected for the detection of the buckle structure. However, in actual situations, due to the large number of buckles and parameters to be measured, the manual operation has high repeatability, long time consumption, low efficiency, and is prone to missed detection and false detection.
[0003] The above content is only used to assist in understanding the technical solution of the present invention, and does not represent an admission that the above content is the prior art. Summary of the Invention
[0004] The main object of the present invention is to provide a detection method, device, equipment and storage medium for a buckle structure, aiming to solve the technical problems that the manual measurement method adopted in the prior art is prone to missed detection and has low measurement efficiency.
[0005] To achieve the above object, the present invention provides a detection method for a buckle structure, and the detection method for the buckle structure includes the following steps:
[0006] Obtain the three-dimensional digital model of the component to be recognized;
[0007] Perform image processing on the three-dimensional digital model in a preset direction to obtain the minimum circumscribed rectangle corresponding to each hole feature on the three-dimensional digital model;
[0008] Determine the covering points on the hole feature component according to the minimum circumscribed rectangle, where the covering points are at least a pair of points on the hole feature component on one opposite side of the minimum circumscribed rectangle, and each pair of the covering points is centrosymmetric with respect to the center of the minimum circumscribed rectangle;
[0009] Judge whether there is a buckle structure on the component to be recognized according to the covering points and the three-dimensional digital model.
[0010] Optionally, the judging whether there is a buckle structure on the component to be recognized according to the covering points and the three-dimensional digital model is specifically:
[0011] Set a straight line or a ray at the covering points in the preset direction, and judge whether the straight line or the ray intersects with the three-dimensional digital model. When there is an intersection, it is judged that there is a buckle structure on the component to be recognized.
[0012] Optionally, the detection method for the buckle structure further includes:
[0013] Determine the direction positioning points on the hole feature component according to the minimum circumscribed rectangle, where the direction positioning points are at least a pair of points on at least the hole feature component on the same side of one side of the minimum circumscribed rectangle, and each pair of the covering points is centrosymmetric with respect to the center of the minimum circumscribed rectangle;
[0014] Judge the type of the snap structure according to the covering points, the direction positioning points, and the three-dimensional digital model data.
[0015] Optionally, the detection method of the snap structure further includes:
[0016] Determine the rectangular center point of the minimum circumscribed rectangle according to the vertices of the minimum circumscribed rectangle;
[0017] Taking the rectangular center point as a reference, square the minimum circumscribed rectangle so that the long side of the minimum circumscribed rectangle is parallel to the X-axis of the preset coordinate system and / or the short side is parallel to the Y-axis of the preset coordinate system. The preset coordinate system is in the same plane as the minimum circumscribed rectangle, and the X-axis of the preset coordinate system is parallel to the horizontal direction, and the Y-axis is perpendicular to the horizontal direction;
[0018] Determine the rotation angle based on the rotated minimum circumscribed rectangle;
[0019] Determine the covering points and the direction positioning points according to the rectangular center point and the rotation angle.
[0020] Optionally, the determining the covering points and the direction positioning points according to the rectangular center point and the rotation angle includes:
[0021] Perform coordinate calculation according to the coordinates of the rectangular center point and the rotation angle to obtain the reference covering points and the reference direction positioning points. The reference covering points are the auxiliary points corresponding to the covering points, and the reference direction positioning points are the auxiliary points corresponding to the direction positioning points;
[0022] Set a positioning ray with the reference direction positioning point as the origin according to the preset direction, and use the intersection point of the positioning ray and the component to be recognized as the direction positioning point;
[0023] Set a claw ray with the reference covering point as the origin according to the preset direction, and use the intersection point of the claw ray and the component to be recognized as the covering point.
[0024] Optionally, the detection method of the snap structure further includes:
[0025] When there is a snap structure on the component to be recognized, determine the hole midpoint according to the covering points;
[0026] Determine the first direction vector according to the direction positioning points;
[0027] Set a characteristic ray in the direction corresponding to the first direction vector with the midpoint of the hole as the reference point;
[0028] Identify whether there is a positioning rib in the buckle structure corresponding to the component to be identified through the characteristic ray;
[0029] If it is identified that there is a positioning rib in the buckle structure, identify the characteristic points corresponding to the positioning rib according to the characteristic ray;
[0030] If all the characteristic points are on the hole feature component, determine that the buckle structure type is the first type;
[0031] If all the characteristic points are on the claw feature component, determine that the buckle structure type is the second type;
[0032] If it is not identified that there is a positioning rib in the buckle structure, determine that the buckle structure type is the third type.
[0033] Optionally, the detection method of the buckle structure further includes:
[0034] When the buckle structure type is the first type or the second type, determine that there is a positioning rib in the corresponding buckle structure, and obtain the midpoint of the positioning rib according to the covered points;
[0035] Determine the midpoint of the hole according to the covered points;
[0036] Determine the parameters of the positioning rib cross-section of the corresponding buckle structure according to the midpoint of the positioning rib;
[0037] Determine the parameters of the buckle mating cross-section of the corresponding buckle structure according to the covered points and the midpoint of the hole.
[0038] Optionally, the obtaining the midpoint of the positioning rib according to the covered points includes:
[0039] Determine the claw auxiliary reference point according to the covered points;
[0040] Determine the first direction vector corresponding to the buckle structure according to the direction positioning point;
[0041] Set a characteristic ray in the direction corresponding to the first direction vector with the claw auxiliary reference point as the origin;
[0042] Obtain the characteristic points corresponding to the positioning rib within the long side range of the hole based on the characteristic ray;
[0043] Determine the midpoint of the positioning rib according to the characteristic points.
[0044] Optionally, the determining the parameters of the positioning rib cross-section of the corresponding buckle structure according to the midpoint of the positioning rib includes:
[0045] Determine a second direction vector based on the covering point;
[0046] Taking the midpoint of the positioning rib as the origin, respectively set a plurality of positioning rib cross-section auxiliary rays according to the preset direction and the direction corresponding to the second direction vector;
[0047] Obtain the multiple intersection points of the positioning rib cross-section auxiliary rays and the buckle structure in the preset direction and the direction corresponding to the second direction vector;
[0048] Calculate the corresponding distance value and angle value of the positioning rib cross-section of the corresponding buckle structure according to the positions of the respective intersection points, and use the distance value and the angle value as the parameters of the positioning rib cross-section.
[0049] Optionally, the method for determining the parameters of the buckle matching cross-section of the corresponding buckle structure according to the covering point and the midpoint of the hole includes:
[0050] Set an auxiliary ray of the buckle matching cross-section in the preset direction with the covering point as the origin;
[0051] Obtain the multiple intersection points of the auxiliary ray in the preset direction and the buckle structure;
[0052] Calculate the first distance value of the buckle matching cross-section of the corresponding buckle structure according to the positions of the respective intersection points;
[0053] Determine a second direction vector corresponding to the buckle structure according to the covering point;
[0054] Set an auxiliary ray of the buckle matching cross-section in the direction corresponding to the second direction vector with the midpoint of the hole as the origin;
[0055] Obtain the intersection point of the auxiliary ray in the direction corresponding to the second direction vector and the buckle structure;
[0056] Determine the first plane where the intersection point is located, and translate the first plane to obtain a second plane;
[0057] Determine the reference point on the claw of the buckle structure that is closest to the second plane;
[0058] Obtain the second distance value between the reference point and the first plane, and use the first distance value and the second distance value as the parameters of the buckle matching cross-section.
[0059] Optionally, the component to be recognized includes a plurality of buckle structures;
[0060] The detection method of the buckle structure further includes:
[0061] Determine the midpoint of the hole according to the covering point, and use the midpoint of the hole as the positioning point of each buckle structure;
[0062] Determine the spacing of each buckle structure in the Y-axis direction based on the positioning point;
[0063] Filter out adjacent buckle structures on the component to be identified according to the spacing;
[0064] Obtain the spacing between each adjacent buckle structure.
[0065] In addition, to achieve the above object, the present invention also provides a detection device for a buckle structure, the buckle structure is composed of a hole feature component and a claw feature component, and the detection device for the buckle structure includes:
[0066] An acquisition module, configured to acquire the three-dimensional digital model of the component to be identified;
[0067] A processing module, configured to perform image processing on the three-dimensional digital model in a preset direction to obtain the minimum circumscribed rectangle corresponding to each hole feature on the three-dimensional digital model;
[0068] A calculation module, configured to determine a covering point on the hole feature component according to the minimum circumscribed rectangle, the covering point being at least a pair of points on the hole feature component on one opposite side of the minimum circumscribed rectangle, and each pair of the covering points being centrosymmetric with respect to the center of the minimum circumscribed rectangle;
[0069] An identification module, configured to determine whether there is a buckle structure on the component to be identified according to the covering point and the three-dimensional digital model.
[0070] In addition, to achieve the above object, the present invention also provides a detection device for a buckle structure, the detection device for the buckle structure includes: a memory, a processor, and a detection program for the buckle structure stored on the memory and running on the processor, and the detection program for the buckle structure is configured to implement the detection method for the buckle structure as described above.
[0071] In addition, to achieve the above object, the present invention also provides a storage medium, on which a detection program for a buckle structure is stored, and when the detection program for the buckle structure is executed by a processor, it implements the detection method for the buckle structure as described above.
[0072] The present invention obtains a three-dimensional digital model of a component to be recognized; performs image processing on the three-dimensional digital model in a preset direction to obtain a minimum circumscribed rectangle corresponding to each hole feature on the three-dimensional digital model; determines covering points on the hole feature component according to the minimum circumscribed rectangle, where the covering points are at least a pair of points on the hole feature component on one opposite side of the minimum circumscribed rectangle, and each pair of the covering points is centrosymmetric with respect to the center of the minimum circumscribed rectangle; and determines whether there is a snap structure on the component to be recognized according to the covering points and the three-dimensional digital model, which improves the recognition accuracy and efficiency of the snap structure, and at the same time improves the efficiency by means of automatic measurement. Description of the Drawings
[0073] Figure 1 is a schematic structural diagram of a detection device for a snap structure in a hardware operating environment related to the solution of an embodiment of the present invention;
[0074] Figure 2 is a schematic flowchart of the first embodiment of the detection method for the snap structure of the present invention;
[0075] Figure 3 is a schematic overall flowchart of an embodiment of the detection method for the snap structure of the present invention;
[0076] Figure 4 is a schematic flowchart of the second embodiment of the detection method for the snap structure of the present invention;
[0077] Figure 5 is a schematic diagram of the calculation process of the midpoint and rotation angle of a rectangle in an embodiment of the detection method for the snap structure of the present invention;
[0078] Figure 6 is a schematic diagram of the calculation process of reference covering points in an embodiment of the detection method for the snap structure of the present invention;
[0079] Figure 7 is a schematic diagram of the calculation process of reference direction positioning points in an embodiment of the detection method for the snap structure of the present invention;
[0080] Figure 8 is a schematic diagram of the process of determining covering points in an embodiment of the detection method for the snap structure of the present invention;
[0081] Figure 9 is a schematic diagram of the process of determining direction positioning points in an embodiment of the detection method for the snap structure of the present invention;
[0082] Figure 10 is a schematic diagram of the recognition process of positioning ribs of the first type of snap structure in an embodiment of the detection method for the snap structure of the present invention;
[0083] Figure 11 is a schematic diagram of the recognition process of positioning ribs of the second type of snap structure in an embodiment of the detection method for the snap structure of the present invention;
[0084] Figure 12 Schematic diagram of the detection process of the third type of buckle structure in an embodiment of the detection method of the buckle structure of the present invention;
[0085] Figure 13 Schematic flow diagram of the third embodiment of the detection method of the buckle structure of the present invention;
[0086] Figure 14 Schematic diagram of the calculation process of the midpoint of the positioning rib of the first type of buckle structure in an embodiment of the detection method of the buckle structure of the present invention;
[0087] Figure 15 Schematic diagram of the calculation process of the midpoint of the positioning rib of the second type of buckle structure in an embodiment of the detection method of the buckle structure of the present invention;
[0088] Figure 16 Schematic diagram of the parameter identification process of the cross-section of the positioning rib of the first type of buckle structure in an embodiment of the detection method of the buckle structure of the present invention;
[0089] Figure 17 Schematic diagram of the parameter identification process of the cross-section of the positioning rib of the second type of buckle structure in an embodiment of the detection method of the buckle structure of the present invention;
[0090] Figure 18 Schematic diagram of the calculation process of the first distance value of the buckle mating cross-section in an embodiment of the detection method of the buckle structure of the present invention;
[0091] Figure 19 Schematic diagram of the calculation process of the second distance value of the buckle mating cross-section in an embodiment of the detection method of the buckle structure of the present invention;
[0092] Figure 20 Block diagram of the structure of the first embodiment of the detection device of the buckle structure of the present invention.
[0093] The realization, functional characteristics and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. Detailed Embodiments
[0094] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0095] Refer to Figure 1 , Figure 1 Schematic diagram of the structure of the detection device of the buckle structure in the hardware operating environment related to the solution of the embodiment of the present invention.
[0096] As Figure 1As shown, the detection device for the buckle structure may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard. Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed Random Access Memory (RAM) or a stable Non-Volatile Memory (NVM), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0097] Those skilled in the art can understand that Figure 1 the structure shown in does not constitute a limitation on the detection device for the buckle structure, and may include more or fewer components than shown, or combine some components, or have different component arrangements.
[0098] As Figure 1 shown, the memory 1005, as a storage medium, may include an operating system, a network communication module, a user interface module, and a detection program for the buckle structure.
[0099] In Figure 1 the detection device for the buckle structure shown, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the detection device for the buckle structure of the present invention may be provided in the detection device for the buckle structure. The detection device for the buckle structure calls the detection program for the buckle structure stored in the memory 1005 through the processor 1001 and executes the detection method for the buckle structure provided in the embodiments of the present invention.
[0100] The embodiments of the present invention provide a detection method for a buckle structure. Referring to Figure 2 , Figure 2 is a schematic flowchart of the first embodiment of a detection method for a buckle structure of the present invention.
[0101] In this embodiment, the detection method for the buckle structure includes the following steps:
[0102] Step S10: Obtain the three-dimensional digital model of the component to be recognized.
[0103] In this embodiment, the execution subject of this embodiment can be the detection device of the buckle structure. The detection device of the buckle structure has functions such as data processing, data communication, and program operation. The detection device of the buckle structure can be a computer device such as a tablet, a computer, or a server. Of course, it can also be other devices with similar functions, and this embodiment does not limit this. For the convenience of description, this embodiment is described by taking the detection device of the buckle structure as an example.
[0104] It should be noted that in order to ensure the assembly matching and workability, it is necessary to detect the buckle structure. At present, the manual method is selected for the detection of the buckle structure. However, in actual situations, due to the large number of buckles and parameters to be measured, the manual operation method has high repeatability and long time consumption, low efficiency, and is also prone to misdetection and missed detection.
[0105] In this embodiment, to solve the above technical problems, the three-dimensional digital model is converted into a two-dimensional image, the two-dimensional image of the part is processed, the key positioning points of all hole features are identified, various buckle structure types are identified through ray analysis, the feature auxiliary points required for parameter measurement are identified by ray analysis, and then the parameters of the buckle structure are automatically measured based on these feature auxiliary points, improving the recognition accuracy and efficiency of the buckle. At the same time, the efficiency is greatly improved by means of automatic measurement. Specifically, in this embodiment, Figure 3 is taken as an example to illustrate the overall process of this embodiment.
[0106] Such as Figure 3As shown, the main processes in this embodiment include image processing, image recognition, and ray analysis. Among them, image processing includes 3D data, image generation, and image processing. The 3D data is the three-dimensional model data of the buckle structure obtained. Image generation is to generate an image of the hole feature part in the vehicle direction through NX. In this embodiment, the vehicle direction is the direction opposite to the vehicle's forward movement, that is, the direction from the front of the vehicle to the rear of the vehicle. The image processing process includes, but is not limited to, grayscale conversion and binarization. Image recognition includes recognition and buckle judgment. Among them, the buckle judgment is whether there is a buckle structure. For example, if any ray captures a non-hole feature part, it is judged that there is a buckle structure at that place, otherwise it is judged that there is no buckle structure at that place. Image recognition is to obtain the midpoint and rotation angle of the two-dimensional image of the buckle structure. Ray analysis mainly includes positioning rib recognition, buckle type recognition, and parameter recognition. Positioning rib recognition is used to recognize the positioning ribs of the buckle structure. The positioning ribs corresponding to different types of buckle structures can also determine the type of the buckle structure through positioning rib recognition. Buckle type recognition is used to further determine the specific type of the buckle structure on the basis of positioning rib recognition. Parameter recognition is to recognize the parameters required to measure the cross-section of the positioning rib and the buckle mating cross-section of each buckle structure. After completing parameter recognition, automatic measurement can be carried out. Using ray analysis to identify the feature auxiliary points required for parameter measurement, and then automatically measuring the parameters of the buckle structure based on these feature auxiliary points, improves the recognition accuracy and efficiency of the buckle, and at the same time greatly improves the efficiency by means of automatic measurement.
[0107] In specific implementation, in this embodiment, it is necessary to first obtain the three-dimensional digital model of the component to be recognized. In this embodiment, the three-dimensional digital model of the component to be recognized can also be obtained through NX in a preset direction. This embodiment includes, but is not limited to, the component to be recognized, and there is no limitation on this. Among them, the preset direction is the direction opposite to the vehicle's forward movement. The three-dimensional digital model can clearly show the specific openings of each buckle structure. The buckle structure is composed of a hole feature component and a claw feature component.
[0108] Step S20: Perform image processing on the three-dimensional digital model in accordance with the preset direction to obtain the minimum circumscribed rectangle corresponding to each hole feature on the three-dimensional digital model.
[0109] In specific implementation, after obtaining the three-dimensional digital model, in this embodiment, the three-dimensional digital model will be converted into a two-dimensional image in accordance with the above-mentioned preset direction. Specifically, the image processing process includes reading and converting the image into a grayscale format, binarizing the grayscale image, and finally detecting the contour of the opening corresponding to each buckle structure, so as to obtain the minimum circumscribed rectangle corresponding to each hole feature on the three-dimensional digital model.
[0110] Step S30: Determine the covering points on the hole feature component according to the minimum circumscribed rectangle.
[0111] In a specific implementation, after obtaining the minimum bounding rectangle, in this embodiment, covering points can be determined on the hole feature component according to the minimum bounding rectangle. Specifically, the midpoint and the rotation angle can be determined based on the minimum bounding rectangle. The midpoint is also the midpoint of the minimum bounding rectangle, and the rotation angle is the angle between the minimum bounding rectangle after rectification and the minimum bounding rectangle before rectification. It should be noted that in this embodiment, the long side of the minimum bounding rectangle after rectification is parallel to the X-axis and / or the short side is parallel to the Y-axis. Among them, the covering points are at least a pair of points on the hole feature component on one side of a relative side of the minimum bounding rectangle, and each pair of the covering points is centrosymmetric with respect to the center of the minimum bounding rectangle. It should be further emphasized that the above-mentioned rotation process is only involved when the preset direction is not consistent with the horizontal and vertical directions.
[0112] Step S40: Determine whether there is a snap structure on the component to be recognized according to the covering points and the 3D digital model.
[0113] In a specific implementation, after obtaining the covering points and the 3D digital model, it can be determined whether there is a snap structure on the component to be recognized according to the covering points and the 3D digital model. The specific process is to set a straight line or a ray at the covering points in accordance with the preset direction, and determine whether the straight line or the ray has an intersection with the 3D digital model. When there is an intersection, it is determined that there is a snap structure on the component to be recognized.
[0114] Furthermore, in this embodiment, direction positioning points can also be determined on the hole feature component according to the minimum bounding rectangle. Among them, the direction positioning points are at least a pair of points on at least the hole feature component on the same side of one side of the minimum bounding rectangle, and each pair of the covering points is centrosymmetric with respect to the center of the minimum bounding rectangle. After determining that there is a snap structure in the component to be recognized, the type of the snap structure is further determined according to the covering points, the direction positioning points, and the 3D digital model data.
[0115] Furthermore, it should be noted that there are multiple snap structures on the component to be recognized. Based on the parameters of each snap structure, the spacing between the snap structures on the component to be recognized can be determined. The specific implementation can be as follows.
[0116] In a specific implementation, in this embodiment, the hole midpoint is determined according to the covering points, and the hole midpoint is used as the positioning point of each snap structure. Then, based on the positioning point, the spacing between each snap structure in the Y-axis direction is determined. If the spacing is greater than the preset spacing, it is determined that these two snap structures are non-adjacent snap structures, and the adjacent snap structures on the component to be recognized are screened out according to the spacing. Otherwise, they are adjacent snap structures. In this embodiment, the spacing between each adjacent snap structure will be automatically measured.
[0117] In this embodiment, a three-dimensional digital model of a component to be recognized is obtained; image processing is performed on the three-dimensional digital model in a preset direction to obtain the minimum circumscribed rectangle corresponding to each hole feature on the three-dimensional digital model; coverage points are determined on the hole feature component according to the minimum circumscribed rectangle, where the coverage points are at least a pair of points on the hole feature component on one side of a relative side of the minimum circumscribed rectangle, and each pair of the coverage points is centrosymmetric with respect to the center of the minimum circumscribed rectangle; whether a buckle structure exists on the component to be recognized is judged according to the coverage points and the three-dimensional digital model, which improves the recognition accuracy and efficiency of the buckle structure, and at the same time improves the efficiency by means of automatic measurement.
[0118] Reference Figure 4 , Figure 4 is a schematic flowchart of the second embodiment of a method for detecting a buckle structure according to the present invention.
[0119] Based on the above first embodiment, in the method for detecting a buckle structure in this embodiment, the step S30 specifically includes:
[0120] Step S301: Determine the rectangular center point of the minimum circumscribed rectangle according to the vertices of the minimum circumscribed rectangle.
[0121] In a specific implementation, after determining the minimum circumscribed rectangle, the rectangular center point of the minimum circumscribed rectangle can be determined in this embodiment. The rectangular center point can be determined based on the four vertices corresponding to the minimum circumscribed rectangle. Specifically, in this embodiment, Figure 5 is taken as an example for illustration. Figure 5 d1, d2, d3, and d4 shown in Figure 5 are the four vertices of the minimum circumscribed rectangle, and the rectangular center point O of the minimum circumscribed rectangle can be determined based on these four vertices. In addition,
[0122] L shown in
[0123] is the long side of the minimum circumscribed rectangle, and W is the short side of the minimum circumscribed rectangle. Figure 5 The minimum circumscribed rectangle is rectified with the rectangular center point as a reference, so that the long side of the minimum circumscribed rectangle is parallel to the X-axis of the preset coordinate system and / or the short side is parallel to the Y-axis of the preset coordinate system.
[0124] Step S303: Determine the rotation angle based on the rotated minimum bounding rectangle.
[0125] In a specific implementation, there will be an angular difference between the minimum bounding rectangle after rectification and the minimum bounding rectangle before rectification. For example, Figure 5 the included angle deg between the long sides of the minimum bounding rectangle before rectification and the minimum bounding rectangle after rectification shown in
[0126] is the rotation angle in this embodiment, which is also the rotation angle in this embodiment.
[0127] In a specific implementation, in order to improve the recognition accuracy in this embodiment, the midpoint O of the minimum bounding rectangle is used for secondary recognition, and the view is locally enlarged. The secondary recognition steps include: Secondary recognition steps: Convert the two-dimensional coordinates m of the center point of each contour obtained by the primary recognition into three-dimensional coordinates n, and the depth Z value is 0; In NX, use each n as the view center, locally enlarge the view, and output the current view image; Perform image processing on each output view image. Then, further determine the coverage point and the direction positioning point according to the rectangle midpoint and the rotation angle.
[0128] In a specific implementation, specifically referring to the calculation process of the coverage point is as Figure 6 shown. In Figure 6 R1 and R2 shown in Figure 7 are reference coverage points, and their coordinates can be calculated according to the coordinates of the rectangle midpoint and the rotation angle. For example, nx = ((mx - cx) * cos(deg) - (my - cy) * sin(-deg)) + cx; ny = ((mx - cx) * sin(-deg) + (my - cy) * cos(deg)) + cy; where, (mx, my) are the coordinates of the reference coverage point in the rectified state, mx = cx; my = cy - W / 2 - W / 30, W is the short side of the minimum bounding rectangle, (cx, cy) are the coordinates of the rectangle midpoint, deg is the rotation angle, and (nx, ny) are the coordinates of the reference coverage point in the actual state. Specifically referring to the calculation process of the direction positioning point is as
[0129] Figure 7 n1 and n2 shown in
[0130] (mx - cx)*sin(-deg)+(my - cy)*cos(deg)) + cy, where (mx, my) are the coordinates of the reference direction positioning point in the straightening state, mx = cx – L / 4, my = cy – W / 2 - W / 30, W is the short side of the minimum circumscribed rectangle, L is the long side of the minimum circumscribed rectangle, (cx, cy) are the coordinates of the midpoint of the rectangle, deg is the rotation angle, and (nx, ny) are the coordinates of the reference direction positioning point in the actual state.
[0131] Further, after obtaining the reference direction positioning point and the reference coverage point, in this embodiment, a positioning ray is set with the reference direction positioning point as the origin in a preset direction, and the intersection point of the positioning ray and the component to be recognized is used as the direction positioning point. Also, a jaw ray is set with the reference coverage point as the origin in a preset direction, and the intersection point of the jaw ray and the component to be recognized is used as the coverage point. The specific process is as Figure 8 and Figure 9 shown. Figure 8 and Figure 9 What is shown in is the bumper surface, where Figure 8 n1 and n2 shown in are the reference direction positioning points, and the intersection points m1 and m2 of the positioning ray and the bumper surface are the direction positioning points. Figure 9 R1 and R2 shown in are the reference coverage points, and the intersection points S1 and S2 of the jaw ray and the bumper surface are the coverage points.
[0132] Further, in this embodiment, after determining that the component to be recognized has a snap structure, the corresponding snap structure type can be further recognized according to the coverage point and the direction positioning point. Specifically, in this embodiment, the hole midpoint is first determined according to the coverage point, and the first direction vector is determined according to the direction positioning point. This first direction vector can be the first direction vector corresponding to the snap structure. Then, a feature ray is set in the direction corresponding to the first direction vector with the hole midpoint as the reference point. Finally, the feature points corresponding to the positioning rib are recognized according to the feature ray, so as to recognize the type of the snap structure. In this embodiment, Figures 10 to 12 is taken as an example to illustrate the recognition process of the snap structure type.
[0133] In the specific implementation, the hole midpoint S = (S1 + S2) / 2, where S1 and S2 are the coverage points. The first direction vector includes vec1 and vec2, vec1 = m2 - m1, vec2 = m1 - m2, where m1 and m2 are the direction positioning points. The snap structure in this embodiment includes two cases: with a positioning rib and without a positioning rib. When the snap structure has a positioning rib, as Figure 10 and Figure 11 shown. Figure 10 In, S is the hole midpoint, and A, B, C, and D are the feature points corresponding to the positioning rib recognized according to the feature ray. Figure 11As shown in [reference], S is the midpoint of the hole, and A', B', C', and D' are the characteristic points corresponding to the positioning ribs identified based on the characteristic rays. Based on Figure 10 It can be seen that all the characteristic points are on the hole characteristic component, and the type of this bayonet structure is the first type. Based on Figure 11 It can be seen that all the characteristic points are on the claw characteristic component, and the type of this bayonet structure is the second type. Figure 12 The bayonet structure shown in [reference] has no positioning rib, and based on the above method, it is impossible to find the characteristic points that are all on the hole characteristic component or all on the claw characteristic component. The type of this bayonet structure is the third type.
[0134] In this embodiment, the rectangular center point of the minimum circumscribed rectangle is determined according to the vertices of the minimum circumscribed rectangle; the minimum circumscribed rectangle is rectified based on the rectangular center point, so that the long side of the minimum circumscribed rectangle is parallel to the X-axis of the preset coordinate system and / or the short side is parallel to the Y-axis of the preset coordinate system; the rotation angle is determined based on the rotated minimum circumscribed rectangle; the covering point and the direction positioning point are determined according to the rectangular center point and the rotation angle. By setting the ray and combining the reference covering point and the reference direction positioning point, more accurate covering points and direction positioning points on the actual bayonet structure can be obtained. At the same time, based on the covering point and the direction positioning point, the type of the bayonet structure can also be more accurately identified, further improving the measurement accuracy.
[0135] Reference Figure 13 , Figure 13 is a schematic flowchart of the third embodiment of a method for detecting a bayonet structure according to the present invention.
[0136] Based on the above first embodiment, the third embodiment of a method for detecting a bayonet structure according to the present invention is proposed. In this embodiment, after step S40, the following steps are further included:
[0137] Step S501: When the type of the bayonet structure is the first type or the second type, it is determined that the corresponding bayonet structure has a positioning rib, and the midpoint of the positioning rib is obtained according to the covering point.
[0138] It should be noted that before measuring the parameters of the bayonet structure, in this embodiment, it is necessary to first determine whether the bayonet structure has a positioning rib based on the type of the bayonet structure. Whether there is a positioning rib will affect the final obtained parameters of the bayonet structure. The bayonet structures of the first type or the second type in this embodiment have positioning ribs. In this case, in this embodiment, the midpoint of the positioning rib will be determined first according to the covering point. The specific process includes determining the claw auxiliary reference point according to the covering point, determining the first direction vector corresponding to the bayonet structure according to the direction positioning point, setting the characteristic ray in the direction corresponding to the first direction vector with the claw auxiliary reference point as the origin, obtaining the characteristic points corresponding to the positioning rib within the long side range of the hole based on the characteristic ray, and determining the midpoint of the positioning rib according to the characteristic points. In this embodiment, Figure 14 andFigure 15 For example, it will be described below.
[0139] In a specific implementation, Figure 14 As shown, it is a positioning rib structure of the first type, where A1 is the auxiliary reference point of the claw, ray1 and ray2 are the rays in the directions corresponding to the first direction vector respectively. Based on ray1 and ray2, the characteristic points t1 and t2 corresponding to the positioning rib can be obtained, and L, W, and H are the side lengths of the buckle structure. Assuming the covering points are S1(x1, y1, z1) and S2(x2, y2, z2), and A1 is (xa1, ya1, za1), then xa1 = (x1 + x2) / 2, ya1 = (y1 + y2) / 2 - H / 4, za1 = (z1 + z2) / 2 + 1. Figure 15 As shown, it is a positioning rib structure of the first type, where A2 is the auxiliary reference point of the claw, ray1 and ray2 are the rays in the directions corresponding to the first direction vector respectively. Based on ray1 and ray2, the characteristic points t3 and t4 corresponding to the positioning rib can be obtained. Assuming the covering points are S1(x1, y1, z1) and S2(x2, y2, z2), and A1 is (xa2, ya2, za2), then xa2 = (x1 + x2) / 2, ya2 = (y1 + y2) / 2 - H / 4, za2 = (z1 + z2) / 2 + 1.
[0140] Step S502: Determine the midpoint of the hole according to the covering points.
[0141] Step S503: Determine the parameters of the positioning rib cross-section of the corresponding buckle structure according to the midpoint of the positioning rib.
[0142] It should be noted that in this embodiment, when the buckle structure is of the first type or the second type, the parameters of the positioning rib cross-section of the corresponding buckle structure can be determined according to the midpoint of the positioning rib. The specific process includes determining the second direction vector corresponding to the buckle structure according to the covering points, setting a plurality of positioning rib cross-section auxiliary rays at the midpoint of the positioning rib as the origin according to the preset direction and the direction corresponding to the second direction vector, obtaining the intersections of the positioning rib cross-section auxiliary rays with the buckle structure in the preset direction and the direction corresponding to the second direction vector, calculating the distance values and angle values corresponding to the positioning rib cross-section of the corresponding buckle structure according to the positions of the intersections, and taking the distance values and angle values as the parameters of the positioning rib cross-section. In this embodiment, Figure 16 and Figure 17 For example, it will be described below. Figure 16 The following is the process of measuring the parameters of the positioning rib cross-section of the buckle structure of the first type. Figure 16 In the following, t1 is the midpoint of the positioning rib, ray3 and ray5 are the positioning rib cross-section auxiliary rays set according to the preset direction and the direction corresponding to the second direction vector, and the intersections with the buckle structure are Figure 16As shown in [0], for e1, e2, f1, f2, and k1, draw ray ray3 from the midpoint t1 of the positioning rib to obtain points f1 and f2, with a distance of F; obtain points e1 and e2, with a distance of E; draw ray ray5 from the midpoint of the positioning rib to obtain point k1, calculate the value of K using the normal vector of the plane where k1 is located. According to e1, e2, f1, f2, and k1, the distance values E and F and the angle value K can be obtained, which are also the parameters of the cross-section of the positioning rib. Figure 17 The process in [0] for measuring the parameters of the cross-section of the positioning rib of the second type of buckle structure Figure 17 In [0], t3 is the midpoint of the positioning rib, and ray3, ray4, and ray5 are the auxiliary rays of the cross-section of the positioning rib set according to the preset direction and the direction corresponding to the second direction vector, and the multiple intersection points with the buckle structure are Figure 16 As shown in [0], for e1, e2, f1, f2, and k1, draw rays ray3 and ray4 from the midpoint t3 of the positioning rib to obtain points f1 and f2, with a distance of F, draw ray ray4 from the midpoint t3 of the positioning rib to obtain points e1 and e2, with a distance of E,
[0143] Draw ray ray5 from the midpoint t3 of the positioning rib to obtain point k1, calculate the value of K using the normal vector of the plane where k1 is located. According to e1, e2, f1, f2, and k1, the distance values E and F and the angle value K can be obtained, which are also the parameters of the cross-section of the positioning rib.
[0144] Step S504: Determine the parameters of the buckle mating cross-section of the corresponding buckle structure according to the covering point and the midpoint of the hole.
[0145] It should be noted that for the parameters of the buckle mating cross-section, in this embodiment, a general algorithm is adopted for three types of buckle structures. The specific process includes setting the auxiliary ray of the buckle mating cross-section in the preset direction with the covering point as the origin; obtaining the multiple intersection points of the auxiliary ray in the preset direction and the buckle structure; calculating the first distance value of the buckle mating cross-section of the corresponding buckle structure according to the positions of the respective intersection points; determining the second direction vector corresponding to the buckle structure according to the covering point; setting the auxiliary ray of the buckle mating cross-section in the direction corresponding to the second direction vector with the midpoint of the hole as the origin; obtaining the intersection point of the auxiliary ray in the direction corresponding to the second direction vector and the buckle structure; determining the first plane where the intersection point is located, and translating the first plane to obtain the second plane; determining the reference point on the claw of the buckle structure that is closest to the second plane; obtaining the second distance value between the reference point and the first plane, and taking the first distance value and the second distance value as the parameters of the buckle mating cross-section. In this embodiment, in combination with Figure 18 and Figure 19 This process is described. Figure 18The ray5 is an auxiliary ray of the snap-fit section set with the covering point as the origin in the preset direction. The multiple intersection points of the auxiliary ray in the preset direction and the snap structure are l1 and l2, and the distance value L can be calculated from l1 and l2. Further, as Figure 19 shown, Figure 19 in, the ray3 is an auxiliary ray of the snap-fit section set with the midpoint of the hole as the origin in the direction corresponding to the second direction vector. The intersection point of the auxiliary ray in the direction corresponding to the second direction vector and the snap structure is m1, and its corresponding first plane is P1. The first plane P1 is translated to obtain the second plane P2. The reference point on the claw of the snap structure closest to the second plane is m2, and the second distance value M between the reference point m2 and the first plane P1 is Figure 18 and Figure 19 The L and M shown in are the parameters of the snap-fit section.
[0146] In this embodiment, when the type of the snap structure is the first type or the second type, it is determined that there is a positioning rib in the corresponding snap structure, and the midpoint of the positioning rib is obtained according to the covering point; the midpoint of the hole is determined according to the covering point; the parameters of the positioning rib section of the corresponding snap structure are determined according to the midpoint of the positioning rib; the parameters of the snap-fit section of the corresponding snap structure are determined according to the covering point and the midpoint of the hole. By adopting corresponding parameter measurement methods for different types of snap structures, more accurate snap structure parameters can be obtained.
[0147] In addition, an embodiment of the present invention also provides a storage medium, on which a detection program for the snap structure is stored. When the detection program for the snap structure is executed by a processor, the steps of the detection method for the snap structure as described above are implemented.
[0148] Since this storage medium adopts all the technical solutions of the above-mentioned all embodiments, it has at least all the beneficial effects brought by the technical solutions of the above-mentioned embodiments, and will not be elaborated here one by one.
[0149] Referring to Figure 20 , Figure 20 is the structural block diagram of the first embodiment of the detection device for the snap structure of the present invention.
[0150] As Figure 20 shown, the detection device for the snap structure proposed by the embodiment of the present invention includes:
[0151] An acquisition module 10, configured to acquire the three-dimensional digital model of the component to be recognized.
[0152] A processing module 20, configured to perform image processing on the three-dimensional digital model in a preset direction to obtain the minimum circumscribed rectangle corresponding to each hole feature on the three-dimensional digital model.
[0153] The calculation module 30 is configured to determine covering points on the hole feature component according to the minimum circumscribed rectangle, where the covering points are at least a pair of points on the hole feature component on one opposite side of the minimum circumscribed rectangle, and each pair of the covering points is centrosymmetric with respect to the center of the minimum circumscribed rectangle.
[0154] The recognition module 40 is configured to determine whether there is a buckle structure on the component to be recognized according to the covering points and the three-dimensional digital model.
[0155] In this embodiment, by obtaining the three-dimensional digital model of the component to be recognized; performing image processing on the three-dimensional digital model in a preset direction to obtain the minimum circumscribed rectangle corresponding to each hole feature on the three-dimensional digital model; determining covering points on the hole feature component according to the minimum circumscribed rectangle, where the covering points are at least a pair of points on the hole feature component on one opposite side of the minimum circumscribed rectangle, and each pair of the covering points is centrosymmetric with respect to the center of the minimum circumscribed rectangle; determining whether there is a buckle structure on the component to be recognized according to the covering points and the three-dimensional digital model, the recognition accuracy and efficiency of the buckle structure are improved, and the efficiency is also improved by means of automatic measurement.
[0156] In one embodiment, the recognition module 40 is further configured to set a straight line or a ray on the covering points in the preset direction, and determine whether the straight line or the ray intersects with the three-dimensional digital model. When there is an intersection, that is, the straight line or the ray passes through the non-hole feature of the digital model data, it is determined that there is a buckle structure on the component to be recognized.
[0157] In one embodiment, the calculation module 30 is further configured to determine direction positioning points on the hole feature component according to the minimum circumscribed rectangle, where the direction positioning points are at least a pair of points on at least the hole feature component on the same side of one side of the minimum circumscribed rectangle, and each pair of the covering points is centrosymmetric with respect to the center of the minimum circumscribed rectangle; determine the type of the buckle structure according to the covering points, the direction positioning points, and the three-dimensional digital model data.
[0158] In one embodiment, the calculation module 30 is further configured to determine the rectangular center point of the minimum circumscribed rectangle according to the vertices of the minimum circumscribed rectangle; straighten the minimum circumscribed rectangle based on the rectangular center point so that the long side of the minimum circumscribed rectangle is parallel to the X-axis of the preset coordinate system and / or the short side is parallel to the Y-axis of the preset coordinate system. The preset coordinate system is in the same plane as the minimum circumscribed rectangle, and the X-axis of the preset coordinate system is parallel to the horizontal direction and the Y-axis is perpendicular to the horizontal direction; determine the rotation angle based on the rotated minimum circumscribed rectangle; determine the covering points and the direction positioning points according to the rectangular center point and the rotation angle.
[0159] In one embodiment, the calculation module 30 is further configured to perform coordinate calculation based on the coordinates of the center point of the rectangle and the rotation angle to obtain a reference coverage point and a reference direction positioning point, where the reference coverage point is an auxiliary point corresponding to the coverage point, and the reference direction positioning point is an auxiliary point corresponding to the direction positioning point; set a positioning ray with the reference direction positioning point as the origin in the preset direction, and use the intersection point of the positioning ray and the component to be recognized as the direction positioning point; set a jaw ray with the reference coverage point as the origin in the preset direction, and use the intersection point of the jaw ray and the component to be recognized as the coverage point.
[0160] In one embodiment, when there is a buckle structure on the component to be recognized, the recognition module 40 is further configured to determine the midpoint of the hole according to the coverage point; determine a first direction vector according to the direction positioning point; set a feature ray in the direction corresponding to the first direction vector with the midpoint of the hole as the reference point; identify whether there is a positioning rib on the buckle structure corresponding to the component to be recognized through the feature ray; if it is recognized that there is a positioning rib on the buckle structure, identify the feature points corresponding to the positioning rib according to the feature ray; if all the feature points are on the hole feature component, determine that the buckle structure type is the first type; if all the feature points are on the jaw feature component, determine that the buckle structure type is the second type; if it is not recognized that there is a positioning rib on the buckle structure, determine that the buckle structure type is the third type.
[0161] In one embodiment, when the buckle structure type is the first type or the second type, the calculation module 30 is further configured to determine that there is a positioning rib on the corresponding buckle structure and obtain the midpoint of the positioning rib according to the coverage point; determine the midpoint of the hole according to the coverage point; determine the parameters of the positioning rib cross-section of the corresponding buckle structure according to the midpoint of the positioning rib; determine the parameters of the buckle mating cross-section of the corresponding buckle structure according to the coverage point and the midpoint of the hole.
[0162] In one embodiment, the calculation module 30 is further configured to determine a jaw auxiliary reference point according to the coverage point; determine a first direction vector corresponding to the buckle structure according to the direction positioning point; set a feature ray in the direction corresponding to the first direction vector with the jaw auxiliary reference point as the origin; obtain the feature points corresponding to the positioning rib within the long side range of the hole based on the feature ray; determine the midpoint of the positioning rib according to the feature points.
[0163] In one embodiment, the calculation module 30 is further configured to determine a second direction vector according to the covering point; set a plurality of auxiliary rays of the positioning rib cross-section at the origin of the midpoint of the positioning rib in the preset direction and the direction corresponding to the second direction vector; obtain a plurality of intersections of the auxiliary rays of the positioning rib cross-section with the buckle structure in the preset direction and the direction corresponding to the second direction vector; calculate the corresponding distance value and angle value of the positioning rib cross-section of the corresponding buckle structure according to the positions of the intersections, and use the distance value and the angle value as the parameters of the positioning rib cross-section.
[0164] In one embodiment, the calculation module 30 is further configured to set an auxiliary ray of the buckle fitting cross-section in the preset direction with the covering point as the origin; obtain a plurality of intersections of the auxiliary ray in the preset direction with the buckle structure; calculate a first distance value of the buckle fitting cross-section of the corresponding buckle structure according to the positions of the intersections; determine a second direction vector corresponding to the buckle structure according to the covering point; set an auxiliary ray of the buckle fitting cross-section in the direction corresponding to the second direction vector with the midpoint of the hole as the origin; obtain the intersection of the auxiliary ray in the direction corresponding to the second direction vector with the buckle structure; determine the first plane where the intersection is located, and translate the first plane to obtain a second plane; determine a reference point on the claw of the buckle structure that is closest to the second plane; obtain a second distance value between the reference point and the first plane, and use the first distance value and the second distance value as the parameters of the buckle fitting cross-section.
[0165] In one embodiment, the component to be recognized includes a plurality of buckle structures; the detection device of the buckle structure further includes a detection module;
[0166] The detection module is configured to determine the midpoint of the hole according to the covering point, and use the midpoint of the hole as the positioning point of each buckle structure; determine the spacing of each buckle structure in the Y-axis direction based on the positioning point; screen out adjacent buckle structures on the component to be recognized according to the spacing; obtain the spacing between each adjacent buckle structure.
[0167] It should be understood that the above is only an example for illustration, and does not constitute any limitation to the technical solution of the present invention. In specific applications, those skilled in the art can set according to needs, and the present invention does not limit this.
[0168] It should be noted that the above-described work process is only illustrative and does not limit the protection scope of the present invention. In actual applications, those skilled in the art can select some or all of them according to actual needs to achieve the purpose of the solution of this embodiment, and this is not limited here.
[0169] In addition, for the technical details not described in detail in this embodiment, reference may be made to the detection method of the buckle structure provided in any embodiment of the present invention, which will not be elaborated here.
[0170] In addition, it should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or system including that element.
[0171] The serial numbers of the above embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments.
[0172] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented through hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a read-only memory (ROM) / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0173] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. A detection method for a snap structure, the snap structure being composed of a hole feature component and a claw feature component, characterized in that The detection method of the buckle structure includes: Obtaining the three-dimensional digital model of the component to be recognized; Performing image processing on the three-dimensional digital model in a preset direction to obtain the minimum circumscribed rectangle corresponding to each hole feature on the three-dimensional digital model; Determining covering points on the hole feature component according to the minimum circumscribed rectangle, where the covering points are at least a pair of points on the hole feature component on one opposite side of the minimum circumscribed rectangle, and each pair of the covering points is centrosymmetric with respect to the center of the minimum circumscribed rectangle; Judging whether there is a buckle structure on the component to be recognized according to the covering points and the three-dimensional digital model; The specific method of judging whether there is a buckle structure on the component to be recognized according to the covering points and the three-dimensional digital model is: Setting a straight line or a ray at the covering points in the preset direction, and judging whether the straight line or the ray intersects with the three-dimensional digital model. When there is an intersection, it is judged that there is a buckle structure on the component to be recognized.
2. The detection method of the buckle structure according to claim 1, characterized in that The detection method of the buckle structure further includes: Determining direction positioning points on the hole feature component according to the minimum circumscribed rectangle, where the direction positioning points are at least a pair of points on at least the hole feature component on the same side of one side of the minimum circumscribed rectangle, and each pair of the covering points is centrosymmetric with respect to the center of the minimum circumscribed rectangle; Judging the type of the buckle structure according to the covering points, the direction positioning points and the three-dimensional digital model data.
3. The detection method of the buckle structure according to claim 2, characterized in that, The detection method of the buckle structure further includes: Determining the rectangular center point of the minimum circumscribed rectangle according to the vertices of the minimum circumscribed rectangle; Rectifying the minimum circumscribed rectangle based on the rectangular center point so that the long side of the minimum circumscribed rectangle is parallel to the X-axis of the preset coordinate system and / or the short side is parallel to the Y-axis of the preset coordinate system. The preset coordinate system is in the same plane as the minimum circumscribed rectangle, and the X-axis of the preset coordinate system is parallel to the horizontal direction and the Y-axis is perpendicular to the horizontal direction; Determining the rotation angle based on the rotated minimum circumscribed rectangle; Determining the covering points and the direction positioning points according to the rectangular center point and the rotation angle.
4. The detection method of the buckle structure according to claim 3, characterized in that, The determination of the covering points and the direction positioning points according to the rectangular center point and the rotation angle includes: Performing coordinate calculation according to the coordinates of the rectangular center point and the rotation angle to obtain the reference covering points and the reference direction positioning points. The reference covering points are the auxiliary points corresponding to the covering points, and the reference direction positioning points are the auxiliary points corresponding to the direction positioning points; Setting a positioning ray with the reference direction positioning point as the origin in the preset direction, and taking the intersection point of the positioning ray and the component to be recognized as the direction positioning point; Setting a claw ray with the reference covering point as the origin in the preset direction, and taking the intersection point of the claw ray and the component to be recognized as the covering point.
5. The detection method of the buckle structure according to claim 2, characterized in that, The detection method of the buckle structure further includes: When there is a buckle structure on the component to be recognized, determining the midpoint of the hole according to the covering points; Determining the first direction vector according to the direction positioning points; Setting a feature ray in the direction corresponding to the first direction vector with the midpoint of the hole as the reference point; Identifying whether there is a positioning rib on the buckle structure corresponding to the component to be recognized through the feature ray; If a positioning rib exists in the buckle structure, identify the feature points corresponding to the positioning rib according to the feature rays; If all the feature points are on the hole feature component, determine that the buckle structure type is the first type; If all the feature points are on the claw feature component, determine that the buckle structure type is the second type; If no positioning rib exists in the buckle structure is identified, determine that the buckle structure type is the third type.
6. The detection method of the buckle structure according to claim 5, characterized in that, The detection method of the buckle structure further includes: When the buckle structure type is the first type or the second type, determine that the corresponding buckle structure has a positioning rib, and obtain the midpoint of the positioning rib according to the covering points; Determine the midpoint of the hole according to the covering points; Determine the parameters of the positioning rib cross-section of the corresponding buckle structure according to the midpoint of the positioning rib; Determine the parameters of the buckle mating cross-section of the corresponding buckle structure according to the covering points and the midpoint of the hole.
7. The detection method of the buckle structure according to claim 6, characterized in that, The obtaining the midpoint of the positioning rib according to the covering points includes: Determine the claw auxiliary reference point according to the covering points; Determine the first direction vector corresponding to the buckle structure according to the direction positioning point; Set the feature ray in the direction corresponding to the first direction vector with the claw auxiliary reference point as the origin; Obtain the feature points corresponding to the positioning rib within the long side range of the hole based on the feature ray; Determine the midpoint of the positioning rib according to the feature points.
8. The detection method of the buckle structure according to claim 6, characterized in that The determining the parameters of the positioning rib cross-section of the corresponding buckle structure according to the midpoint of the positioning rib includes: Determine the second direction vector according to the covering points; Set a plurality of positioning rib cross-section auxiliary rays in the preset direction and the direction corresponding to the second direction vector with the midpoint of the positioning rib as the origin; Obtain the intersections of the positioning rib cross-section auxiliary rays with the buckle structure in the preset direction and the direction corresponding to the second direction vector; Calculate the distance value and the angle value corresponding to the positioning rib cross-section of the corresponding buckle structure according to the positions of the intersections, and use the distance value and the angle value as the parameters of the positioning rib cross-section.
9. The detection method of the buckle structure according to claim 6, characterized in that, The determining the parameters of the buckle mating cross-section of the corresponding buckle structure according to the covering points and the midpoint of the hole includes: Set the auxiliary ray of the buckle mating cross-section in the preset direction with the covering point as the origin; Obtain the intersections of the auxiliary ray in the preset direction with the buckle structure; Calculate the first distance value of the buckle mating cross-section of the corresponding buckle structure according to the positions of the intersections; Determine the second direction vector corresponding to the buckle structure according to the covering points; Set the auxiliary ray of the buckle mating cross-section in the direction corresponding to the second direction vector with the midpoint of the hole as the origin; Obtain the intersection of the auxiliary ray in the direction corresponding to the second direction vector with the buckle structure; Determine the first plane where the intersection is located, and translate the first plane to obtain the second plane; Determine the reference point on the claw of the buckle structure that is closest to the second plane; Obtain the second distance value between the reference point and the first plane, and use the first distance value and the second distance value as the parameters of the buckle mating cross-section.
10. The detection method of the buckle structure according to any one of claims 1 to 9, characterized in that The component to be identified includes a plurality of buckle structures; The detection method of the buckle structure further includes: Determine the midpoint of the hole based on the covering point, and use the midpoint of the hole as the positioning point of each buckle structure; Determine the spacing of each buckle structure in the Y-axis direction based on the positioning point; Filter out adjacent buckle structures on the component to be recognized according to the spacing; Obtain the spacing between each adjacent buckle structure.
11. A detection device for a snap structure, characterized in that The buckle structure is composed of a hole feature component and a claw feature component, and the detection device of the buckle structure includes: An acquisition module for acquiring the three-dimensional digital model of the component to be recognized; A processing module for performing image processing on the three-dimensional digital model in a preset direction to obtain the minimum circumscribed rectangle corresponding to each hole feature on the three-dimensional digital model; A calculation module for determining a covering point on the hole feature component according to the minimum circumscribed rectangle, where the covering point is at least a pair of points on the hole feature component on one side of a relative side of the minimum circumscribed rectangle, and each pair of the covering points is centrosymmetric with respect to the center of the minimum circumscribed rectangle; An identification module for judging whether there is a buckle structure on the component to be recognized according to the covering point and the three-dimensional digital model; The identification module is further configured to set a straight line or a ray at the covering point in the preset direction, and judge whether the straight line or the ray has an intersection with the three-dimensional digital model. When there is an intersection, it is judged that there is a buckle structure on the component to be recognized.
12. A detection device for a buckle structure, characterized in that, The detection device of the buckle structure includes: a memory, a processor, and a detection program of the buckle structure stored on the memory and running on the processor. The detection program of the buckle structure is configured to implement the detection method of the buckle structure according to any one of claims 1 to 10.
13. A storage medium, characterized in that, The detection program of the buckle structure is stored on the storage medium, and when the detection program of the buckle structure is executed by the processor, it implements the detection method of the buckle structure according to any one of claims 1 to 10.
Citation Information
Patent Citations
Vascular lesion recognition device and system, and storage medium
CN114612436A