Three-dimensional object bounding box determination method and device, computer device, and storage medium
By triangulating the 3D convex hull of a 3D object and filtering the similarity of edge clusters, a local coordinate system is established, and the minimum volume bounding box is determined. This solves the problem of long processing time in existing bounding box algorithms and achieves efficient 3D object detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN LINGYUN VISION TECH CO LTD
- Filing Date
- 2022-12-29
- Publication Date
- 2026-07-31
AI Technical Summary
Existing bounding box algorithms are time-consuming and cannot meet the needs of high-speed and high-precision detection of 3D objects, especially in fields such as collision detection.
By obtaining the triangulation results of the 3D convex hull of the 3D object, the similarity data of the convex hull edges are used for classification to obtain edge clusters. A local coordinate system is established by combining edge pairs, and candidate bounding boxes that meet the volume conditions are screened out, and finally the target bounding box is determined.
It improves the efficiency of acquiring bounding boxes and ensures that the bounding box volume is approximately at the theoretical minimum, which can meet the requirements of high-speed and high-precision 3D object detection.
Smart Images

Figure CN116188683B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, computer device, and storage medium for determining the bounding box of a three-dimensional object. Background Technology
[0002] 3D vision sensors incorporating 3D machine vision inspection algorithms are widely used in various fields such as intelligent industrial manufacturing, biomedicine, reverse engineering, and virtual reality. The bounding box algorithm, as a fundamental processing operator in 3D machine vision inspection algorithms, plays a crucial role in 3D image processing, pattern recognition, collision detection, mold parting design, and mechanical control.
[0003] In related technologies, the size and orientation of the bounding box are determined based on the object's geometry, allowing for a compact fit to the original object. However, due to the time-consuming nature of bounding box algorithms, they cannot be directly applied to fields such as collision detection. The efficiency of bounding box algorithms needs improvement. Summary of the Invention
[0004] This invention aims to at least partially solve one of the technical problems in related technologies. Therefore, the first objective of this invention is to propose a method for determining the bounding box of a three-dimensional object, ensuring that the volume of the final obtained bounding box is approximately the theoretical minimum while significantly improving the efficiency of bounding box acquisition. This method can be directly applied to fields requiring high-speed and high-precision detection of three-dimensional objects.
[0005] The second objective of this invention is to provide a three-dimensional object bounding box determination device.
[0006] The third objective of this invention is to provide a computer device.
[0007] The fourth objective of this invention is to provide a computer-readable storage medium.
[0008] To achieve the above objectives, a first aspect of the present invention proposes a method for determining the bounding box of a three-dimensional object, comprising: obtaining the triangulation result of the three-dimensional convex hull of the three-dimensional object; wherein the triangulation result includes multiple triangular facets; the common edge of two adjacent triangular facets is the convex hull edge line of the three-dimensional convex hull; classifying the multiple convex hull edges according to similarity data between the convex hull edges to obtain multiple edge clusters; wherein the edge clusters correspond to specified edges; combining the multiple specified edges to obtain multiple edge pairs; and determining the candidate bounding box whose volume satisfies the bounding box screening criteria as the target bounding box of the three-dimensional object from among the multiple candidate bounding boxes corresponding to the multiple local coordinate systems determined by the multiple edge pairs.
[0009] According to one embodiment of the present invention, the similarity data between the convex hull edges is determined by the included angle between the representation vectors of the convex hull edges; the two adjacent triangular facets include a first triangular facet and a second triangular facet; the generation method of the representation vector of the convex hull edge includes: using the first normal vector of the first triangular facet and the second normal vector of the second triangular facet to determine the cross product vector of the first normal vector and the second normal vector; generating the representation vector of the convex hull edge based on the first normal vector, the second normal vector, and the cross product vector.
[0010] According to one embodiment of the present invention, classifying the plurality of convex hull edges based on similarity data between the convex hull edges to obtain a plurality of edge clusters includes: selecting one convex hull edge from the plurality of convex hull edges as a reference edge; traversing the plurality of convex hull edges to determine the angle between the representation vector of each convex hull edge and the representation vector of the reference edge; determining the convex hull edge corresponding to the angle less than a first angle threshold, and the reference edge belonging to the same edge cluster.
[0011] According to one embodiment of the present invention, the designated edge line adopts the reference edge line to represent the convex hull edge line included in the edge line cluster; the combination of multiple designated edge lines to obtain multiple edge line pairs includes: combining multiple reference edge lines in pairs to obtain the multiple edge line pairs.
[0012] According to one embodiment of the present invention, the determination of the plurality of local coordinate systems includes: establishing a target equation based on the characteristic that the normals of two adjacent faces of the bounding box are perpendicular to each other, through a plurality of edge pairs; determining a plurality of local coordinate systems according to a plurality of solution set vector pairs included in the solution set of the target equation; wherein the solution set vector pair includes a first vector and a second vector, the first vector being the normal vector of the first face among the two adjacent faces of the bounding box, and the second vector being the normal vector of the second face among the two adjacent faces of the bounding box.
[0013] According to one embodiment of the present invention, determining multiple local coordinate systems based on multiple solution set vector pairs included in the solution set of the objective equation includes: constructing multiple initial coordinate systems to be screened based on the multiple solution set vector pairs included in the solution set; and screening the multiple initial coordinate systems based on similarity data between the initial coordinate systems to obtain the multiple local coordinate systems.
[0014] According to one embodiment of the present invention, the step of filtering multiple initial coordinate systems based on similarity data between the initial coordinate systems to obtain multiple local coordinate systems includes: classifying the multiple initial coordinate systems based on similarity data between the initial coordinate systems to obtain multiple coordinate system clusters; wherein, for the first initial coordinate system and the second initial coordinate system in the coordinate system cluster, the included angles between the three coordinate axes of the first initial coordinate system and the corresponding three coordinate axes of the second initial coordinate system are respectively less than a second angle threshold; and retaining a specified coordinate system in the coordinate system cluster as the local coordinate system.
[0015] According to one embodiment of the present invention, the edge pair includes a first edge and a second edge; the step of establishing a target equation based on the perpendicularity of the normals of two adjacent faces of the bounding box through multiple edge pairs includes: constructing a first normal vector to be solved for the first face based on the normal vectors of two triangular facets sharing the first edge; constructing a second normal vector to be solved for the second face based on the normal vectors of two triangular facets sharing the second edge; and establishing the target equation according to the perpendicularity of the normals of two adjacent faces of the bounding box, the first normal vector to be solved, and the second normal vector to be solved.
[0016] According to one embodiment of the present invention, constructing a first normal vector to be solved for the first face based on the normal vectors of two triangular facets sharing the first edge includes: determining a first normal vector pair based on the normal vectors of the two triangular facets sharing the first edge; and constructing a first normal vector to be solved for the first face using the first normal vector pair. Constructing a second normal vector to be solved for the second face based on the normal vectors of two triangular facets sharing the second edge includes: determining a second normal vector pair based on the normal vectors of the two triangular facets sharing the second edge; and constructing a second normal vector to be solved for the second face using the second normal vector pair.
[0017] According to one embodiment of the present invention, the first face corresponds to a first weighting factor, and the second face corresponds to a second weighting factor; the step of constructing a first unsolved normal vector of the first face using the first normal vector pair includes: constructing the first unsolved normal vector using the first normal vector pair and the first weighting factor; the step of constructing a second unsolved normal vector of the second face using the second normal vector pair includes: constructing the second unsolved normal vector of the second face using the second normal vector pair and the second weighting factor.
[0018] According to one embodiment of the present invention, the solution set of the objective equation is determined within a first weight value range of the first weight factor and within a second weight value range of the second weight factor.
[0019] To achieve the above objectives, a second aspect of the present invention provides a three-dimensional object bounding box determination device, comprising: a triangulation result acquisition module, used to acquire the triangulation result of the three-dimensional convex hull of the three-dimensional object; wherein the triangulation result includes multiple triangular facets; the common edge of two adjacent triangular facets is the convex hull edge line of the three-dimensional convex hull; a classification processing module, used to classify the multiple convex hull edges according to similarity data between the convex hull edges to obtain multiple edge clusters; wherein the edge clusters correspond to specified edges; a combination module, used to combine the multiple specified edges to obtain multiple edge pairs; and a determination module, used to determine the candidate bounding box whose volume meets the bounding box screening criteria as the target bounding box of the three-dimensional object from multiple candidate bounding boxes corresponding to multiple local coordinate systems determined by the multiple edge pairs.
[0020] To achieve the above objectives, a third aspect of the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the foregoing embodiments.
[0021] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the preceding embodiments.
[0022] According to multiple embodiments provided by the present invention, the convex hull algorithm and the convex hull triangulation algorithm are used to obtain the vertex model representing the complete three-dimensional object. While preserving the boundary characteristics of the three-dimensional object, the amount of data processed by the algorithm can be reduced, thereby improving the efficiency of obtaining the bounding box. By performing similarity screening on the convex hull edges and similarity screening on the local coordinate system, the redundant calculation of similar bounding boxes can be avoided, greatly improving the overall efficiency of the bounding box determination method. The objective equation is established by combining the inherent geometric characteristics of the minimum volume bounding box to solve the local coordinate system, ensuring the accuracy of the local coordinate system.
[0023] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0024] Figure 1 This is a flowchart illustrating a method for determining the bounding box of a three-dimensional object according to one embodiment of this specification.
[0025] Figure 2 This is a flowchart illustrating the generation method of the representation vector of the convex hull edge according to one embodiment of this specification.
[0026] Figure 3 This is a schematic diagram illustrating the process of classifying multiple convex hull edges according to one embodiment of this specification.
[0027] Figure 4a This is a flowchart illustrating a method for determining multiple local coordinate systems according to one embodiment of this specification.
[0028] Figure 4b This is a schematic diagram of the normal vector distribution of a face of a bounding box according to one embodiment of this specification.
[0029] Figure 5 This is a flowchart illustrating the process of determining multiple local coordinate systems according to one embodiment of this specification.
[0030] Figure 6 This is a flowchart illustrating the process of selecting a system from multiple initial coordinate systems according to one embodiment of this specification.
[0031] Figure 7a This is a schematic diagram of a process for establishing a target equation using multiple edge pairs according to one embodiment of this specification.
[0032] Figure 7b This is a schematic diagram of a process for establishing a target equation using multiple edge pairs according to one embodiment of this specification.
[0033] Figure 8 This is a flowchart illustrating a method for determining the bounding box of a three-dimensional object according to one embodiment of this specification.
[0034] Figure 9 This is a structural block diagram of a three-dimensional object bounding box determining device provided according to one embodiment of this specification.
[0035] Figure 10 This is a structural block diagram of a computer device provided according to one embodiment of this specification. Detailed Implementation
[0036] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0037] Currently, 3D vision sensors incorporating 3D machine vision inspection algorithms are widely used in various fields such as intelligent industrial manufacturing, biomedicine, reverse engineering, and virtual reality, exhibiting characteristics such as high detection accuracy, high detection efficiency, and ease of operation and deployment. Bounding box algorithms, as a fundamental processing operator in 3D machine vision inspection, play a crucial role in 3D image processing of 3D objects, pattern recognition, collision detection, mold parting design, and mechanical control. In the field of intelligent industrial manufacturing, the detection of 3D objects requires both high accuracy and high efficiency; therefore, an efficient, stable, and highly accurate bounding box algorithm is particularly important.
[0038] Among related technologies, the most widely used OBB (Oriented Bounding Box) algorithm determines the size and orientation of the bounding box based on the geometry of the object itself, enabling a compact fit to the original object. For a given set of coordinate points in 3D object space, how to efficiently and accurately obtain its minimum directed bounding box has always been a key research focus in related fields.
[0039] Generally, based on the spatial distribution of all vertices of a 3D object, different algorithms are used to find the optimal orientation to determine the principal axes of the directed bounding box. Commonly used bounding box calculation methods mainly include the following two:
[0040] (1) The Principal Component Analysis (PCA)-based method obtains the covariance matrix from the spatial coordinate set of the sampled points of the input 3D object, calculates the eigenvectors, estimates the direction of the maximum expansion distribution in the spatial coordinate set, and uses it as the principal axis direction of the bounding box. The algorithm of this method is relatively simple, but for 3D objects with uneven spatial coordinate distribution of sampled points or large differences in spatial relationships in the spatial coordinate set, it is difficult to accurately obtain the minimum directed bounding box of the 3D object using this method.
[0041] (2) The method based on brute-force search, particle swarm optimization, and genetic algorithm first samples the unit hemisphere of the coordinate point set in the 3D object space and obtains multiple candidate directions of the principal axes of the bounding box through brute-force search. Then, it combines genetic algorithm or particle swarm optimization to traverse and search all candidate directions, and uses projection and the two-dimensional minimum bounding rectangle to find the minimum volume bounding box under multiple candidate directions. Finally, it compares the bounding boxes under all candidate directions and selects the bounding box with the smallest volume as the minimum directed bounding box of the 3D object. This method has drawbacks such as difficulty in adjusting the parameters of the genetic algorithm, difficulty in selecting the number of candidate starting directions for the brute-force search, and low algorithm efficiency.
[0042] To improve the computational efficiency and accuracy of minimum directed bounding boxes, it is necessary to propose a method, apparatus, computer equipment, and storage medium for determining the bounding boxes of three-dimensional objects. First, the 3D convex hull of the coordinate point set of the 3D object is obtained, and the vertices of the convex hull are triangulated to obtain the vertex model of the 3D object. While preserving the boundary characteristics of the 3D object, the amount of data to be processed can be greatly reduced, thereby improving the computational efficiency of the bounding box. Second, the convex hull edges are filtered through a similarity filtering strategy to reduce the number of convex hull edges used to obtain candidate directions of the bounding box principal axes. Next, based on the geometric property that two mutually perpendicular faces in the minimum directed bounding box coincide with two edges of the 3D convex hull of the 3D object, an objective equation is established and solved to obtain several local coordinate systems under candidate directions of the bounding box principal axes. Then, combined with the similarity filtering principle of the local coordinate systems, the local coordinate systems under all candidate directions are filtered to further reduce the number of candidate local coordinate systems used to calculate the minimum directed bounding box, thereby improving the computational efficiency of the bounding box. Finally, the candidate bounding boxes calculated based on the local coordinate systems are traversed to find the directed bounding box with the smallest volume, which is used as the minimum directed bounding box of the 3D object. Compared with related technologies, this method can improve the computational efficiency of bounding boxes while ensuring that the volume of the final bounding box is approximately the theoretical minimum. It can also be directly applied to related fields with high-speed and high-precision detection requirements for 3D objects.
[0043] This specification provides a method for determining the bounding box of a three-dimensional object, referencing... Figure 1 As shown, the method may include the following steps.
[0044] S110. Obtain the triangulation result of the 3D convex hull of the 3D object. The triangulation result includes multiple triangular faces; the common edge of two adjacent triangular faces is the convex hull edge of the 3D convex hull.
[0045] In this context, the 3D object can be a 3D physical object, and the surface of the 3D physical object corresponds to a set of point data. A 3D convex hull calculation algorithm can be used to calculate this set of point data to obtain the 3D convex hull of the 3D physical object. In some implementations, the 3D object can also be a set of point data on the surface of a 3D physical object, i.e., a 3D point cloud. The 3D convex hull can be obtained based on the 3D point cloud. The triangulation result can be obtained by triangulating the vertices of the 3D convex hull. The convex hull edges can be the lines connecting the vertices of the 3D convex hull.
[0046] Specifically, a convex hull calculation method can be used to obtain the 3D convex hull of the corresponding 3D point cloud based on the spatial relationships of the point data in the 3D point cloud of the 3D object. Then, using the vertices of the 3D convex hull as the point set, a triangulation algorithm is used to triangulate the vertex set of the 3D convex hull to obtain the triangulation result of the 3D convex hull.
[0047] In some embodiments, the open-source third-party library Qhull includes mature 3D convex hull calculation and triangulation algorithms. The 3D convex hull and its triangulation results can be obtained through the open-source third-party library Qhull. For example, taking the 3D point cloud of a 3D object as input, the 3D convex hull of the point cloud can first be obtained using the 3D convex hull calculation algorithm of the third-party library Qhull. Then, the vertex set of the 3D convex hull can be taken as input, and the triangulation results of the vertices of the 3D convex hull can be obtained using the triangulation algorithm of the third-party library Qhull.
[0048] It's understandable that triangulation of the vertices of a 3D convex hull yields multiple triangular facets, and the vertices of these facets are the vertices of the 3D convex hull. Therefore, the triangular facets represent the connections between the vertices of the 3D convex hull, and the common edge of two adjacent triangular facets is the edge of the convex hull. It should be noted that QHull is an open-source software program used to study and solve convex hull problems and generate convex hull shapes.
[0049] S120. Classify multiple convex hull edges based on the similarity data between them to obtain multiple edge clusters. Each edge cluster corresponds to a specified edge.
[0050] Similarity data can be used to measure the similarity between any two convex hull edges, such as whether the orientations of any two convex hull edges are similar. The specified edge can be a convex hull edge obtained from an edge family for calculating candidate directions of the bounding box principal axis, and can represent the spatial similarity of the convex hull edges in the corresponding edge family.
[0051] Understandably, for multiple edge clusters, the similarity of the convex hull edges within each edge cluster is high, while the similarity of the convex hull edges between edge clusters is low. Obtaining specified edges from each edge cluster that can represent the characteristics of the convex hull edges in that cluster can reduce the number of highly similar convex hull edges, thereby reducing the number of convex hull edges used to calculate and obtain candidate directions for the bounding box principal axes, effectively improving the algorithm's efficiency.
[0052] In some embodiments, the similarity between any two convex hull edges can be determined based on the included angle and orientation of two adjacent triangular facets of the convex hull edges. Further, the included angle and orientation of the triangular facets can be determined by the orientation of the normal vectors corresponding to the triangular facets. For example, two adjacent triangular facets sharing a common edge with convex hull edge L1 are P11 and P12, with the normal vector corresponding to facet P11 being N11 and facet P12 being N12; two adjacent triangular facets sharing a common edge with convex hull edge L2 are P21 and P22, with the normal vector corresponding to facet P21 being N21 and facet P22 being N22. The similarity between convex hull lines L1 and L2 is determined by using the normal vectors N11 and N12 as the normal pairs of adjacent triangular faces of convex hull line L1, and the normal vectors N21 and N22 as the normal pairs of adjacent triangular faces of convex hull line L2. The similarity data is based on the orientation similarity of the normal pairs of adjacent triangular faces corresponding to convex hull lines L1 and L2 respectively. If the orientation similarity of the normal pairs of adjacent triangular faces corresponding to convex hull edges L1 and L2 is relatively high, convex hull edges L1 and L2 can be classified into the same edge family, and convex hull edges L1 and / or L2 can be used as designated edges of the corresponding edge family; if the orientation similarity of the normal pairs of adjacent triangular faces corresponding to convex hull edges L1 and L2 is relatively low, convex hull edges L1 and L2 can be classified into different edge families, and convex hull edges L1 and L2 can be used as designated edges of the corresponding edge families respectively.
[0053] In some embodiments, a weighted average can be calculated on the normal pairs of two adjacent triangular faces of the convex hull edge according to a weighted average rule to obtain the corresponding weighted average vector. Similarity data is determined based on the angle between the weighted average vectors and used to determine the similarity between the convex hull edges.
[0054] S130. Combine multiple specified edge lines to obtain multiple edge line pairs.
[0055] Specifically, the specified edges obtained from each edge cluster can be arbitrarily combined in pairs, and each combination of specified edges can be considered as an edge pair, thus obtaining multiple edge pairs. For example, multiple edge clusters may include edge cluster C1, edge cluster C2, and edge cluster C3. If the specified edge corresponding to edge cluster C1 is LC1, the specified edge corresponding to edge cluster C2 is LC2, and the specified edge corresponding to edge cluster C3 is LC2, then combining the specified edges LC1, LC2, and LC3 in pairs yields edge pairs including LC1 and LC2, edge pairs including LC1 and LC3, and edge pairs including LC2 and LC3.
[0056] S140. Among the multiple candidate bounding boxes corresponding to the multiple local coordinate systems determined by multiple edge pairs, the candidate bounding box whose volume satisfies the bounding box screening condition is determined as the target bounding box of the 3D object.
[0057] The local coordinate system can be the coordinate system along the candidate principal axis of the bounding box corresponding to the 3D convex hull. The target bounding box can be the minimum volume bounding box.
[0058] In some cases, the two mutually perpendicular adjacent faces of the minimum bounding box corresponding to a 3D object coincide with the two convex hull edges of the 3D convex hull corresponding to the object. Therefore, the normals of the two adjacent faces of the minimum bounding box can be represented by the normals of the two adjacent triangular faces of the convex hull edges that coincide with the corresponding faces. It can be understood that, based on the normals of the two adjacent faces of the minimum bounding box, and the cross product of these two normals, the coordinate system along the candidate principal axis direction of the minimum bounding box can be determined. Therefore, based on the convex hull edges that coincide with the adjacent faces, the coordinate system along the candidate principal axis direction of the minimum bounding box can be determined as a local coordinate system.
[0059] Specifically, based on the multiple edge pairs obtained above, it can be assumed that the two convex hull edges in each edge pair coincide with the two adjacent faces of the minimum volume bounding box. Thus, multiple local coordinate systems can be determined based on these edge pairs. Within these determined local coordinate systems, candidate bounding boxes can be calculated using a bounding box algorithm. Candidate bounding boxes whose volumes meet the bounding box selection criteria can be identified as the target bounding box of the 3D object. For example, the volumes of the candidate bounding boxes corresponding to each local coordinate system can be calculated and compared. The candidate bounding box with the smallest volume can be identified as the minimum volume bounding box of the 3D object and finally output.
[0060] In the above embodiments, by performing similarity screening on the convex hull edges of the three-dimensional convex hull, the number of convex hull edges used to obtain the local coordinate system in the candidate direction of the bounding box principal axis is greatly reduced, which can effectively improve the efficiency of subsequent acquisition of the local coordinate system.
[0061] In some implementations, the similarity data between convex hull edges is determined by the angle between the representation vectors of the convex hull edges; two adjacent triangular facets include a first triangular facet and a second triangular facet. (See reference) Figure 2 As shown, the generation method of the representation vector of the convex hull edge can include the following steps.
[0062] S210. Using the first normal vector of the first triangular facet and the second normal vector of the second triangular facet, determine the cross product vector of the first normal vector and the second normal vector.
[0063] The vector can be a weighted average vector calculated by applying a weighted average rule to the normal vectors of two adjacent triangular faces of the convex hull, and is used to represent the included angle and orientation of the two adjacent triangular faces of the convex hull.
[0064] In some cases, the two adjacent triangular faces corresponding to the two convex hull edges may have rotational symmetry, etc. Therefore, the representation vector of the convex hull edge can be determined based on the normal vectors corresponding to the two adjacent triangular faces of the convex hull edge, so that it can be used to represent the included angle and orientation of the two adjacent triangular faces of the convex hull edge.
[0065] S220. Generate the representation vector of the convex hull edge line based on the first normal vector, the second normal vector, and the cross product vector.
[0066] In some embodiments, the weighted average rule for vectors can be vector addition. For example, based on the triangulation result of the 3D convex hull of the 3D object obtained above, the normal vectors of all triangular faces are calculated. Performing a cross product operation on the first normal vector n1 of adjacent first triangular face 1 and the second normal vector n2 of adjacent second triangular face 2 yields the cross product vector n3 of the first normal vector n1 and the second normal vector n2. Performing vector addition on the first normal vector n1, the second normal vector n2, and the cross product vector n3 yields the representation vector of the corresponding convex hull edge, n = n1 + n2 + n3.
[0067] The similarity between convex hull edges can be determined based on the angle between their representation vectors. For example, an angle threshold can be set between the representation vectors as the basis for judging whether the convex hull edges are similar or dissimilar. When the angle between two representation vectors is within the angle threshold range, the corresponding two convex hull edges are similar; when the angle between two representation vectors is outside the angle threshold range, the corresponding two convex hull edges are dissimilar.
[0068] In some implementations, reference Figure 3 As shown, classifying multiple convex hull edges based on similarity data between them to obtain multiple edge clusters can include the following steps.
[0069] S310. Select one of the multiple convex hull edges as the reference edge.
[0070] S320. Traverse multiple convex hull edges to determine the angle between the representation vector of each convex hull edge and the representation vector of the reference edge.
[0071] S330. Determine that the convex hull edge line corresponding to the included angle less than the first angle threshold and the reference edge line belong to the same edge line cluster.
[0072] The baseline edge can be used as the central element for constructing the edge cluster.
[0073] For example, based on the triangulation results of the aforementioned 3D convex hull, the normals of all triangular faces and the representation vectors of the convex hull edges are calculated. A first angle threshold is set, and classification rules for classifying the convex hull edges can be set according to the first angle threshold.
[0074]
[0075] In the triangulation results of the 3D convex hull, a convex hull edge is selected as the reference edge. Using the reference edge as the central element for constructing edge clusters, the remaining convex hull edges are traversed, and the angle between the representation vector of each remaining edge and the representation vector of the reference edge is calculated. According to the classification rules, convex hull edges with angles less than a first threshold are placed into the edge cluster of the reference edge. Convex hull edges with angles not meeting the first threshold condition are considered remaining convex hull edges and participate in the next traversal. When no convex hull edge meets the first threshold condition among the remaining edges, the current traversal ends, and the next traversal begins. This traversal process is repeated until all convex hull edges are classified into their corresponding edge clusters. From the resulting multiple edge clusters, specific edges can be extracted and used in the subsequent process of determining the local coordinate system.
[0076] It should be noted that the first angle threshold can be set according to the accuracy requirements of the bounding box calculation. In some embodiments, the first angle threshold can be taken in the range of 1° to 10°.
[0077] In some implementations, the specified edge lines are reference edge lines to represent the convex hull edge lines included in the edge line cluster. Combining multiple specified edge lines to obtain multiple edge line pairs may include: combining multiple reference edge lines pairwise to obtain multiple edge line pairs.
[0078] Specifically, during the traversal and classification of convex hull edges, the baseline edges selected in each traversal can be used as designated edges. By summing up all the baseline edges, a set of convex hull edges after similarity filtering can be obtained. By pairwise combining the baseline edges in this set, multiple edge pairs can be obtained, which are used to establish the target equation. By solving the target equation, the local coordinate system used to construct the candidate bounding box can be obtained.
[0079] In some embodiments, the reference coordinate system selected in each traversal can be retained as a specified edge, and other convex hull edges other than the reference edge can be removed from the edge cluster. By summing up all the reference edges, a set of convex hull edges after similarity filtering can be obtained.
[0080] In some implementations, reference Figure 4a As shown, the determination of multiple local coordinate systems may include the following steps.
[0081] S410. Based on the property that the normals of two adjacent faces of the bounding box are perpendicular to each other, the objective equation is established through multiple edge pairs.
[0082] It is understandable that adjacent faces of a bounding box are perpendicular to each other; therefore, the normals of adjacent faces are perpendicular to each other, and the product of the normal vectors of adjacent faces is 0. Based on the geometric properties of the minimum volume bounding box, the adjacent faces of the minimum volume bounding box corresponding to a 3D object coincide with the two convex hull edges of the corresponding 3D convex hull. Therefore, the normal vectors of the adjacent faces of the minimum volume bounding box can be linearly represented by the normal vectors of the two adjacent triangular faces of the corresponding convex hull edges. Assuming that the two convex hull edges in each edge pair coincide with the two adjacent faces of the bounding box, the normal vectors of the two adjacent faces of the bounding box can be linearly represented by the normal vectors of the adjacent triangular faces corresponding to the convex hull edges in the edge pair. Since the product of the normal vectors of adjacent faces of the bounding box is 0, the corresponding objective equation can be established.
[0083] For example, the normal vector of the first face of the bounding box that coincides with the convex hull edge L1 of the edge pair is N, and the convex hull edge L1 corresponds to an adjacent triangular facet P. 10 and triangular facet P 11 Triangular facet P 10 Corresponding to the normal vector N0 and the triangular patch P 11 There is a corresponding normal vector N1. The normal vector of the first face of the bounding box can be expressed as: N = a1N0 + b1N1, where a1 and b1 are weighting factors.
[0084] The normal vector of the second face of the bounding box that coincides with the convex hull line L2 is M, and the convex hull line L2 corresponds to an adjacent triangular facet P. 20 and triangular facet P 21 Triangular facet P 20 Corresponding to the normal vector M0 and the triangular patch P 21 There is a corresponding normal vector M1. The normal vector of the second face of the bounding box can be expressed as: M = a2M0 + b2M1, where a2 and b2 are weighting factors.
[0085] Since the product of the normal vectors of the first and second faces is 0, the objective equation can be established as follows:
[0086] F = N·M
[0087] =a1a2N0·M0+b1a2N1·M0+a1b2N0·M1+b1b2N1·M1
[0088] =a1a2f 00 +b1a2f 10 +a1b2f 01 +b1b2f 11
[0089] =0
[0090] Among them, f 00 =N0·M0,f 10 =N1·M0,f 01 =N0·M1,f 11 =N1·M1.
[0091] S420. Based on the multiple solution set vector pairs included in the solution set of the objective equation, determine multiple local coordinate systems.
[0092] The solution set vector pair includes a first vector and a second vector. The first vector is the normal vector of the first face among two adjacent faces of the bounding box, and the second vector is the normal vector of the second face among two adjacent faces of the bounding box.
[0093] It is understandable that, based on the geometric properties of the bounding box, the triangular facets corresponding to the convex hull edges are all contained within the bounding box, thus allowing us to obtain the geometric properties of the normal vectors corresponding to the first and second faces of the bounding box. For example, refer to... Figure 4b As shown, the first face of the bounding box has at most one triangular facet P that intersects with the convex hull edge L1. 10 Or triangular facet P 11 The extreme case of coincidence. Therefore, the normal vector N lies within the angle range between normal vectors N0 and N1, and there is at most one case where normal vector N coincides with either normal vector N0 or normal vector N1. Thus, the sum of weight factors a1 and b1 is 1, and the sum of weight factors a2 and b2 is also 1, with the values of a1, b1, a2, and b2 ranging from [0,1]. Therefore, the problem of obtaining the minimum volume bounding box is transformed into finding the solution set that satisfies the objective equation F = 0. This solution set includes all possible pairs of weight factors (a1, b1) and (a2, b2).
[0094] For example, based on the range of values for the weighting factor, according to f 00 f 10 f 01 f 11The value of can be positive, negative, or zero, and the objective equation can be solved in 81 different cases. It is understandable that the solution set of the objective equation for each case includes an infinite number of (a1, b1) and (a2, b2) pairs. Therefore, it is necessary to set a sampling number for the solution set of each case to obtain a subset of the solutions as candidate solutions for that case.
[0095] After solving the objective equation and obtaining candidate solution sets based on the number of samples, the corresponding values of (a1, b1) and (a2, b2) in the candidate solution sets are substituted into the linear expressions of normal N and normal M. This yields multiple solution set vector pairs consisting of normal vectors N and M, which are used to represent the normal vector combinations of two adjacent faces of multiple bounding boxes. A cross product is then performed on each solution set vector pair to obtain the cross product result vector for each pair. Based on each solution set vector pair and its corresponding cross product result vector, a combination of three mutually perpendicular vectors can be obtained. Based on these multiple direction vector combinations, multiple corresponding local coordinate systems can be constructed. In some embodiments, the origin of the local coordinate system can be established at the origin of the world coordinate system.
[0096] Furthermore, based on the constructed multiple local coordinate systems, bounding boxes corresponding to each local coordinate system can be obtained using a bounding box algorithm, serving as multiple candidate bounding boxes. The length, width, and height of each candidate bounding box can be determined to calculate its volume. The candidate bounding box with the smallest volume can be selected from these candidates as the minimum volume bounding box for the final output 3D object.
[0097] It should be noted that the number of samples can be set according to the accuracy requirements for calculating the bounding box.
[0098] In some embodiments, reference Figure 5 As shown, determining multiple local coordinate systems based on multiple solution set vector pairs included in the solution set of the objective equation may include the following steps.
[0099] S510. Based on the multiple solution set vector pairs included in the solution set, construct multiple initial coordinate systems to be selected.
[0100] S520. Based on the similarity data between the initial coordinate systems, multiple initial coordinate systems are filtered to obtain multiple local coordinate systems.
[0101] Among them, similar data can be used to measure the similarity between any two initial coordinate systems.
[0102] In some cases, the multiple local coordinate systems constructed from multiple solution set vector pairs may exhibit some similarity, meaning there may be local coordinate systems with similar orientations. It's understandable that bounding boxes calculated based on local coordinate systems with similar orientations are similar. Therefore, we can use the multiple local coordinate systems constructed from multiple solution set vector pairs as the initial coordinate system, and then filter them to remove coordinate systems with high orientation similarity, thereby reducing the number of bounding boxes that need to be calculated and improving the overall efficiency of the algorithm.
[0103] Specifically, after constructing multiple initial coordinate systems, the similarity between the initial coordinate systems can be determined based on the orientation of the three mutually perpendicular direction vectors used to construct the corresponding initial coordinate systems. Coordinate systems with greater similarity are eliminated, so as to finally obtain local coordinate systems with less similarity to each other, thus completing the screening of initial coordinate systems.
[0104] For example, for initial coordinate system C1, the three mutually perpendicular direction vectors used to construct the corresponding initial coordinate system are X1, Y1, and Z1; for initial coordinate system C2, the three mutually perpendicular direction vectors used to construct the corresponding initial coordinate system are X2, Y2, and Z2. The angles between direction vectors X1 and X2, Y1 and Y2, and Z1 and Z2 can be calculated to determine the similarity of the orientations of initial coordinate systems C1 and C2. If the angles between X1 and X2, Y1 and Y2, and Z1 and Z2 are small, then initial coordinate systems C1 and C2 are similar, and one can be selected as the final required local coordinate system. If the angles between X1 and X2, Y1 and Y2, and Z1 and Z2 are large, then initial coordinate systems C1 and C2 are dissimilar, and both initial coordinate systems C1 and C2 can be used as the final required local coordinate systems.
[0105] In some implementations, reference Figure 6 As shown, multiple initial coordinate systems are filtered based on similarity data between initial coordinate systems to obtain multiple local coordinate systems, which may include the following steps.
[0106] S610. Based on the similarity data between the initial coordinate systems, classify the multiple initial coordinate systems to obtain multiple coordinate system clusters.
[0107] Specifically, for the first and second initial coordinate systems in the coordinate system cluster, the angles between the three coordinate axes of the first initial coordinate system and the corresponding three coordinate axes of the second initial coordinate system are each less than a second angle threshold. The similarity data can be determined based on the angles between the three coordinate axes of any initial coordinate system and the corresponding three coordinate axes of any other initial coordinate system.
[0108] It is understandable that the initial coordinate system constructed based on three mutually perpendicular direction vectors has its three coordinate axes coinciding with the three direction vectors. Therefore, calculating the angles between the three coordinate axes in the first initial coordinate system and the corresponding three coordinate axes in the second initial coordinate system can be achieved by calculating the angles between the three direction vectors in the first initial coordinate system and the corresponding three direction vectors in the second initial coordinate system.
[0109] For example, a second angle threshold is set, and classification rules for classifying the initial coordinates can be set based on the second angle threshold:
[0110]
[0111] Based on the constructed initial coordinate systems, one initial coordinate system is selected as the reference coordinate system. Using the reference coordinate system as the central element of a coordinate system cluster, the remaining initial coordinate systems are traversed. The angles between the three direction vectors of each remaining initial coordinate system and the three direction vectors of the reference coordinate system are calculated. According to the classification rules, the initial coordinate systems corresponding to the angles where the angles between the three direction vectors are all less than the second angle threshold are placed in the coordinate system cluster of the reference coordinate system. The initial coordinate systems corresponding to the angles where the angles between the three direction vectors are not less than the second angle threshold are considered as remaining initial coordinate systems and participate in the next traversal. When no initial coordinate system among the remaining initial coordinate systems satisfies the condition that the angles between the three direction vectors are all less than the second angle threshold, the current traversal ends, and the next traversal begins. This traversal process is repeated until all initial coordinate systems are classified into their corresponding coordinate system clusters.
[0112] It should be noted that the second angle threshold can be set according to the accuracy requirements of the bounding box calculation. In some embodiments, the second angle threshold can be taken in the range of 1° to 10°.
[0113] S620. Retain the specified coordinate system in the coordinate system family as a local coordinate system.
[0114] The specified coordinate system can be a coordinate system obtained from a coordinate system cluster for calculating the bounding box, and can represent similar spatial features of the initial coordinate system in the corresponding coordinate system cluster.
[0115] Specifically, from the multiple coordinate system clusters obtained above, a specific coordinate system can be extracted and used in the subsequent calculation of the bounding box.
[0116] In some embodiments, during the traversal and classification of the initial coordinate system, the reference coordinate system selected in each traversal can be retained as the specified coordinate system, while other initial coordinate systems in the coordinate system cluster besides the reference coordinate system are removed. By summing up all the reference coordinate systems, multiple local coordinate systems after similarity filtering can be obtained.
[0117] Furthermore, based on the filtered local coordinate systems, bounding boxes corresponding to each local coordinate system can be obtained using a bounding box algorithm, serving as multiple candidate bounding boxes. The length, width, and height of each candidate bounding box can be determined to calculate its volume. The candidate bounding box with the smallest volume can be selected from these candidates as the minimum volume bounding box for the final output 3D object.
[0118] In some embodiments, to improve the efficiency of obtaining bounding boxes, the transformation relationship between the local coordinate system and the world coordinate system can be utilized to transform the 3D object in the local coordinate system along with the local coordinate system to the world coordinate system. A bounding box algorithm is then used to obtain candidate bounding boxes corresponding to the transformed local coordinate systems. By sequentially traversing and filtering multiple local coordinate systems as described above, candidate bounding boxes corresponding to each transformed local coordinate system can be obtained, and the volume of the corresponding candidate bounding box can be calculated. The candidate bounding box with the smallest volume is selected from the multiple candidate bounding boxes, and according to the transformation relationship between the local coordinate system and the world coordinate system corresponding to this bounding box, it is transformed back to the corresponding local coordinate system, which is then used as the minimum volume bounding box of the final output 3D object. In some embodiments, the bounding box algorithm can be an axial parallel bounding box algorithm.
[0119] In the above embodiments, by performing similarity screening on the initial coordinate system, the number of local coordinate systems used to obtain candidate bounding boxes is greatly reduced, which can avoid the repeated calculation of similar bounding boxes and reduce the number of candidate bounding boxes, thus greatly improving the overall efficiency of the bounding box determination method.
[0120] In some implementations, the edge pair includes a first edge and a second edge. (See reference...) Figure 7a As shown, based on the property that the normals of two adjacent faces of the bounding box are perpendicular to each other, the objective equation can be established by multiple edge pairs, which may include the following steps.
[0121] S710. Based on the normal vectors of the two triangular faces sharing the first edge, construct the first normal vector to be solved for the first face.
[0122] Specifically, the two triangular faces sharing the first edge are triangular face F. 10 and triangular face F 11 Triangular facet F 10 Corresponding to the normal vector N0 and the triangular facet F11 There is a corresponding normal vector N1. The first normal vector N to be solved for the first face is constructed using normal vectors N0 and N1. For example, N = a1N0 + b1N1, where a1 and b1 are weighting factors.
[0123] S720. Based on the normal vectors of the two triangular faces sharing the second edge, construct the second normal vector of the second face to be solved.
[0124] Specifically, the two triangular faces sharing the first edge are triangular face F. 20 and triangular face F 21 Triangular facet F 20 Corresponding to the normal vector M0 and the triangular facet F 21 There is a corresponding normal vector M1. The second normal vector M of the second face is constructed using normal vectors M0 and M1. For example, M = a2M0 + b2M1, where a2 and b2 are weighting factors.
[0125] S730. Based on the property that the normals of two adjacent faces of the bounding box are perpendicular to each other, the first normal vector to be solved, and the second normal vector to be solved, establish the objective equation.
[0126] Specifically, based on the characteristic that the normals of two adjacent faces of the bounding box are perpendicular to each other, it can be known that the product of the normal vector of the first face of the bounding box and the normal vector of the second face is 0. Therefore, using the first normal vector N to be solved and the second normal vector M to be solved, the objective equation F = N·M = 0 can be established.
[0127] In the above embodiments, by combining the inherent geometric characteristics of the minimum volume bounding box to establish the objective equation and solving the objective equation to obtain the local coordinate system of the candidate bounding box, the accuracy and precision of the finally obtained bounding box can be improved, and it can approximately reach the theoretical minimum.
[0128] In some implementations, reference Figure 7b As shown, constructing the first normal vector of the first face based on the normal vectors of the two triangular faces sharing the first edge can include the following steps:
[0129] S712. Based on the normal vectors of the two triangular faces sharing the first edge, determine the first normal vector pair; and use the first normal vector pair to construct the first normal vector to be solved for the first face.
[0130] Specifically, the first face corresponds to the first weighting factor. The first normal vector to be solved can be constructed using the first normal vector pair and the first weighting factor. The first weighting factor can be used to represent the angle of the first normal vector to be solved within the included angle range of the first normal vector pair.
[0131] Specifically, the two triangular faces sharing the first edge are triangular face F. 10 and triangular face F 11 Triangular facet F 10 Corresponding to the normal vector N0 and the triangular facet F 11 There is a corresponding normal vector N1. A first normal vector pair is constructed using normal vectors N0 and N1. Based on the geometric properties of the first normal vector N to be solved, a weighting factor s can be set for the first normal vector pair. The constructed first normal vector N to be solved can be linearly expressed as: N = (1-s)N0 + sN1, where the weighting factor s ∈ [0,1].
[0132] Constructing the second normal vector of the second face based on the normal vectors of the two triangular faces sharing the second edge can include the following steps:
[0133] S722. Based on the normal vectors of the two triangular faces sharing the second edge, determine the second normal vector pair; and use the second normal vector pair to construct the second normal vector to be solved for the second face.
[0134] The second face corresponds to the second weighting factor. Specifically, the second normal vector of the second face can be constructed using the second normal vector pair and the second weighting factor. The second weighting factor can be used to represent the angle within the included angle range of the second normal vector pair.
[0135] Specifically, the two triangular faces sharing the second side are triangular face F. 20 and triangular face F 21 Triangular facet F 20 Corresponding to the normal vector M0 and the triangular facet F 21 There is a corresponding normal vector M1. A second normal vector pair is constructed using normal vectors M1 and M2. Based on the geometric properties of the second normal vector M to be solved, a weight factor t can be set for the second normal vector pair. The constructed second normal vector M to be solved can be linearly expressed as: M = (1-t)M0 + tM1, where the weight factor t ∈ [0,1].
[0136] Furthermore, based on the fact that the product of the first and second normal vectors is 0, the objective equation can be established as follows:
[0137] F(s,t)=N·M
[0138] =(1-s)(1-t)N0·M0+s(1-t)N1·M0+(1-s)tN0·M1+stN1·M1
[0139] =(1-s)(1-t)f 00+s(1-t)f 10 +(1-s)tf 01 +stf 11
[0140] =0
[0141] Based on the range of values for s and t [0,1], according to f 00 f 10 f 01 f 11 The value of can be positive, negative, or zero, and the objective equation can be discussed and solved in 81 different cases.
[0142] For example, when f 00 f 10 f 01 f 11 When all values of s and t are zero, the objective equation F(s,t) = 0 always holds. Therefore, all values of s and t in the interval [0,1] are solutions to the objective equation. A partial solution set can be obtained from the corresponding solution set as a candidate solution set based on the number of samples.
[0143] For example, when f 00 For negative numbers, f 10 zero, f 01 For positive numbers, f 11 When the value is zero, the objective equation is F(s,t)=(1-s)(1-t)f 00 +(1-s)tf 01 =(1-s)(f 00 -tf 00 +tf 01 When s = 1, the objective equation F(s,t) = 0 always holds true, and t can be any value within the interval [0,1]. When , the objective equation F(s,t)=0 always holds true, and s can take any value within the interval [0,1]. Therefore, The values on the two line segments corresponding to s=1 are all solutions to the objective equation. Based on the number of samples, a partial solution set can be obtained from the corresponding solution set as a candidate solution set.
[0144] For example, when f 00 zero, f 10 For positive numbers, f 01 For negative numbers, f 11 When the value is zero, the objective equation is F(s,t)=s(1-t)f 10 +(1-s)tf 01When s = 0 and t = 0, the objective equation F(s,t) = 0 always holds true; when s = 1 and t = 1, the objective equation F(s,t) = 0 always holds true. Therefore, the values of s and t on the line segment formed by endpoints (0,0) and (1,1) all satisfy the condition that the objective equation is zero. Any value on this line segment is a solution to the objective equation, and a partial solution set can be obtained from the corresponding solution set as a candidate solution set based on the number of samples.
[0145] For example, when f 00 For negative numbers, f 10 For positive numbers, f 01 zero, f 11 When the value is positive, the objective equation is F(s,t)=(1-s)(1-t)f 00 +s(1-t)f 10 +stf 11 When s = 0 and t = 1, the objective equation F(s,t) = 0 always holds; when At t = 0, the objective equation F(s,t) = 0 always holds. Therefore, using (0,1) and... The values of s and t on the line segment formed by the endpoints all satisfy the condition that the objective equation is zero. Any value on this line segment is a solution to the objective equation. A partial solution set can be obtained from the corresponding solution set as a candidate solution set based on the number of samples.
[0146] It should be noted that the solution process for the objective equation in the remaining 77 cases is similar to the process described above, and will not be repeated here.
[0147] After solving the objective equation and obtaining the candidate solution set based on the number of samples, the corresponding values of (s, t) in the candidate solution set are substituted into the linear expressions of the first normal vector N and the second normal vector M to obtain the solution set of the objective equation, which consists of multiple solution set vector pairs composed of the first normal vector N and the second normal vector M.
[0148] In some implementations, the first face corresponds to a first weighting factor, and the second face corresponds to a second weighting factor. Constructing the first normal vector to be solved for the first face using the first normal vector pair can include: constructing the first normal vector to be solved using the first normal vector pair and the first weighting factor.
[0149] Constructing the second normal vector of the second face using the second normal vector pair can include: constructing the second normal vector of the second face using the second normal vector pair and the second weighting factor.
[0150] In some embodiments, to facilitate the acquisition of the corresponding local coordinate system based on the solved first and second normal vectors, the first and second normal vectors can be unit vectors. Specifically, the first normal vector N constructed using the first normal vector pair and the first weighting factor can be expressed as: s∈[0,1]; the second normal vector M to be solved, constructed using the second normal vector pair and the second weight factor, can be expressed as: t∈[0,1].
[0151] In some implementations, the solution set of the objective equation is determined within the first weight range of the first weight factor and the second weight range of the second weight factor.
[0152] Specifically, based on the objective equation, the problem of obtaining the minimum volume bounding box can be transformed into finding a solution set that satisfies the objective equation F(s,t) = 0. This solution set includes all possible pairs of weight factors (s,t). Since the first face of the bounding box has a limit of coinciding with at most one of the two triangular faces sharing the first edge, and the second face has a limit of coinciding with at most one of the two triangular faces sharing the second edge, the normal vector of the first face is within the angle range of the first normal vector pair, and the normal vector of the second face is within the angle range of the second normal vector pair. Since the weight factors can represent the angle of the normal vector to be solved within the angle range of the corresponding normal vector pair, the corresponding first weight factor has a first weight value range, and the second weight factor has a second weight value range. It is understandable that the solution set of the objective equation needs to be determined by the first weight value range of the first weight factor and the second weight value range of the second weight factor.
[0153] This specification provides a method for determining the bounding box of a three-dimensional object, referencing... Figure 8 As shown, the method may include the following steps.
[0154] S810. Obtain the triangulation result of the 3D convex hull of the 3D object. The triangulation result includes multiple triangular faces; the common edge of two adjacent triangular faces is the convex hull edge of the 3D convex hull.
[0155] S820. Classify multiple convex hull edges based on the similarity data between them to obtain multiple edge clusters. Each edge cluster corresponds to a specified edge.
[0156] S830. Combine multiple specified edge lines to obtain multiple edge line pairs.
[0157] S840. Based on the property that the normals of two adjacent faces of the bounding box are perpendicular to each other, the objective equation is established through multiple edge pairs.
[0158] S850. Based on the multiple solution set vector pairs included in the solution set of the objective equation, construct multiple initial coordinate systems to be selected. The solution set vector pairs include a first vector and a second vector, where the first vector is the normal vector of the first face among two adjacent faces of the bounding box, and the second vector is the normal vector of the second face among two adjacent faces of the bounding box.
[0159] S860. Based on the similarity data between the initial coordinate systems, multiple initial coordinate systems are filtered to obtain multiple local coordinate systems.
[0160] S870. Among the multiple candidate bounding boxes corresponding to multiple local coordinate systems, the candidate bounding box whose volume meets the bounding box screening criteria is determined as the target bounding box of the 3D object.
[0161] For example, taking the point cloud of a 3D object as input, the 3D convex hull of the point cloud can first be obtained through the 3D convex hull calculation algorithm of the third-party library Qhull. Secondly, the vertex set of the 3D convex hull can be taken as input, and the triangulation result of the 3D convex hull vertex can be obtained through the triangulation algorithm of the third-party library Qhull.
[0162] Based on the obtained triangulation results, the normal vectors of all triangular faces are calculated, as well as the cross product vector of the two normal vectors of two adjacent triangular faces sharing a convex hull edge. The representation vector of the convex hull edge can be calculated based on the two normal vectors and their corresponding cross product vectors of two adjacent triangular faces. A first angle threshold is set, and a baseline edge is selected from the convex hull edges. The remaining convex hull edges are then traversed. The similarity between the remaining convex hull edges and the baseline edge is determined based on the angle between their representation vectors and the baseline edge. Convex hull edges with angles less than the first angle threshold are placed into the edge cluster containing the baseline edge. This traversal process is repeated, resulting in multiple classified edge clusters. The baseline edge in each edge cluster is then used as a specified edge for aggregation, resulting in convex hull edges filtered for similarity. Pairwise combinations of the filtered convex hull edges yield multiple edge pairs.
[0163] Based on the geometric property that the two adjacent faces of the minimum volume bounding box corresponding to a 3D object coincide with the two convex hull edges of the corresponding 3D convex hull, assuming that the two convex hull edges in each edge pair coincide with the two adjacent faces of the bounding box, the normal vectors of the two adjacent faces of the bounding box can be linearly represented by the normal vectors and weight factors of the adjacent triangular faces corresponding to the convex hull edges in the edge pair. Since the product of the normal vectors of the two adjacent faces of the bounding box is 0, the corresponding objective equation can be established, transforming the problem of obtaining the minimum volume bounding box into the problem of finding a solution set that satisfies the objective equation equal to 0.
[0164] Solving the objective equation yields a set of weighting factors representing the normal vectors of two adjacent faces of the bounding box, thus providing solution vector pairs for these pairs. Performing a cross product on each solution vector pair yields the cross product result vector for each pair. Based on each solution vector pair and its corresponding cross product result vector, a combination of three mutually perpendicular direction vectors can be obtained. Multiple initial coordinate systems can be constructed based on these direction vector combinations.
[0165] A second angle threshold is set. Based on the multiple initial coordinate systems constructed, one initial coordinate system is selected as the reference coordinate system. Using the reference coordinate system as the central element of a coordinate system cluster, the remaining initial coordinate systems are traversed, and the angles between the three direction vectors of each remaining initial coordinate system and the three direction vectors of the reference coordinate system are calculated. Initial coordinate systems with angles smaller than the second angle threshold are placed into the coordinate system cluster containing the reference coordinate system. This traversal process is repeated, resulting in multiple classified coordinate system clusters. The reference coordinate system in each cluster is then used as the designated coordinate system for aggregation, resulting in multiple local coordinate systems after similarity filtering.
[0166] Based on the filtered local coordinate systems, bounding boxes are obtained for each local coordinate system using a bounding box algorithm. These are then used as candidate bounding boxes, and the length, width, and height of each candidate bounding box can be determined to calculate its volume. The candidate bounding box with the smallest volume is selected from these candidate bounding boxes as the target bounding box for the final output 3D object.
[0167] This specification provides a three-dimensional object bounding box determination device, with reference to... Figure 9 As shown, the three-dimensional object bounding box determination device 900 may include: a triangulation result acquisition module 910, a classification processing module 920, a combination module 930, and a determination module 940.
[0168] The triangulation result acquisition module 910 is used to acquire the triangulation result of the 3D convex hull of a 3D object. The triangulation result includes multiple triangular faces; the common edge of two adjacent triangular faces is the convex hull edge.
[0169] The classification processing module 920 is used to classify multiple convex hull edges based on the similarity data between them, resulting in multiple edge clusters. Each edge cluster corresponds to a specified edge.
[0170] The combination module 930 is used to combine multiple specified edges to obtain multiple edge pairs.
[0171] The determination module 940 is used to determine the candidate bounding box whose volume meets the bounding box screening criteria as the target bounding box of the 3D object from among the multiple candidate bounding boxes corresponding to multiple local coordinate systems determined by multiple edge pairs.
[0172] Specific limitations regarding the 3D object bounding box determination device can be found in the limitations of the 3D object bounding box determination method described above, and will not be repeated here. Each module in the aforementioned 3D object bounding box determination device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0173] This specification also provides a computer device, see embodiments thereof. Figure 10 As shown, the computer device 1000 includes a memory 1010, a processor 1020, and a computer program 1030 stored in the memory 1010 and executable on the processor 1020. When the processor 1020 executes the computer program 1030, it implements the three-dimensional object bounding box determination method of any of the aforementioned embodiments.
[0174] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the three-dimensional object bounding box determination method of any of the foregoing embodiments.
[0175] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0176] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0177] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0178] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0179] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0180] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for determining the bounding box of a three-dimensional object, characterized in that, The method includes: Obtain the triangulation result of the three-dimensional convex hull of the three-dimensional object; wherein, the triangulation result includes multiple triangular facets; the common edge of two adjacent triangular facets is the convex hull edge line of the three-dimensional convex hull; Multiple convex hull edges are classified based on the similarity data between them to obtain multiple edge clusters; wherein each edge cluster corresponds to a specified edge; and the similarity data between the convex hull edges is determined by the angle between the representation vectors of the convex hull edges, and the similarity data between the convex hull edges is used to measure the similarity between any two convex hull edges. Multiple specified edge lines are combined to obtain multiple edge line pairs; Among the multiple candidate bounding boxes corresponding to the multiple local coordinate systems determined by the multiple edge pairs, the candidate bounding box whose volume satisfies the bounding box screening condition is determined as the target bounding box of the three-dimensional object. The process of classifying the multiple convex hull edges based on the similarity data between them yields multiple edge clusters, including: Select one of the plurality of convex hull edges as the reference edge; Traverse the plurality of convex hull edges to determine the angle between the representation vector of each convex hull edge and the representation vector of the reference edge; Determine the convex hull edge line corresponding to the included angle that is less than the first angle threshold, and determine that the reference edge line belongs to the same edge line family; The methods for determining the multiple local coordinate systems include: Based on the property that the normals of two adjacent faces of the bounding box are perpendicular to each other, the target equation is established through multiple edge pairs; Multiple local coordinate systems are determined based on multiple solution set vector pairs included in the solution set of the objective equation; wherein, the solution set vector pair includes a first vector and a second vector, the first vector being the normal vector of the first face among two adjacent faces of the bounding box, and the second vector being the normal vector of the second face among two adjacent faces of the bounding box.
2. The method of claim 1, wherein, The two adjacent triangular facets include a first triangular facet and a second triangular facet; the generation method of the representation vector of the convex hull edge includes: Using the first normal vector of the first triangular facet and the second normal vector of the second triangular facet, determine the cross product vector of the first normal vector and the second normal vector; The representation vector of the convex hull is generated based on the first normal vector, the second normal vector, and the cross product vector.
3. The method of claim 1, wherein, The specified edge line adopts the reference edge line to represent the convex hull edge line included in the edge line cluster; the combination of multiple specified edge lines to obtain multiple edge line pairs includes: The multiple reference edges are combined in pairs to obtain the multiple edge pairs.
4. The method of claim 1, wherein, The step of determining multiple local coordinate systems based on multiple solution set vector pairs included in the solution set of the objective equation includes: Based on the multiple solution set vector pairs included in the solution set, construct multiple initial coordinate systems to be screened; The multiple initial coordinate systems are filtered based on the similarity data between the initial coordinate systems to obtain the multiple local coordinate systems.
5. The method of claim 4, wherein, The step of filtering multiple initial coordinate systems based on similarity data between the initial coordinate systems to obtain multiple local coordinate systems includes: Based on the similarity data between the initial coordinate systems, multiple initial coordinate systems are classified to obtain multiple coordinate system clusters; wherein, for the first initial coordinate system and the second initial coordinate system in the coordinate system cluster, the angles between the three coordinate axes of the first initial coordinate system and the corresponding three coordinate axes of the second initial coordinate system are respectively less than the second angle threshold. A designated coordinate system within the coordinate system family is retained as the local coordinate system.
6. The method of claim 1, wherein, The edge pair includes a first edge and a second edge; the establishment of the target equation based on the perpendicularity of the normals of two adjacent faces of the bounding box through multiple edge pairs includes: Based on the normal vectors of the two triangular facets sharing the first edge, the first normal vector of the first face is constructed to be solved. Based on the normal vectors of the two triangular facets sharing the second edge, construct the second normal vector of the second face to be solved; The objective equation is established based on the perpendicularity of the normals of two adjacent faces of the bounding box, the first normal vector to be solved, and the second normal vector to be solved.
7. The method of claim 6, wherein, The construction of the first normal vector to be solved for the first face based on the normal vectors of the two triangular facets sharing the first edge includes: Based on the normal vectors of the two triangular faces that share the first edge, a first normal vector pair is determined; and using the first normal vector pair, the first normal vector to be solved for the first face is constructed. The construction of the second normal vector of the second face based on the normal vectors of the two triangular facets sharing the second edge includes: Based on the normal vectors of the two triangular faces sharing the second edge, a second normal vector pair is determined; and using the second normal vector pair, a second normal vector to be solved for the second face is constructed.
8. The method of claim 7, wherein, The first face corresponds to a first weighting factor, and the second face corresponds to a second weighting factor; the step of constructing the first unsolved normal vector of the first face using the first normal vector pair includes: The first normal vector to be solved is constructed using the first normal vector pair and the first weight factor; The step of constructing the second unsolved normal vector of the second face using the second normal vector pair includes: Using the second normal vector pair and the second weighting factor, the second normal vector to be solved for the second surface is constructed.
9. The method of claim 8, wherein, The solution set of the objective equation is determined within the first weight value range of the first weight factor and the second weight value range of the second weight factor.
10. A three-dimensional object bounding box determination apparatus adapted to control the three-dimensional object bounding box determination method according to any one of claims 1 to 9, characterized by The device includes: The triangulation result acquisition module is used to acquire the triangulation result of the three-dimensional convex hull of the three-dimensional object; wherein, the triangulation result includes multiple triangular facets; the common edge of two adjacent triangular facets is the convex hull edge line of the three-dimensional convex hull; The classification processing module is used to classify the multiple convex hull edges according to the similarity data between the convex hull edges to obtain multiple edge clusters; wherein, each edge cluster corresponds to a specified edge. The combination module is used to combine multiple specified edge lines to obtain multiple edge line pairs; The determination module is used to determine the candidate bounding box whose volume meets the bounding box screening conditions as the target bounding box of the three-dimensional object from among the candidate bounding boxes corresponding to the multiple local coordinate systems determined by the multiple edge pairs. 11.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-10. When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.
12. A computer readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.