Photographing viewpoint planning method for hub surface defect detection
By Gaussian mapping and partitioning of the hub surface, an effective set of photo viewpoints is generated, which solves the problem of viewpoint redundancy and occlusion in the detection of hub surface defects, improves detection efficiency and reliability, and accurately calculates defect sizes.
Patent Information
- Application Number
- CN202510069516.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-05-27
AI Technical Summary
In the detection of hub surface defects, the prior art is difficult to effectively solve the problems of complex characteristics of hub surface defects and time-consuming detection processes, especially when the types of hubs are diverse, manual teaching methods cannot be adapted, and there are viewpoint redundancy and occlusion problems in automated measurements.
Using the photography viewpoint planning method, the triangular facet model of the to detect the wheel hub is Gaussian mapped and partitioned, and independent areas are generated. By merging adjacent areas and constructing an OBB bounding box, the camera viewpoint is determined, and the occlusion viewpoint is detected and adjusted, and an effective photography viewpoint set is generated for the detection of the wheel hub surface defect.
It improves the working efficiency and reliability of the surface defect detection of hubs, reduces viewpoint redundancy and occlusion problems, ensures viewpoint coverage to the model, and can accurately calculate defect sizes, reducing the possibility of defect misjudgment.
Smart Images

Figure CN120044029A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of defect detection, and more specifically, the present invention relates to a photographing viewpoint planning method for detecting defects on the surface of a wheel hub. Background Art
[0002] As a load-bearing component of an automobile, the wheel hub is an important part of the automobile. Out of safety considerations, manufacturers have very strict requirements for the detection of the surface quality of the wheel hub to avoid subtle defects from damaging the safety of the product. However, the manufacturing process of the wheel hub is complicated, and in each process, the wheel hub may be damaged by machines and humans, which makes the defect characteristics on the surface of the wheel hub complex and poses a huge challenge to the detection of the surface quality of the wheel hub.
[0003] In recent years, with the rapid development of industrial manufacturing, industrial robots have been able to replace humans to perform repetitive and labor-intensive operations such as handling, spraying, and welding, and can replace humans to work in high-temperature, dangerous, and harmful working environments, and have been widely used in the field of industrial automation. Currently, in the fields of automated measurement and quality inspection, the manual teaching method is mostly used to generate viewpoints, and the detection process is very time-consuming. At the same time, the manual teaching method cannot adapt to the diverse characteristics of wheel hub types.
[0004] Application No. 2021104084735, Patent Name: Surface Structured Light Automated 3D Scanning Planning Method, uniformly samples the surface of the CAD model to generate a set of sampling points. This uniform sampling method will generate redundant viewpoints, resulting in an increase in the photographing time and thus reducing the work efficiency. Summary of the Invention
[0005] The present invention provides a photographing viewpoint planning method for detecting defects on the surface of a wheel hub, aiming to improve the above problems.
[0006] The present invention provides a photographing viewpoint planning method for detecting defects on the surface of a wheel hub, and the method is as follows:
[0007] (1) Perform Gaussian mapping on the triangular patches in the triangular patch model of the wheel hub to be detected to form Gaussian points on the Gaussian sphere.
[0008] (2) Divide the triangular patch model into several independent regions, and the included angle between the normal vectors corresponding to the Gaussian points within the independent regions is similar and topologically adjacent.
[0009] (3) Search for adjacent independent regions whose included angle with the average normal vector of each independent region is less than the camera field of view angle, and merge the found adjacent independent regions with the corresponding independent regions.
[0010] (4) Construct the OBB bounding box of each independent region, and determine the camera viewpoints surrounded by the camera visual cone model of the OBB bounding box.
[0011] (5) Detect the camera viewpoints with occlusion, adjust the poses of the occluded viewpoints, and obtain a set of camera photographing viewpoints for detecting surface defects of the hub to be measured.
[0012] Further, the formation process of the independent region is specifically as follows:
[0013] (21) Cluster the triangular patches in the triangular patch model based on the Gaussian points on the Gaussian sphere, and classify the triangular patches with similar normal vector angles into one category;
[0014] (22) Detect the connectivity between various triangular patches based on the triangular patch growth algorithm, and divide the connected triangular patches of the same category into the same independent region.
[0015] Further, the clustering process is specifically as follows:
[0016] (221) Set the number of classifications k, the maximum number of iterations n, and the movement threshold δ of the mass point position;
[0017] (222) Set the mass points c 1 , c 2 , c 3 , ……, c k ;
[0018] (223) Calculate the distances between each Gaussian point and each mass point, divide the Gaussian points into the category corresponding to the mass point ci with the minimum distance, and after all Gaussian points are divided, increment the iteration count by 1;
[0019] (224) Detect whether the current iteration count reaches the set maximum number of iterations. If the detection result is no, execute step (225);
[0020] (225) Update the mass points of each category;
[0021] (226) Calculate the position change amount between the mass points of each category before and after the update. If the position change amount is less than the set threshold δ, output the current clustering result; otherwise, return to step (233).
[0022] Further, the independent region division process based on triangular patch growth is specifically as follows:
[0023] (221) Select an unmarked triangular patch in the T i category as the seed patch, mark the triangular patch, and add the three vertices of the triangular patch as boundary points to the set A;
[0024] (222) In the T iFind the unmarked triangular patches in the class with boundary points as vertices, mark the triangular patches, and add the three vertices of the triangular patches as boundary points to set A;
[0025] (223) Calculate the number of triangular patches in set A. If the number of triangular patches increases, return to step (222). If the number of triangular patches does not increase, the triangular patches in set A form an independent region;
[0026] (224) Check whether there are unmarked triangular patches in class T i If there are, return to step (221). If not, complete the division of independent regions in class T i
[0027] Furthermore, the specific process of merging independent regions is as follows:
[0028] (31) Put all independent regions into the independent region set A, and extract the boundary edges of all independent regions;
[0029] (32) Randomly select an independent region A from the independent region set A i , and check whether there is an adjacent independent region that has a common boundary edge with the independent region Ai. If not, put the independent region A i into set B. If so, execute step (33);
[0030] (33) Calculate the angle between the average normal vector of the adjacent independent region and the average normal vector of the independent region A i , and check whether there is an adjacent independent region with an angle less than the camera field of view angle. If so, merge the adjacent independent region A j with the independent region A i , put the merged independent region A i into the new set B, and remove the adjacent independent region A j from the independent region set A, and execute step (32). If not, put the independent region A i into set B and execute step (32) until the independent region set A is empty. Each independent region in set B is the merged independent region.
[0031] Furthermore, the specific method for constructing the OBB bounding box of each independent region is as follows:
[0032] (41) Select an independent region B from set B i , and calculate the total area S of all triangular patches in the independent region B i ;
[0033] (42) Calculate the independent region Bi The area-weighted center point C i ;
[0034] (43)Construct the covariance matrix, perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and eigenvectors, use the three unitized eigenvectors as coordinate axes, and use the area-weighted center point C i as the coordinate origin to construct a new coordinate system, and obtain the transformation matrix T of the new coordinate system relative to the model coordinate system where the triangular patch model is located, and calculate the AABB bounding box of the independent region B i in the new coordinate system, and convert the AABB bounding box to the model coordinate system to obtain the position, attitude and size of the OBB bounding box;
[0035] (44)Delete the independent region B i from the set B, and execute step (41) until the set B is empty.
[0036] Furthermore, the covariance matrix is specifically as follows:
[0037]
[0038] In the formula,
[0039] Furthermore, the occlusion detection process of the camera viewpoint is specifically as follows:
[0040] Determine the ray op starting from the camera viewpoint o and passing through the centroid p of each triangular patch in the bounding box, and detect whether there is a ray that intersects with the triangular patches on the triangular patch model. If so, the corresponding camera viewpoint o is occluded.
[0041] Furthermore, the detection process of the ray that intersects with the triangular patches on the triangular patch model is specifically as follows:
[0042] (51)Construct the equation of the ray op: p(t) = t·P + (1 - t)·O, where P and O respectively represent the coordinates of the centroid p of the triangular patch and the viewpoint o in the model coordinate system, and t is the proportionality coefficient;
[0043] (52)Construct the equation of any point on the triangular patch: q(u, v) = u·a 1 + v·b 1 +(1 - u - v·c 1 , where a 1 , b 1 , c 1 represent the coordinates of the three vertices of the triangular patch where the centroid p is located in the model coordinate system, and u and v are the proportionality coefficients;
[0044] (53)Let t·P + (1 - t)·O = u·a 1+v·b 1 +(1 - u - v)·c 1 If there exist proportional coefficients t, u, and v such that the equation holds, it indicates that the line of sight corresponding to the ray op is blocked. If there do not exist proportional coefficients t, u, and v such that the equation holds, it indicates that the line of sight corresponding to the ray op is not blocked by the triangular patch.
[0045] Furthermore, the process of generating the shooting path of the robot where the camera is located is as follows:
[0046] Starting from the initial pose of the robot, search for the shortest path passing through all viewpoints by the greedy algorithm, and take the shortest path as the movement path of the robot during the detection of the surface defects of the hub to be measured.
[0047] The invention proposes a method for generating the viewpoint planning of a robot for a hub defect detection system, which realizes the automatic generation of the shooting viewpoints of the robot, greatly improves the working efficiency and reliability of the hub defect detection system, and promotes the industrial automation level in the hub defect detection system.
[0048] The present invention generates shooting viewpoints by partitioning the triangular patch model of the hub to be detected, reduces the viewpoint redundancy caused by uniform sampling or random sampling on the surface of the triangular patch model, and improves the efficiency of viewpoint generation; at the same time, aiming at the possible occlusion problems during the viewpoint generation process, a method of perspective rotation is given to avoid occlusion, improving the coverage rate of the viewpoints on the model; for the planned viewpoints, the distances from these viewpoints to the defect surface can be automatically obtained, so that the size of the defect can be calculated, greatly reducing the possibility of misjudgment of the defect caused by the change in the distance between the camera and the hub to be measured. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flowchart of the shooting viewpoint planning method for hub surface defect detection provided by an embodiment of the present invention;
[0050] Figure 2 It is a schematic diagram of Gaussian mapping provided by an embodiment of the present invention;
[0051] Figure 3 It is a schematic diagram of the camera visual cone model corresponding to the camera viewpoint provided by an embodiment of the present invention;
[0052] Figure 4 It is a schematic diagram of the intersection of the line of sight and the triangular patch provided by an embodiment of the present invention;
[0053] Figure 5 It is a schematic diagram of the viewpoint offset provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0054] The following will further elaborate on the specific implementation of the present invention by describing the embodiments with reference to the accompanying drawings, so as to help those skilled in the art have a more complete, accurate and in-depth understanding of the inventive concept and technical solution of the present invention.
[0055] Figure 1 The flowchart of the photographing viewpoint planning method for hub surface defect detection provided by the embodiment of the present invention is as follows:
[0056] (1) Perform Gaussian mapping on the triangular patches in the triangular patch model of the hub to be detected to form Gaussian points on the Gaussian sphere surface;
[0057] Perform triangular mesh division on the three-dimensional model of the hub to be measured to form a triangular patch model of the hub to be detected, and perform Gaussian mapping on the triangular patches in the triangular patch model to form a Gaussian sphere. Gaussian mapping refers to a mapping from a surface in Euclidean space R 3 to the unit sphere S 2 . This unit sphere is called the Gaussian sphere. The specific process of Gaussian mapping is as follows: Move the starting point of the normal vector at each point on the surface to the center of the Gaussian sphere. Each normal vector will have an intersection point with the Gaussian sphere surface. The set of all these intersection points is called the Gaussian mapping of the surface. As shown in the following figure, point A is a point on the surface S, and vector n is the normal vector of point A. Move the starting point of vector n to the center O of the Gaussian sphere, then the intersection point P with the sphere surface is obtained. By analogy, move the starting points of the normal vectors of all points on the surface S to the center of the Gaussian sphere, and the set of the intersection points of the obtained normal vectors with the Gaussian sphere surface is the Gaussian mapping of the surface S, as Figure 2 shown.
[0058] (2) Divide the triangular patch model into several independent regions, and the included angles of the normal vectors of the triangular patches corresponding to the Gaussian points within the independent regions are similar and topologically adjacent;
[0059] In the embodiment of the present invention, by using the clustering analysis method and combining the topological relationship of the model, the regions with similar average normal vector included angles and adjacent to each other are merged by means of the triangular patch growth method to divide the triangular patch model into several independent regions. The formation process of the independent regions is as follows:
[0060] (21) Cluster the triangular patches in the triangular patch model based on the Gaussian points on the Gaussian sphere surface, and classify the triangular patches with similar normal vector included angles into one category. The clustering process is as follows:
[0061] (221) Set the number of classifications k, the maximum number of iterations n, and the threshold δ for the movement of the mass point position;
[0062] (222) Set the mass points c 1 , c 2 , c3 , ……, c k ;
[0063] (223) Calculate the distances between each Gauss point and each mass point, and divide the Gauss points into the class corresponding to the mass point ci with the minimum distance. After completing the division of all Gauss points, complete one iteration and increment the iteration count by 1;
[0064] (224) Detect whether the current iteration count has reached the set maximum iteration count. If the detection result is yes, stop the iteration and output the current clustering result. If the detection result is no, execute step (225);
[0065] (225) Update the mass points of each class;
[0066] (226) Calculate the position change amount between the mass points of each class before and after the update. If the position change amount is less than the set threshold δ, stop the iteration and output the current clustering result. Otherwise, return to step (233).
[0067] Since the clustering analysis method classifies those with similar normal vector angles into one class and does not consider the topological relationship between triangular patches, after clustering analysis, there may be a problem that several triangular patches belong to the same class but are not connected. This makes it difficult to ensure that all regions of the same class are within the camera's field of view. Therefore, according to the model topological relationship, the non - adjacent and unconnected regions are further divided into multiple independent parts, and each independent part corresponds to an independent region.
[0068] (22) Based on the triangular patch growth algorithm, detect the connectivity between triangular patches of each class, and divide the connected triangular patches of the same class into the same independent region.
[0069] The present invention uses the triangular patch growth algorithm to determine whether each region is connected and perform segmentation, using the "common vertex" as the growth medium. The specific process and steps of the triangular patch growth algorithm are as follows:
[0070] (221) Select an unmarked triangular patch in class T i (0 ≤ i ≤ k) as the seed patch, mark the triangular patch, and add the three vertices of the triangular patch as boundary points to the set A;
[0071] (222) Search for unmarked triangular patches in class T i with the boundary points as vertices, mark the triangular patch, and add the three vertices of the triangular patch as boundary points to the set A;
[0072] (223) Calculate the number of triangular patches in set A. If the number of triangular patches increases, return to step (222). If the number of triangular patches does not increase, the triangular patches in set A form an independent region;
[0073] (224) Check i whether there are unmarked triangular patches in class T. If there are, return to step (221). If not, complete the division of independent regions of class T. i
[0074] (3) Find adjacent independent regions whose included angle with the average normal vector of each independent region is less than the camera field of view angle, and merge the found adjacent independent regions with the corresponding independent regions;
[0075] However, after the above segmentation, a large class in clustering analysis is divided into multiple independent regions, resulting in too many independent regions. If a separate photographing viewpoint is generated for each independent region directly, it will cause the situation of redundant viewpoints and increase the photographing time. Therefore, a merging operation needs to be further performed on all independent regions. The method for merging independent regions is as follows:
[0076] (31) Put all independent regions into the independent region set A, and extract the boundary edges of all independent regions;
[0077] (32) Randomly select an independent region A from the independent region set A i , and detect whether there are adjacent independent regions that share a common boundary edge with the independent region Ai. If not, put the independent region A i into set B. If so, execute step (33);
[0078] (33) Calculate the included angle between the average normal vector of the adjacent independent region and the average normal vector of the independent region A i , and detect whether there are adjacent independent regions with an included angle less than the camera field of view angle. If so, merge the adjacent independent region A j with the independent region A i , put the merged independent region A i into the new set B, and remove the adjacent independent region A j from the independent region set A, and execute step (32). If not, put the independent region A i into set B and execute step (32) until the independent region set A is empty. Each independent region in set B is the merged independent region.
[0079] (4) Construct the OBB bounding box of each independent region and determine the camera viewpoints surrounded by the OBB bounding box by the camera visual cone model;
[0080] Construct an OBB bounding box for each independent region in set B, establish a visible cone model of the camera according to parameters such as the camera's field of view, depth of view, and viewing angle, and use this visible cone to constrain the OBB bounding box to ensure that all bounding boxes can be surrounded by the visible cone. Determine the position and pose of the viewpoint according to the position and pose of the visible cone;
[0081] Since the OBB bounding box can construct a bounding box in any direction according to the geometric characteristics of the object, and in order to ensure that all parts can be photographed, the established bounding box needs to closely surround the segmented object as much as possible according to the geometric shape characteristics of the segmented object. Therefore, an OBB bounding box is established for each independent region after merging. The three main directions of the point set contained in each independent region are calculated by the principal component analysis method (PCA), and these three main directions are used as the main axes of the OBB bounding box to establish the OBB bounding box. The specific process of establishing the OBB bounding box is as follows:
[0082] (41) Select an independent region Bi from set B i , and calculate the total area S of all triangular patches in the independent region Bi i ;
[0083] Let the vertices of the triangular patch be u i , v i , w i respectively. Calculate the center coordinate c i of the triangular patch and the triangle area s i . The center coordinate c i = (u i + v i + w i ) / 3, and the triangle area s i = (u i - v i ) · (u i - w i ) / 2. Then the total area of all triangular patches in the independent region Bi where n is the number of triangular patches in the independent region Bi i .
[0084] (42) Calculate the area-weighted center point C i of the independent region Bi i , and its calculation formula is as follows;
[0085]
[0086] (43) Construct a covariance matrix, perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and eigenvectors, use the three unitized eigenvectors as coordinate axes, and use the area-weighted center point C iConstruct a new coordinate system with the origin as the coordinate origin, and obtain the transformation matrix T of the new coordinate system relative to the model coordinate system where the triangular facet model is located, and calculate the independent region B i The AABB bounding box in the new coordinate system, and transform the AABB bounding box to the model coordinate system to obtain the position, orientation and size of the OBB bounding box;
[0087] In the embodiment of the present invention, the covariance matrix is represented as follows:
[0088]
[0089] In the formula,
[0090] Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and eigenvectors, Cv k = λ k v k where, v k represents the eigenvector, λ k represents the eigenvalue, k ∈ {1, 2, 3}. Since the covariance matrix is a real symmetric matrix, the corresponding eigenvectors are orthogonal to each other. Take the three unitized eigenvectors of the covariance matrix as the coordinate axes, and take the area-weighted center point C i as the origin of the coordinate system to establish a new coordinate system and obtain the transformation matrix T between the two coordinate systems, and calculate the independent region B i The AABB bounding box in the new coordinate system, and transform the AABB bounding box to the model coordinate system to obtain the position, orientation and size of the OBB bounding box.
[0091] (44) Delete the independent region B i from the set B, and execute step (41) until the set B is empty, indicating that the OBB bounding boxes have been established for all independent regions in the set B.
[0092] The visible cone model of the camera is as Figure 3 shown. In the figure, P is the viewpoint, T is the near field, B is the far field, and the distance between the far field and the near field represents the camera depth of field. After establishing the visible cone model of the camera, it is necessary to obtain the position and direction of the visible cone according to the direction characteristics of the bounding box. The specific process is as follows:
[0093] The center point of the best imaging surface in the camera's visual cone model coincides with the center point of the bounding box. The four vertices of the bottom surface of the visual cone are calculated according to the direction vector of the length and width of the largest rectangular surface of the OBB bounding box. Similarly, the four vertices of the top surface of the visual cone can be calculated. The position and direction of the visual cone can be determined based on these eight vertices. For the OBB bounding box that exceeds the camera's visual cone model, it is divided into four equal parts by the center of the OBB bounding box until each OBB bounding box can be surrounded by the camera's visual cone model, and then the viewpoint position of each OBB bounding box is determined. After the viewpoint position is determined, the distance from the camera's optical center to the photographed wheel hub surface is also determined, that is, the working distance of the camera's best imaging surface. The size of the defect in the image can be calculated based on this distance.
[0094] (5) Detect the obstructed viewpoints, adjust the positions of the obstructed viewpoints, and obtain a robot photography viewpoint set for the surface defect detection of the wheel hub to be tested.
[0095] Whether the viewpoint o can capture the centroid p of all triangles in the bounding box without occlusion, we only need to consider whether a ray starting from the viewpoint o and passing through the centroid p of the triangles in the bounding box will intersect with the triangles on the triangle model, such as Figure 4 As shown, the intersection detection process between the ray and the triangular facets on the triangular facet model is as follows;
[0096] (51) The ray op can be expressed by the equation p(t) = t·P + (1-t)·O, where P and O represent the coordinates of the centroid p and viewpoint o of the triangle in the model coordinate system, respectively, and t is the scale factor;
[0097] (52) Any point on the triangle can be expressed by the equation q(u,v) = u·a 1 +v·b 1 +(1-uv)·c 1 Indicates that a 1 、b 1 、c 1 Represents the coordinates of the three vertices of the triangle where the centroid p is located in the model coordinate system, and u and v are the scale coefficients;
[0098] (53) Combine the two equations: t·P+(1-t)·O=u·a 1 +v·b 1 +(1-uv)·c 1 If there are proportional coefficients t, u, and v that make the equation true, it means that the line of sight intersects with the triangle, that is, the ray op is blocked. If there are no proportional coefficients t, u, and v that make the equation true, it means that the line of sight is not blocked by the triangle.
[0099] Store the viewpoints without line-of-sight occlusion into the viewpoint set. For the occluded viewpoints, correct the occluded viewpoints through the line-of-sight offset method until a viewpoint pose is found where there is no occlusion and the OBB bounding box is surrounded by the camera's visible cone model.
[0100] When the camera viewpoint P determined according to the position of the bounding box 1 is occluded, it is necessary to offset the incident angle of the viewpoint according to the set angle step, and then rotate the line of sight corresponding to the offset viewpoint P2 around the line of sight P 1 to find a viewpoint without occlusion. If there is a viewpoint without occlusion, find the viewpoint whose OBB bounding box is surrounded by the camera's visible cone model from the viewpoints without occlusion. If not, only divide the OBB bounding box into four equal parts based on the center of the OBB bounding box until a viewpoint whose OBB bounding box is surrounded by the camera's visible cone model is found from the viewpoints without occlusion. Put this viewpoint into the viewpoint set. If there is no non-occluding viewpoint, control the viewpoint P2 to continue to offset, and then rotate the line of sight corresponding to the offset viewpoint P3 around the line of sight P 1 and repeat the above process until all viewpoints whose OBB bounding boxes are surrounded by the camera's visible cone model corresponding to the viewpoints and have no occlusion are found, as Figure 5 shown.
[0101] For all viewpoints in the viewpoint set, perform robot inverse kinematics calculation and collision detection. If any of the robot inverse kinematics and collision detection calculations fails, in order to ensure that the visibility of the viewpoints is not affected, rotate the viewpoint around the camera optical axis until the robot inverse kinematics can be calculated and no collision occurs.
[0102] Because a tool coordinate system is established on the camera, the camera viewpoints in the viewpoint set are the robot poses. Search for the path through the greedy algorithm, starting from the initial pose of the robot, find the robot pose closest to the current position from all robot poses as the next point, and so on, to find the shortest path passing through all viewpoints, and use the shortest path as the robot motion path during the detection of the surface defects of the hub to be measured.
[0103] The method for photographing viewpoint planning for hub surface defect detection provided by the present invention has the following beneficial technical effects:
[0104] (1) Divide the hub according to the normal vector characteristics of the hub surface and the topological relationship of the triangular patch model of the hub to be detected. When dividing the model, the change of the normal vector of the model surface and the topological relationship are taken into account, so that each subsequent generated viewpoint can capture as many hub models as possible within the camera's field of view;
[0105] (2) The traditional OBB bounding box construction algorithm is extremely vulnerable to irregular surfaces such as arc surfaces, resulting in a large amount of redundant space. The present invention introduces an area-weighted method to calculate the center point and covariance matrix of the bounding box, improving the tightness of the constructed OBB bounding box;
[0106] (3) A method for judging whether the viewpoint is occluded is given by the ray tracing algorithm, and at the same time, a de-occlusion strategy for the viewpoint is given, making all generated viewpoints effective and ensuring the coverage rate of the viewpoints for the model;
[0107] (4) In the detection of wheel hub defects, there are size limitations for many defects, and the traditional wheel hub defect detection device cannot guarantee and measure the distance between the measured wheel hub and the camera, thus unable to calculate the actual size of the defect, and also unable to judge whether the defect meets the quality requirements. Since the viewpoints in the present invention are automatically planned, the distance from the camera to the model surface, i.e., the camera working distance, can be obtained during the planning, so that the size of the defect can be judged more accurately, greatly reducing the possibility of misjudging the defect.
[0108] The present invention has been described by way of example. Obviously, the specific implementation of the present invention is not limited by the above methods. As long as various non-substantive improvements are made by adopting the method concept and technical solution of the present invention, or the concept and technical solution of the present invention are directly applied to other occasions without improvement, they are all within the protection scope of the present invention.
Claims
1. A camera viewpoint planning method for wheel hub surface defect detection, characterized in that: The method is specifically as follows: (1) Gaussian mapping is performed on the triangular facets in the triangular facet model of the wheel hub to be inspected to form Gaussian points on the surface of the Gaussian sphere; (2) Divide the triangular face model into several independent regions, where the normal vectors corresponding to the Gaussian points in the independent regions have similar angles and are topologically adjacent; (3) Find the adjacent independent regions whose angles with the average normal vectors of the independent regions are smaller than the camera field of view angle, and merge the found adjacent independent regions with the corresponding independent regions; (4) constructing the OBB bounding box of each independent area and determining the camera viewpoint where the OBB bounding box is surrounded by the camera visual cone model; (5) Detect the camera viewpoints that are blocked, adjust the poses of the viewpoints that are blocked, and obtain a camera viewpoint set for detecting surface defects of the wheel hub to be tested.
2. The camera viewpoint planning method for wheel hub surface defect detection according to claim 1, characterized in that: The process of forming an independent region is as follows: (21) Clustering the triangular facets in the triangular facet model based on the Gaussian points on the Gaussian sphere surface, and grouping the triangular facets with similar normal vector angles into one category; (22) The connectivity between different types of triangles is detected based on the triangle growth algorithm, and the triangles of the same type are divided into the same independent area.
3. The camera viewpoint planning method for wheel hub surface defect detection according to claim 2, characterized in that: The clustering process is as follows: (221) The number of classifications k, the maximum number of iterations n, and the moving threshold δ of the particle position are set; (222) Set various types of particles c1, c2, c3, ..., c k ; (223) Calculate the distance between each Gaussian point and each mass point, and divide the Gaussian point into the class corresponding to the mass point ci with the smallest distance. After all Gaussian points are divided, increase the number of iterations by 1. (224) Check whether the current number of iterations reaches the set maximum number of iterations. If the detection result is no, execute step (225); (225) Update various types of particles; (226) Calculate the position change of each type of particle before and after the update. If the position change is less than the set threshold δ, output the current clustering result, otherwise return to step (233).
4. The camera viewpoint planning method for wheel hub surface defect detection according to claim 2, characterized in that: The independent region division process based on triangle patch growth is as follows: (221) In T i Select an unmarked triangle from the class as a seed face, mark the triangle, and add the three vertices of the triangle as boundary points to set A; (222) In T i Find an unmarked triangle with a boundary point as a vertex in the class, mark the triangle, and add the three vertices of the triangle as boundary points to the set A; (223) Calculate the number of triangles in set A. If the number of triangles increases, return to step (222). If the number of triangles does not increase, the triangles in set A form an independent region. (224) Check T i Is there an unmarked triangle in the class? If so, return to step (221). If not, complete T i Independent area division of classes.
5. The photographing viewpoint planning method for wheel hub surface defect detection according to claim 1, characterized in that: The merging process of independent regions is as follows: (31) Put all independent regions into the independent region set A and extract the boundary edges of all independent regions; (32) Randomly select an independent area A from the independent area set A i , detect whether there is an adjacent independent region with a common boundary edge with the independent region Ai, if not, the independent region A i Put it into set B. If it exists, execute step (33); (33) Calculate the average normal vector of the adjacent independent regions and the average normal vector of the independent region A i The angle between the average normal vectors of is used to detect whether there are adjacent independent areas whose angle is smaller than the camera field of view. If so, the adjacent independent area A whose angle is smaller than the camera field of view is j With independent area A i Merge, and merge the independent area A i Put it into the new set B, and put the adjacent independent area A j Remove it from the independent region set A and execute step (32). If it does not exist, remove the independent region A. i Put it into set B and execute step (32) until the independent region set A is empty and each independent region in set B is a merged independent region.
6. The photographing viewpoint planning method for wheel hub surface defect detection according to claim 1, characterized in that: The OBB bounding box construction method for each independent area is as follows: (41) Select an independent region B from set B i , calculate the independent area B i The sum of the areas of all triangles in it is S; (42) Calculate independent area B i The area-weighted center point C i ; (43) Construct a covariance matrix, perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and eigenvectors, use the three normalized eigenvectors as coordinate axes, and use the area-weighted center point C as the coordinate axis. i Construct a new coordinate system for the coordinate origin, obtain the transformation matrix T of the new coordinate system relative to the coordinate system of the model where the triangular face model is located, and calculate the independent area B i The AABB bounding box in the new coordinate system is converted to the model coordinate system to obtain the position, attitude and size of the OBB bounding box; (44) Independent area B i Delete from set B and execute step (41) until set B is empty.
7. The photographing viewpoint planning method for wheel hub surface defect detection according to claim 6, characterized in that: The covariance matrix is as follows: In the formula, 8. The camera viewpoint planning method for wheel hub surface defect detection according to claim 1, characterized in that: The occlusion detection process of the camera viewpoint is as follows: Determine the ray op starting from the camera viewpoint o and passing through the centroid p of each triangle in the bounding box, and check whether there is a ray that intersects with the triangle on the triangle model. If so, the corresponding camera viewpoint o is blocked.
9. The photographing viewpoint planning method for wheel hub surface defect detection according to claim 8, characterized in that: The detection process of the ray intersecting the triangular face on the triangular face model is as follows: (51) Construct the equation of ray op p(t)=t·P+(1-t)·O, where P and O represent the coordinates of the centroid p and viewpoint o of the triangle in the model coordinate system, respectively, and t is the scale factor; (52) Construct the equation of any point on the triangle patch q(u,v)=u·a1+v·b1+(1-uv)·c1, where a1, b1, c1 represent the coordinates of the three vertices of the triangle patch where the centroid p is located in the model coordinate system, and u and v are scale coefficients; (53) Let t·P+(1-t)·O=u·a1+v·b1+(1-uv)·c1. If the proportional coefficients t, u, v exist so that the equation holds, it means that the line of sight corresponding to the ray op is blocked. If the proportional coefficients t, u, v do not exist so that the equation holds, it means that the line of sight corresponding to the ray op is not blocked by the triangle patch.
10. The photographing viewpoint planning method for wheel hub surface defect detection according to claim 8, characterized in that the photographing path generation process of the robot where the camera is located is specifically as follows: Taking the initial posture of the robot as the starting point, the shortest path through all viewpoints is searched through a greedy algorithm, and the shortest path is used as the robot motion path when detecting surface defects of the wheel hub to be tested.
Citation Information
Cited By
Multi-station hub surface defect detection system and detection method
CN120741468A
Steel ring quality detection working method capable of rapidly judging defect spots
CN121032890A
Methods for quickly identifying defects in steel rims during quality inspection
CN121032890B