Leaf Vein Determination Method, Device, Electronic Device, and Storage Medium
By determining the edge edges and vertex sequences of the leaf model and combining the shortest paths of the characteristic points of the leaf veins, the problem that the existing technology cannot determine the leaf veins of the leaf model through the vertex coordinates is solved, and an effective simulation of the withering and deformation of the leaf model is achieved.
Patent Information
- Application Number
- CN202211635718.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-19
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2042-12-19
AI Technical Summary
The prior art cannot determine the leaf veins in the leaf model through the vertex coordinates of multiple triangle faces of the leaf model, and it is difficult to effectively simulate the process of withering and deformation of the leaf model.
By obtaining the vertex coordinates of multiple triangle faces of the leaf model, the unique edges in the triangle face are determined, and multiple edge edges are obtained; then the edge vertex sequence is determined based on the edge edge; then the leaf vein characteristic points is determined based on the edge vertex sequence; finally, the shortest path between the leaf vein characteristic points and petiole points is determined as the leaf vein of the leaf model.
The veins in the leaf model corresponding to the radial leaves are realized based on the vertex coordinates of multiple triangle faces of the leaf model, which can effectively simulate the withering and deformation process of the leaf model.
Smart Images

Figure CN115861353B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of three-dimensional models, and specifically, to a method, device, electronic device, and storage medium for determining leaf veins. Background Art
[0002] For a leaf model in a three-dimensional model, such as a leaf model corresponding to a radially arranged leaf, during the process of simulating the withering and deformation of the leaf model, the leaf veins, as the "skeleton" of the leaf, play a decisive role in the overall posture of the leaf. Among them, the main component of the leaf veins is the vascular bundle, and the vascular bundle contains a large number of radial fiber structures, so that during the process of leaf dehydration and deformation, compared with other leaf cells, the deformation amplitude and speed of the leaf veins are smaller. Therefore, to effectively simulate the process of withering and deformation of the leaf model, it is necessary to pre-determine the positions of the leaf veins in the leaf model. However, in the related art, the leaf veins in the leaf model cannot be determined based on the vertex coordinates of multiple triangular faces of the leaf model. Summary of the Invention
[0003] The purpose of the present disclosure is to provide a method, device, electronic device, and storage medium for determining leaf veins, which determine the unique edges in the triangular faces according to the vertex coordinates of multiple triangular faces of the leaf model, and obtain multiple edge edges of the leaf model; then determine the edge vertex sequence according to the multiple edge edges; and then determine the leaf vein feature points according to the edge vertex sequence; finally, determine the shortest path between the leaf vein feature points and the petiole point as the leaf veins of the leaf model; thereby being able to determine the leaf veins in the leaf model corresponding to the radially arranged leaf based on the vertex coordinates of multiple triangular faces of the leaf model.
[0004] According to the first aspect of the embodiments of the present disclosure, a method for determining leaf veins is provided, including:
[0005] Obtain the vertex coordinates of multiple triangular faces that make up the leaf model;
[0006] According to the vertex coordinates of the multiple triangular faces, determine multiple edge edges of the leaf model, and each edge edge is a unique edge in one of the triangular faces;
[0007] Sort the edge vertices of the multiple edge edges in sequence according to the connection order of the edge edges to obtain an edge vertex sequence;
[0008] For any edge vertex in the edge vertex sequence, if the distances from the multiple edge vertices adjacent to the front and back of the edge vertex to the petiole point are both smaller than the distance from the edge vertex to the petiole point, determine that the edge vertex is a leaf vein feature point;
[0009] Determine the shortest path between the leaf vein feature point and the petiole point as the leaf veins of the leaf model.
[0010] Optionally, the step of determining multiple edge edges of the leaf model according to the vertex coordinates of the multiple triangular faces includes:
[0011] For any triangular edge that constitutes any triangular face, if the vertex coordinates of the two vertices of the triangular edge are not the same as the vertex coordinates of the two vertices of any triangular edge of any other triangular face, determine that the triangular edge of the triangular face is an edge edge of the leaf model;
[0012] Traverse all triangular edges that constitute all triangular faces of the leaf model to obtain multiple edge edges of the leaf model.
[0013] Optionally, before the step of, for any triangular edge that constitutes any triangular face, if the vertex coordinates of the two vertices of the triangular edge are not the same as the vertex coordinates of the two vertices of any triangular edge of any other triangular face, determining that the triangular edge of the triangular face is an edge edge of the leaf model, the method further includes:
[0014] According to the vertex coordinates of the multiple triangular faces, determine the triangular edges that constitute each triangular face and the vertex coordinates of the two vertices that constitute each triangular edge.
[0015] Optionally, the step of sequentially sorting the edge vertices of the multiple edge edges according to the connection order of the edge edges to obtain an edge vertex sequence includes:
[0016] Establish an original sequence with an empty initial content;
[0017] Determine a first sequence point among the edge vertices of the multiple edge edges, where the first sequence point is the edge vertex with the smallest distance from the petiole point among the edge vertices of the multiple edge edges;
[0018] Put the first sequence point into the original sequence as the tail point of the original sequence;
[0019] Loop and perform the following operations: put another edge vertex that is on the same edge edge as the tail point that was most recently put into the original sequence into the original sequence as the new tail point until there are no edge vertices among the edge vertices of the multiple edge edges that have not been put into the original sequence, to obtain the edge vertex sequence.
[0020] Optionally, before the step of determining a first sequence point among the edge vertices of the multiple edge edges, where the first sequence point is the edge vertex with the smallest distance from the petiole point among the edge vertices of the multiple edge edges, the method further includes:
[0021] Obtain the coordinates corresponding to the petiole point and the vertex coordinates corresponding to each edge vertex of the multiple edge edges;
[0022] Determine the distance between each edge vertex and the petiole point according to the coordinates corresponding to the petiole point and the vertex coordinates corresponding to each edge vertex of the multiple edge edges.
[0023] Optionally, the method further includes:
[0024] In response to a specified operation by the user on the petiole point on the vein model, identify the specified petiole point to obtain the coordinates of the petiole point.
[0025] Optionally, for any edge vertex in the edge vertex sequence, if the distances from multiple edge vertices adjacent to the front and back of the edge vertex to the petiole point are both smaller than the distance from the edge vertex to the petiole point, the step of determining the edge vertex as a vein feature point includes:
[0026] Establish a sliding window with a width of 2K + 1, where K is an integer greater than 0;
[0027] Slide the sliding window on the edge vertex sequence. Each time after sliding, the sliding window includes 2K + 1 edge vertices, and at least part of the edge vertices included in the sliding window after each sliding are the same as those in the sliding window after the previous sliding;
[0028] For each position of the sliding window, determine the distance from each edge vertex in the sliding window to the petiole point;
[0029] Determine the edge vertex that meets the following conditions as the vein feature point: the distance from the edge vertex to the petiole point is greater than the distances from the K edge vertices before the edge vertex to the petiole point and greater than the distances from the K edge vertices after the edge point to the petiole point.
[0030] According to a second aspect of the embodiments of the present disclosure, there is provided a vein determination device, including:
[0031] An acquisition module configured to acquire the vertex coordinates of multiple triangular faces constituting a leaf model;
[0032] A first determination module configured to determine multiple edge edges of the leaf model according to the vertex coordinates of the multiple triangular faces, and each of the edge edges is a unique edge in one of the triangular faces;
[0033] A sorting module configured to sort the edge vertices of the multiple edge edges in sequence according to the connection order of the edge edges to obtain an edge vertex sequence;
[0034] A second determination module, configured to, for any edge vertex in the edge vertex sequence, if the distances from multiple edge vertices adjacent to the front and back of the edge vertex to the petiole point are all smaller than the distance from the edge vertex to the petiole point, determine the edge vertex as a vein feature point;
[0035] A third determination module, configured to determine the shortest path between the vein feature point and the petiole point as the vein of the leaf model.
[0036] Optionally, the first determination module includes:
[0037] A first determination sub-module, configured to, for any triangular edge constituting any triangular face, if the vertex coordinates of the two vertices of the triangular edge are not the same as the vertex coordinates of the two vertices of any triangular edge of any other triangular face, determine the triangular edge of the triangular face as an edge of the leaf model;
[0038] An acquisition sub-module, configured to traverse all triangular edges constituting all triangular faces of the leaf model to obtain multiple edges of the leaf model.
[0039] Optionally, the apparatus further includes:
[0040] A fourth determination module, configured to determine the triangular edges constituting each triangular face and the vertex coordinates of the two vertices constituting each triangular edge according to the vertex coordinates of the multiple triangular faces.
[0041] Optionally, the sorting module includes:
[0042] A first establishment sub-module, configured to establish an original sequence with an empty initial content;
[0043] A second determination sub-module, configured to determine a first sequence point among the edge vertices of the multiple edges, where the first sequence point is the edge vertex with the smallest distance to the petiole point among the edge vertices of the multiple edges;
[0044] A placement sub-module, configured to place the first sequence point into the original sequence as the tail point of the original sequence;
[0045] A loop sub-module, configured to loop through the following operations: place another edge vertex on the same edge as the most recently placed tail point in the original sequence into the original sequence as the new tail point until there are no edge vertices among the edge vertices of the multiple edges that have not been placed into the original sequence, to obtain the edge vertex sequence.
[0046] Optionally, the apparatus further includes:
[0047] An obtaining subunit, configured to obtain the coordinates corresponding to the petiole point and the vertex coordinates corresponding to each edge vertex of the plurality of edge edges;
[0048] A determining subunit, configured to determine the distance between each edge vertex and the petiole point according to the coordinates corresponding to the petiole point and the vertex coordinates corresponding to each edge vertex of the plurality of edge edges.
[0049] Optionally, the apparatus further includes:
[0050] An obtaining module, configured to identify the specified petiole point in response to a specified operation of the user on the petiole point on the vein model, and obtain the coordinates of the petiole point.
[0051] Optionally, the second determining module includes:
[0052] A second establishing sub-module, configured to establish a sliding window with a width of 2K + 1, where K is an integer greater than 0;
[0053] A sliding sub-module, configured to slide the sliding window on the edge vertex sequence, where each sliding window includes 2K + 1 edge vertices, and at least part of the edge vertices included in the sliding window after each sliding are the same as the edge vertices included in the sliding window after the previous sliding;
[0054] A third determining sub-module, configured to determine the distance from each edge vertex in the sliding window to the petiole point for each position of the sliding window;
[0055] A fourth determining sub-module, configured to determine the edge vertex that meets the following conditions as the vein feature point: the distance from the edge vertex to the petiole point is greater than the distance from the K edge vertices before the edge vertex to the petiole point, and greater than the distance from the K edge vertices after the edge point to the petiole point.
[0056] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, including:
[0057] A memory, on which a computer program is stored;
[0058] A processor, configured to execute the computer program in the memory to implement the steps of the vein determination method described in the first aspect above.
[0059] According to a fourth aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of the vein determination method described in the first aspect above are implemented.
[0060] Through the above technical solution, by determining the unique edges in the triangular faces according to the vertex coordinates of the multiple triangular faces that make up the leaf model, multiple edge edges of the leaf model are obtained; and an edge vertex sequence is determined according to the multiple edge edges; then vein feature points are determined according to the edge vertex sequence; and finally, the shortest path between the vein feature points and the petiole point is determined as the vein of the leaf model. Thus, it is possible to determine the vein in the leaf model corresponding to the radially-shaped leaf based on the vertex coordinates of the multiple triangular faces of the leaf model.
[0061] Other features and advantages of the present disclosure will be described in detail in the following specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The accompanying drawings are used to provide a further understanding of the present disclosure, and constitute a part of the specification, and are used to explain the present disclosure together with the following specific implementation, but do not constitute a limitation to the present disclosure. In the accompanying drawings:
[0063] Figure 1 is a flowchart of a vein determination method shown according to an exemplary embodiment.
[0064] Figure 2 is a flowchart of a method for determining edge edges shown according to an exemplary embodiment.
[0065] Figure 3 is a flowchart of a method for determining an edge vertex sequence shown according to an exemplary embodiment.
[0066] Figure 4 is a flowchart of a method for determining vein feature points shown according to an exemplary embodiment.
[0067] Figure 5 is a schematic diagram of vein feature points of a vein model shown according to an exemplary embodiment.
[0068] Figure 6 is a block diagram of a vein determination device shown according to an exemplary embodiment.
[0069] Figure 7 is a block diagram of an electronic device shown according to an exemplary embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0070] The following will describe in detail the specific implementation of the present disclosure in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only for the purpose of illustrating and explaining the present disclosure, and is not used to limit the present disclosure.
[0071] For the leaf model in the three-dimensional model, such as the leaf model corresponding to radially arranged leaves, during the process of simulating the withering and deformation of the leaf model, the leaf veins, as the "skeleton" of the leaves, play a decisive role in the overall posture of the leaves. Among them, the main component of the leaf veins is the vascular bundle, and the vascular bundle contains a large number of radial fiber structures, so that during the process of leaf dehydration and deformation, compared with other leaf cells, the deformation amplitude and speed of the leaf veins are smaller. Therefore, to effectively simulate the process of withering and deformation of the leaf model, it is necessary to pre-determine the positions of the leaf veins in the leaf model. In the related technology, the leaf veins in the leaf model cannot be determined through the vertex coordinates of multiple triangular faces of the leaf model.
[0072] To solve the above technical problems, for radially arranged leaves, the main leaf veins of the leaves start from the petiole point of the leaf blade and extend outward to the edge of the leaf blade. According to the structural characteristics of the leaf veins, for the leaf model corresponding to radially arranged leaves, a leaf vein determination method, device, electronic device and storage medium are proposed. The leaf vein determination method determines the unique edges in the triangular faces according to the vertex coordinates of multiple triangular faces of the leaf model, and obtains multiple edge edges of the leaf model; and determines the edge vertex sequence according to the multiple edge edges; then determines the leaf vein feature points according to the edge vertex sequence; finally, determines the shortest path between the leaf vein feature points and the petiole point as the leaf veins of the leaf model. Thus, it is possible to determine the leaf veins in the leaf model corresponding to radially arranged leaves based on the vertex coordinates of multiple triangular faces of the leaf model.
[0073] Figure 1 is a flowchart of a leaf vein determination method shown according to an exemplary embodiment. As Figure 1 shown, the method may include the following steps:
[0074] In step S101, obtain the vertex coordinates of multiple triangular faces that make up the leaf model.
[0075] In this embodiment, for a three-dimensional model with an irregular shape, it is composed of multiple triangular faces. The smaller the triangular faces that make up the three-dimensional model, the more realistic the three-dimensional model. Among them, the leaf model in this embodiment is the model corresponding to radially arranged leaves, and the leaf model is a single-layer leaf three-dimensional model. The main leaf veins of this type of leaf start from the petiole point of the leaf blade and extend outward to the edge of the leaf blade, and the edge part of the leaf veins of this type of leaf is convex outward. That is, the petiole point of the leaf model is the convergence point of multiple leaf veins of the corresponding leaf.
[0076] Among them, the vertex coordinates of each triangular face that makes up the leaf model are all coordinates in three-dimensional space, and each triangular face can be determined by the vertex coordinates corresponding to the three vertices of the triangular face. For example, the multiple vertices corresponding to multiple triangular faces can be: The vertices of one of the triangular faces are and is (x1, y1, z1), is (x2, y2, z2), is (x3, y3, z3), where n is a positive integer, representing the number of triangular faces that make up the leaf model.
[0077] In step S102, according to the vertex coordinates of multiple triangular faces, multiple edge edges of the leaf model are determined, and each edge edge is a unique edge in one of the triangular faces.
[0078] In this embodiment, multiple triangular faces are connected to each other by sharing triangular edges to form a leaf model. However, for the edge of the leaf model, since the leaf model in this embodiment is a single-layer three-dimensional model of the leaf, that is, the three-dimensional model of the front side of the leaf or the three-dimensional model of the back side of the leaf. Therefore, there is no sharing of triangular edges at the edge of the leaf model.
[0079] According to the vertex coordinates of multiple triangular faces, the unique edges in the triangular faces can be determined. The unique edge is a triangular edge that is not shared with other triangular faces. The unique edge can be determined as the edge edge of the leaf model, and by connecting multiple edge edges to each other, the edge of the leaf model can be formed.
[0080] In step S103, the edge vertices of multiple edge edges are sorted in sequence according to the connection order of the edge edges to obtain an edge vertex sequence.
[0081] In this embodiment, each edge edge includes two edge vertices, and multiple edge edges are connected to each other to form the edge of the leaf model. That is, two edge edges are connected together by sharing an edge vertex. According to the connection order between multiple edge edges, the edge vertices of multiple edge edges can be sorted clockwise or counterclockwise along the edge of the leaf model to obtain an edge vertex sequence.
[0082] In step S104, for any edge vertex in the edge vertex sequence, if the distances from multiple edge vertices adjacent to the front and back of the edge vertex to the petiole point are both smaller than the distance from the edge vertex to the petiole point, determine that the edge vertex is a vein feature point.
[0083] In this embodiment, the leaf model is a model corresponding to radially arranged leaves. The main vein of this type of leaf starts from the petiole point of the leaf blade and extends outward to the edge of the leaf blade, and the edge part of the vein of this type of leaf is in a convex shape. That is, at multiple parts on the edge of the leaf model, a convex shape will appear, and the veins will intersect at the edge vertices of the convex part, and this vertex is the vein feature point. For a local area, the distance from the vein feature point to the petiole point is greater than the distances from the multiple adjacent edge vertices before and after the vein feature point to the petiole point. Therefore, for any edge vertex in the edge vertex sequence, if the distances from the multiple adjacent edge vertices before and after this edge vertex to the petiole point are all less than the distance from this edge vertex to the petiole point, it can be determined that this edge vertex is a vein feature point.
[0084] In step S105, the shortest path between the vein feature point and the petiole point is determined as the vein of the leaf model.
[0085] In this embodiment, the main vein of the leaf starts from the petiole point of the leaf blade and extends outward to the edge of the leaf blade. By determining the shortest path between the vein feature point on the leaf model and the petiole point, the vein of the leaf model can be obtained. Exemplarily, the Dijkstra algorithm can be used to determine the shortest path between each vein feature point and the petiole point.
[0086] In this embodiment, by determining the unique edges in the triangular faces according to the vertex coordinates of the multiple triangular faces that make up the leaf model, multiple edge edges of the leaf model are obtained; and an edge vertex sequence is determined according to the multiple edge edges; then vein feature points are determined according to the edge vertex sequence; finally, the shortest path between the vein feature points and the petiole point is determined as the vein of the leaf model. Thus, the vein in the leaf model corresponding to the radially arranged leaves can be determined based on the vertex coordinates of the multiple triangular faces of the leaf model.
[0087] Figure 2 is a flowchart of a method for determining an edge edge shown according to an exemplary embodiment, as Figure 2 shown, in a possible implementation manner, to determine multiple edge edges of the leaf model according to the vertex coordinates of multiple triangular faces, the following steps may be included:
[0088] In step S201, for any triangular edge that makes up any triangular face, if the vertex coordinates of the two vertices of this triangular edge are not the same as the vertex coordinates of the two vertices of any triangular edge of any other triangular face, it is determined that this triangular edge of this triangular face is an edge edge of the leaf model.
[0089] In this embodiment, if a triangular face shares a triangular edge with another triangular face, the vertex coordinates of the two vertices of this shared triangular edge corresponding to the two triangular faces are the same. If there is a triangular edge whose two vertex coordinates are not the same as the two vertex coordinates of any triangular edge of any other triangular face, it can be determined that this triangular edge of this triangular face is an edge of the leaf model.
[0090] Among them, based on the vertex coordinates of multiple triangular faces, the triangular edges constituting each triangular face and the vertex coordinates of the two vertices constituting each triangular edge can be determined. Specifically, a triangular face corresponds to three vertex coordinates. Through the three vertex coordinates corresponding to this triangular face, the positions of the three vertices of this triangular face can be determined, and the connection line between any two of the three vertices corresponding to this triangular face is the triangular edge of this triangular face.
[0091] For example, the data structure of multiple triangular edges can be expressed as:
[0092]
[0093] In step S202, traverse all the triangular edges of all the triangular faces that make up the leaf model to obtain multiple edges of the leaf model.
[0094] In this embodiment, the three triangular edges of each triangular face can be traversed p,q = 1,2,3; i = 1,…,n. For any one triangular edge, judge the triangular edges of other triangular faces m,n = 1,2,3; j = i,…,n, whether they are the same as this triangular edge, that is and If the vertex coordinates of the two vertices of this triangular edge are not the same as the vertex coordinates of the two vertices of any triangular edge of any other triangular face, then this triangular edge is an edge of the leaf model.
[0095] Figure 3 is a flowchart of a method for determining an edge vertex sequence shown according to an exemplary embodiment. As Figure 3 shown, in a possible implementation, sort the edge vertices of multiple edges in sequence according to the connection order of the edges to obtain an edge vertex sequence, which may include the following steps:
[0096] In step S301, establish an original sequence with an empty initial content.
[0097] In this embodiment, this original sequence is used to sequentially store the multiple edge vertices corresponding to multiple edges.
[0098] In step S302, determine a first sequence of points among the edge vertices of multiple edge edges. The first sequence of points is the edge vertex among the edge vertices of the multiple edge edges that has the smallest distance from the petiole point.
[0099] Before determining the first sequence of points, the distance between each edge vertex and the petiole point can be determined first. Specifically, the coordinates corresponding to the petiole point and the vertex coordinates corresponding to each edge vertex of the multiple edge edges can be obtained first, and then, based on the coordinates corresponding to the petiole point and the vertex coordinates corresponding to each edge vertex of the multiple edge edges, the distance between each edge vertex and the petiole point can be determined.
[0100] Among them, the coordinates of the petiole point can be v0 = (x0, y0, z0), and the coordinates of the edge vertex can be The calculation formula for the distance between each edge vertex and the petiole point can be:
[0101]
[0102] After obtaining the distance between each edge vertex and the petiole point, the edge vertex among the edge vertices of the multiple edge edges that has the smallest distance from the petiole point can be determined as the first sequence of points.
[0103] In a possible implementation, if there are multiple edge vertices among the edge vertices of the multiple edge edges that have the smallest distance from the petiole point, any one of the multiple edge vertices can be determined as the first sequence of points.
[0104] In step S303, put the first sequence of points into the original sequence as the tail point of the original sequence.
[0105] In this implementation, the determined first sequence of points can be put into the original sequence as the tail point of the original sequence, where the tail point is the edge vertex that was most recently put into the original sequence.
[0106] In step S304, perform the following operations in a loop: put the other edge vertex that is on the same edge edge as the tail point that was most recently put into the original sequence into the original sequence as the new tail point until there are no edge vertices among the edge vertices of the multiple edge edges that have not been put into the original sequence, and obtain an edge vertex sequence.
[0107] In this implementation, the edge vertices of the multiple edge edges are deduplicated points, that is, for an edge vertex shared by two edge edges, it is only counted as one. Put the other edge vertex that is on the same edge edge as the tail point that was most recently put into the original sequence into the original sequence as the new tail point, and repeat this operation until there are no edge vertices among the edge vertices of the multiple edge edges that have not been put into the original sequence, so that the final original sequence can be determined as the edge vertex sequence.
[0108] In a possible implementation, the method for determining the coordinates of the petiole point may be: in response to a user's specified operation on the petiole point on the vein model, identify the specified petiole point to obtain the coordinates of the petiole point.
[0109] In this implementation, the petiole point can be obtained by direct user specification. For example, the user can operate the mouse to determine a point as the petiole point in the vein model. After the user's specified operation is completed, in response to the user's specified operation on the petiole point on the vein model, identify the specified petiole point on the leaf model to obtain the coordinates of the petiole point.
[0110] Figure 4 is a flowchart of a method for determining vein feature points shown according to an exemplary embodiment. Figure 5 is a schematic diagram of vein feature points of a vein model shown according to an exemplary embodiment. As Figure 4 and Figure 5 shown, in a possible implementation, for any edge vertex in the edge vertex sequence, if the distances from multiple edge vertices adjacent to the edge vertex before and after to the petiole point are all less than the distance from the edge vertex to the petiole point, determining the edge vertex as a vein feature point may include the following steps:
[0111] In step S401, establish a sliding window with a width of 2K + 1, where K is an integer greater than 0.
[0112] In this implementation, the width of the sliding window represents the number of edge vertices that can be accommodated in the sliding window. If the width of the sliding window is 2K + 1, it means that the number of edge vertices that the sliding window can accommodate is 2K + 1. Among them, K is a positive integer, that is, K is an integer greater than 0.
[0113] In step S402, slide the sliding window on the edge vertex sequence. Each time after sliding, the sliding window contains 2K + 1 edge vertices, and at least part of the edge vertices included in the sliding window after each sliding are the same as those in the sliding window after the previous sliding.
[0114] In this implementation, the sliding window can be slid along the arrangement order of the edge vertex sequence according to a preset step size. For example, the preset step size is 1, that is, each time it slides a distance of one edge vertex. After each sliding, as many edge vertices slide in as slide out, so as to ensure that the sliding window contains 2K + 1 edge vertices after each sliding. And at least part of the edge vertices included in the sliding window after each sliding are the same as those in the sliding window after the previous sliding, that is, the preset step size is less than 2K + 1.
[0115] In step S403, for each position of the sliding window, determine the distance from each edge vertex in the sliding window to the petiole point.
[0116] In this embodiment, the initial position of the sliding window may include the first 2K + 1 edge vertices of the edge vertex sequence. The distance from each edge vertex within the sliding window to the petiole point can be determined so as to determine the distances from all the edge vertices included in the edge vertex sequence to the petiole point during the sliding of the sliding window.
[0117] In step S404, the edge vertices that meet the following conditions are determined as vein feature points: the distance from the edge vertex to the petiole point is greater than the distances from the K edge vertices before the edge vertex to the petiole point and greater than the distances from the K edge vertices after the edge point to the petiole point.
[0118] In this embodiment, for any edge vertex within the sliding window, the condition can be judged: judge whether the distance from the edge vertex to the petiole point is greater than the distances from the K edge vertices before the edge vertex to the petiole point and greater than the distances from the K edge vertices after the edge point to the petiole point. If the distance from the edge vertex to the petiole point is greater than the distances from the K edge vertices before the edge vertex to the petiole point and greater than the distances from the K edge vertices after the edge point to the petiole point, the edge vertex can be determined as a vein feature point.
[0119] For the initial position of the sliding window, there are no K edge vertices before the first K edge vertices included in the sliding window, so the first K edge vertices included in the sliding window do not meet the above judgment conditions, and there are also no vein feature points among the first K edge vertices included in the sliding window. During the sliding of the sliding window, for any edge vertex located after the first K edge vertices in the edge vertex sequence, the vein feature points can be determined through the above judgment conditions. Figure 5 wherein v0 is the petiole point, and V1, V2, V3, V4, V5, V6, and V7 are vein feature points.
[0120] Figure 6 is a block diagram of a vein determination device shown according to an exemplary embodiment. Refer to Figure 6 , the device includes an acquisition module 601, a first determination module 602, a sorting module 603, a second determination module 604, and a third determination module 605.
[0121] The acquisition module 601 is configured to acquire the vertex coordinates of multiple triangular faces constituting the leaf model;
[0122] The first determination module 602 is configured to determine multiple edge edges of the leaf model according to the vertex coordinates of the multiple triangular faces, and each of the edge edges is a unique edge in one of the triangular faces;
[0123] The sorting module 603 is configured to sort the edge vertices of the multiple edge edges in sequence according to the connection order of the edge edges, so as to obtain an edge vertex sequence;
[0124] The second determination module 604 is configured to, for any edge vertex in the edge vertex sequence, if the distances from multiple edge vertices adjacent to the front and back of the edge vertex to the petiole point are both smaller than the distance from the edge vertex to the petiole point, determine that the edge vertex is a vein feature point;
[0125] The third determination module 605 is configured to determine the shortest path between the vein feature point and the petiole point as the vein of the leaf model.
[0126] Optionally, the first determination module 602 includes:
[0127] A first determination sub-module is configured to, for any triangular edge constituting any triangular face, if the vertex coordinates of the two vertices of the triangular edge are not the same as the vertex coordinates of the two vertices of any triangular edge of any other triangular face, determine that the triangular edge of the triangular face is an edge edge of the leaf model;
[0128] An obtaining sub-module is configured to traverse all triangular edges of all triangular faces constituting the leaf model to obtain multiple edge edges of the leaf model.
[0129] Optionally, the apparatus 600 further includes:
[0130] A fourth determination module is configured to determine the triangular edges constituting each triangular face and the vertex coordinates of the two vertices constituting each triangular edge according to the vertex coordinates of the multiple triangular faces.
[0131] Optionally, the sorting module 603 includes:
[0132] A first establishment sub-module is configured to establish an original sequence with an empty initial content;
[0133] A second determination sub-module is configured to determine a first sequence point among the edge vertices of the multiple edge edges, where the first sequence point is the edge vertex with the smallest distance to the petiole point among the edge vertices of the multiple edge edges;
[0134] A putting sub-module is configured to put the first sequence point into the original sequence as the tail point of the original sequence;
[0135] A loop sub-module, configured to loop and execute the following operations: put another edge vertex that is on the same edge as the most recently placed tail point in the original sequence into the original sequence as a new tail point until there are no edge vertices among the edge vertices of the multiple edges that have not been put into the original sequence, so as to obtain the edge vertex sequence.
[0136] Optionally, the device 600 further includes:
[0137] An acquisition subunit, configured to acquire the coordinates corresponding to the petiole point and the vertex coordinates corresponding to each edge vertex of the multiple edges;
[0138] A determination subunit, configured to determine the distance between each edge vertex and the petiole point according to the coordinates corresponding to the petiole point and the vertex coordinates corresponding to each edge vertex of the multiple edges.
[0139] Optionally, the device 600 further includes:
[0140] An obtaining module, configured to identify the specified petiole point in response to a specified operation of the user on the petiole point on the vein model, so as to obtain the coordinates of the petiole point.
[0141] Optionally, the second determination module 604 includes:
[0142] A second establishment sub-module, configured to establish a sliding window with a width of 2K + 1, where K is an integer greater than 0;
[0143] A sliding sub-module, configured to slide the sliding window on the edge vertex sequence, and each time after sliding, the sliding window includes 2K + 1 edge vertices, and, at least part of the edge vertices included in the sliding window after each sliding are the same as those in the sliding window after the previous sliding;
[0144] A third determination sub-module, configured to determine the distance from each edge vertex in the sliding window to the petiole point for each position of the sliding window;
[0145] A fourth determination sub-module, configured to determine an edge vertex that meets the following conditions as the vein feature point: the distance from this edge vertex to the petiole point is greater than the distance from the K edge vertices before this edge vertex to the petiole point, and greater than the distance from the K edge vertices after this edge point to the petiole point.
[0146] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.
[0147] Figure 7is a block diagram of an electronic device shown according to an exemplary embodiment. For example, the electronic device 700 may be provided as a server. Referring to Figure 7 , the electronic device 700 includes a processor 722, the number of which may be one or more, and a memory 732 for storing computer programs executable by the processor 722. The computer programs stored in the memory 732 may include one or more modules each corresponding to a set of instructions. In addition, the processor 722 may be configured to execute the computer program to perform the above-described vein determination method.
[0148] In addition, the electronic device 700 may further include a power supply component 726 and a communication component 750. The power supply component 726 may be configured to perform power management of the electronic device 700, and the communication component 750 may be configured to enable communication of the electronic device 700, for example, wired or wireless communication. In addition, the electronic device 700 may further include an input / output (I / O) interface 758. The electronic device 700 may operate based on an operating system stored in the memory 732.
[0149] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided. When the program instructions are executed by a processor, the steps of the above-described vein determination method are implemented. For example, the non-transitory computer-readable storage medium may be the above-described memory 732 including program instructions, and the above program instructions may be executed by the processor 722 of the electronic device 700 to complete the above-described vein determination method.
[0150] In another exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program executable by a programmable device, and the computer program has a code portion for performing the above-described vein determination method when executed by the programmable device.
[0151] The preferred embodiments of the present disclosure have been described in detail above in conjunction with the accompanying drawings. However, the present disclosure is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present disclosure, various simple modifications can be made to the technical solutions of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.
[0152] In addition, it should be noted that, in the various specific technical features described in the above specific embodiments, they can be combined in any suitable manner without conflict. To avoid unnecessary repetition, the present disclosure does not separately describe various possible combination manners.
[0153] In addition, any combination can be made between various different embodiments of the present disclosure as long as it does not violate the idea of the present disclosure, and it should also be regarded as the content disclosed by the present disclosure.
Claims
1. A method for determining leaf veins, characterized in that, Comprising: Obtaining the vertex coordinates of multiple triangular faces that make up the leaf model; Determining multiple edge edges of the leaf model according to the vertex coordinates of the multiple triangular faces, each of the edge edges being a unique edge in one of the triangular faces; Sequentially sorting the edge vertices of the multiple edge edges according to the connection order of the edge edges to obtain an edge vertex sequence; For any edge vertex in the edge vertex sequence, if the distances from multiple edge vertices adjacent to the front and back of the edge vertex to the petiole point are all smaller than the distance from the edge vertex to the petiole point, determining that the edge vertex is a vein feature point; Determining the shortest path between the vein feature point and the petiole point as the vein of the leaf model.
2. The vein determination method according to claim 1, wherein: The step of determining multiple edge edges of the leaf model according to the vertex coordinates of the multiple triangular faces includes: For any triangular edge that makes up any triangular face, if the vertex coordinates of the two vertices of the triangular edge are not the same as the vertex coordinates of the two vertices of any triangular edge of any other triangular face, determining that the triangular edge of the triangular face is an edge edge of the leaf model; Traversing all triangular edges of all triangular faces that make up the leaf model to obtain multiple edge edges of the leaf model.
3. The vein determination method according to claim 2, wherein: Before the step of, for any triangular edge that makes up any triangular face, if the vertex coordinates of the two vertices of the triangular edge are not the same as the vertex coordinates of the two vertices of any triangular edge of any other triangular face, determining that the triangular edge of the triangular face is an edge edge of the leaf model, the method further includes: Determining the triangular edges that make up each triangular face and the vertex coordinates of the two vertices that make up each triangular edge according to the vertex coordinates of the multiple triangular faces.
4. The vein determination method according to claim 1, wherein: The step of sequentially sorting the edge vertices of the multiple edge edges according to the connection order of the edge edges to obtain an edge vertex sequence includes: Establishing an original sequence with an empty initial content; Determining a first sequence point among the edge vertices of the multiple edge edges, the first sequence point being the edge vertex with the smallest distance from the multiple edge vertices to the petiole point; Putting the first sequence point into the original sequence as the tail point of the original sequence; Looping to execute the following operation: putting another edge vertex that is on the same edge edge as the most recently placed tail point in the original sequence into the original sequence as the new tail point until there are no edge vertices among the edge vertices of the multiple edge edges that have not been put into the original sequence, to obtain the edge vertex sequence.
5. The vein determination method according to claim 4, wherein: Before the step of determining a first sequence point among the edge vertices of the multiple edge edges, the first sequence point being the edge vertex with the smallest distance from the multiple edge vertices to the petiole point, the method further includes: Obtain the coordinates corresponding to the petiole point and the vertex coordinates corresponding to each edge vertex of the multiple edge edges; Determine the distance between each edge vertex and the petiole point according to the coordinates corresponding to the petiole point and the vertex coordinates corresponding to each edge vertex of the multiple edge edges.
6. The vein determination method according to claim 5, characterized in that, The method further includes: In response to a specified operation of the user on the petiole point on the leaf model, identify the specified petiole point to obtain the coordinates of the petiole point.
7. The vein determination method according to claim 1, wherein For any edge vertex in the edge vertex sequence, if the distances from multiple edge vertices adjacent to the front and back of the edge vertex to the petiole point are both smaller than the distance from the edge vertex to the petiole point, the step of determining the edge vertex as a vein feature point includes: Establish a sliding window with a width of 2K + 1, where K is an integer greater than 0; Slide the sliding window on the edge vertex sequence. After each slide, the sliding window includes 2K + 1 edge vertices, and at least part of the edge vertices included in the sliding window after each slide are the same as those in the sliding window after the previous slide; For each position of the sliding window, determine the distance from each edge vertex in the sliding window to the petiole point; Determine the edge vertex that meets the following conditions as the vein feature point: the distance from the edge vertex to the petiole point is greater than the distances from the K edge vertices before the edge vertex to the petiole point, and greater than the distances from the K edge vertices after the edge point to the petiole point.
8. A vein determination device, characterized in that, Includes: An acquisition module configured to acquire the vertex coordinates of multiple triangular faces constituting the leaf model; A first determination module configured to determine multiple edge edges of the leaf model according to the vertex coordinates of the multiple triangular faces, and each edge edge is a unique edge in one of the triangular faces; A sorting module configured to sort the edge vertices of the multiple edge edges in sequence according to the connection order of the edge edges to obtain an edge vertex sequence; A second determination module configured to, for any edge vertex in the edge vertex sequence, if the distances from multiple edge vertices adjacent to the front and back of the edge vertex to the petiole point are both smaller than the distance from the edge vertex to the petiole point, determine the edge vertex as a vein feature point; A third determination module configured to determine the shortest path between the vein feature point and the petiole point as the vein of the leaf model.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the vein determination method according to any one of claims 1 - 7.
10. An electronic device, characterized in that, Includes: A memory having a computer program stored thereon; A processor for executing the computer program in the memory to implement the steps of the vein determination method according to any one of claims 1 - 7.
Citation Information
Patent Citations
Image labeling method and device, readable storage medium and electronic equipment
CN115131500A
Three-dimensional image reconstruction using doppler ultrasound
US20090177089A1