Three-dimensional line generation method, storage medium and system
1. A method for generating a three-dimensional line is characterized by comprising the following steps:
performing feature retrieval on the input three-dimensional model, and generating a three-dimensional curve structure on the surface of the three-dimensional model according to the retrieved features;
and editing the three-dimensional curve structure in an interactive mode to obtain a three-dimensional line.
2. The method for generating a three-dimensional line according to claim 1, wherein the step of performing feature search on the input three-dimensional model and generating a three-dimensional curved structure on the surface of the three-dimensional model according to the searched features comprises:
performing feature retrieval on an input three-dimensional model to obtain all extreme points of the three-dimensional model;
and respectively extending curves to other extreme points by taking a plurality of extreme points as starting points until all the extreme points are visited by the curves, and forming a three-dimensional curve structure on the surface of the three-dimensional model.
3. The method for generating three-dimensional lines according to claim 2, wherein the step of extending curves from a plurality of extreme points to other extreme points until all the extreme points are visited by the curves comprises:
defining the connection relation of extreme points on the three-dimensional model as an edge relation of the graph, and defining the weight of the edge in the graph as follows:wherein lijIs the distance, L, between two corresponding adjacent extrema points on the three-dimensional modelrIs the influence of the generated curve on the new extension curve, and is unified as 1, L when no curve is generatedaThe guiding function of the inherent geometric characteristics of the three-dimensional model on the new extension curve is realized;
said LrAnd LaIs defined as:wherein l is the average length of the three-dimensional model edge; a, b are parameters; for LaX is the geodesic distance between a certain extreme point on the three-dimensional model and a given three-dimensional geometric feature; for LrAnd x is the geodesic distance between a certain extreme point on the three-dimensional model and the generated curve.
4. The method for generating three-dimensional lines according to claim 3, wherein when x is the geodesic distance between an extreme point on the three-dimensional model and a given three-dimensional geometric feature, a is 1.8, and b is 0.5.
5. The method for generating three-dimensional line according to claim 3, wherein when x is the geodesic distance between an extreme point on the three-dimensional model and the generated curve, a is 1.1.98, and b is 0.5.
6. The method for generating three-dimensional lines according to claim 3, wherein the step of extending curves from a plurality of extreme points to other extreme points until all the extreme points are visited by the curves further comprises:
after each curve extension, the following determination is made for the newly extended curve segment:if Σ e of the newly extended curve segmentijIf the value is smaller than the first preset value or the c value of the newly extended curve segment is smaller than the second preset value, the newly extended curve segment is reserved.
7. The method for generating a three-dimensional line according to claim 1, wherein a feature search is performed on the input three-dimensional model, and after a three-dimensional curved structure is generated on the surface of the three-dimensional model according to the searched feature, the method further comprises the steps of:
by the calculation formula: e ═ EC+αErCarrying out score statistics on the generated three-dimensional curve structure and sequencing according to scores, wherein alpha is a constant, EC=||Fp-Ff||,Calculating the geodesic distance x from each extreme point on the three-dimensional model to the nearest geometric feature, and transforming each calculated x by a Gaussian function g (x), wherein Ff is a vector containing g (x) values of all points on the three-dimensional model; fp is used for calculating the geodesic distance from each extreme point on the three-dimensional model to the point on the nearest path; fpi is the distance between each point on each model and each small path pi, after Gaussian function transformation, all obtained vectors Fpi are added to obtain
8. The method for generating the three-dimensional line according to claim 1, wherein the step of editing the three-dimensional curve structure in an interactive manner comprises:
and modifying the space form of the three-dimensional curve structure through an interactive tool or drawing a path on the surface of the three-dimensional model in advance, and carrying out the process according to the form of the path when the specified curve extends.
9. A storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of the method for generating a three-dimensional line according to any one of claims 1 to 8.
10. A three-dimensional line generation system comprises a processor and a control unit, wherein the processor is suitable for realizing instructions; and a storage medium adapted to store a plurality of instructions adapted to be loaded by a processor and to perform the steps of the method of generating a three-dimensional line of any one of claims 1-8.
Background
Line art is an artistic form that represents a two-dimensional or three-dimensional shape by using a line structure (commonly referred to as a metal line) in reality. In the past decades, researchers have been working on expressing different shapes in the form of lines, such as using dense lines in a grid to closely wrap the surface of a three-dimensional model, or extracting high-level semantic information from a real three-dimensional object by an artist through high abstraction, and then extracting the semantic information into the form of three-dimensional lines.
However, there is no corresponding research work to find a line structure capable of simultaneously representing object information and having conciseness. Therefore, the prior art is still to be improved.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, the present invention aims to provide a method, a storage medium, and a system for generating a three-dimensional line, which are intended to solve the problem that the prior art cannot represent object information with a concise line structure.
The technical scheme of the invention is as follows:
a three-dimensional line generation method comprises the following steps:
performing feature retrieval on the input three-dimensional model, and generating a three-dimensional curve structure on the surface of the three-dimensional model according to the retrieved features;
and editing the three-dimensional curve structure in an interactive mode to obtain a three-dimensional line.
The method for generating the three-dimensional line comprises the following steps of performing feature retrieval on an input three-dimensional model, and generating a three-dimensional curve structure on the surface of the three-dimensional model according to the retrieved features:
performing feature retrieval on an input three-dimensional model to obtain all extreme points of the three-dimensional model;
and respectively extending curves to other extreme points by taking a plurality of extreme points as starting points until all the extreme points are visited by the curves, and forming a three-dimensional curve structure on the surface of the three-dimensional model.
The method for generating the three-dimensional line comprises the following steps of respectively extending curves to other extreme points by taking a plurality of extreme points as starting points until all the extreme points are visited by the curves, and forming a three-dimensional curve structure on the surface of the three-dimensional model, wherein the steps comprise:
defining the connection relation of extreme points on the three-dimensional model as an edge relation of the graph, and defining the weight of the edge in the graph as follows:wherein lijIs the distance, L, between two corresponding adjacent extrema points on the three-dimensional modelrIs the influence of the generated curve on the new extension curve, and no curve is generatedThe time of the line is 1, LaThe guiding function of the inherent geometric characteristics of the three-dimensional model on the new extension curve is realized;
said LrAnd LaIs defined as:wherein l is the average length of the three-dimensional model edge; a, b are parameters; for LaX is the geodesic distance between a certain extreme point on the three-dimensional model and a given three-dimensional geometric feature; for LrAnd x is the geodesic distance between a certain extreme point on the three-dimensional model and the generated curve.
The method for generating the three-dimensional line comprises the steps that when x is the geodesic distance between a certain extreme point on the three-dimensional model and a given three-dimensional geometric feature, a is 1.8, and b is 0.5.
The method for generating the three-dimensional line comprises the steps that when x is the geodesic distance between a certain extreme point on the three-dimensional model and an already generated curve, a is 1.1.98, and b is 0.5.
The method for generating the three-dimensional line comprises the following steps of respectively extending curves to other extreme points by taking a plurality of extreme points as starting points until all the extreme points are visited by the curves, and forming a three-dimensional curve structure on the surface of the three-dimensional model, wherein the steps comprise:
after each curve extension, the following determination is made for the newly extended curve segment:if Σ e of the newly extended curve segmentijIf the value is smaller than the first preset value or the c value of the newly extended curve segment is smaller than the second preset value, the newly extended curve segment is reserved.
The method for generating the three-dimensional line comprises the following steps of performing characteristic retrieval on an input three-dimensional model, and generating a three-dimensional curve structure on the surface of the three-dimensional model according to the retrieved characteristics:
by the calculation formula: e ═ EC+αErFor the generated three-dimensional curve structureCounting line scores and sorting according to the scores, wherein alpha is a constant, EC=||Fp-Ff||,Calculating the geodesic distance x from each extreme point on the three-dimensional model to the nearest geometric feature, and transforming each calculated x by a Gaussian function g (x), wherein Ff is a vector containing g (x) values of all points on the three-dimensional model; fp is used for calculating the geodesic distance from each extreme point on the three-dimensional model to the point on the nearest path; fpi is the distance between each point on each model and each small path pi, after Gaussian function transformation, all obtained vectors Fpi are added to obtain
The method for generating the three-dimensional line comprises the following steps of editing the three-dimensional curve structure in an interactive mode:
and modifying the space form of the three-dimensional curve structure through an interactive tool or drawing a path on the surface of the three-dimensional model in advance, and carrying out the process according to the form of the path when the specified curve extends.
A storage medium, wherein the storage medium stores one or more programs, which are executable by one or more processors to implement the steps of the method for generating three-dimensional lines according to the present invention.
A three-dimensional line generation system comprises a processor and a control unit, wherein the processor is suitable for realizing instructions; and a storage medium adapted to store a plurality of instructions adapted to be loaded by a processor and to perform the steps of the method of generating three-dimensional lines according to the invention.
Has the advantages that: the invention provides a three-dimensional line generation method, which is characterized in that the characteristics are automatically retrieved on a three-dimensional model, a three-dimensional curve structure is formed on the surface of the three-dimensional model, and then a user can modify the space form of the three-dimensional curve structure by an interactive editing method. According to the method provided by the invention, the information of the three-dimensional model can be rapidly captured, and the information of the three-dimensional object can be restored by the concise three-dimensional line height for subsequent artware production and artist creation.
Drawings
Fig. 1 is a flowchart illustrating steps of a method for generating a three-dimensional line according to the present invention.
Fig. 2 is a schematic diagram of taking a picture as an input form, extracting geometric information therein, and converting the geometric information into a representation form of a plurality of long lines.
Fig. 3 is a schematic diagram illustrating a three-dimensional line structure formed by decomposing each segment of the three-dimensional model and forming a network-like structure.
FIG. 4 is a schematic diagram of the curve extending process of the present invention.
Fig. 5 is a block diagram of a three-dimensional line generation system provided in the present invention.
Detailed Description
The present invention provides a method, a storage medium, and a system for generating three-dimensional lines, which are described in further detail below in order to make the objects, technical solutions, and effects of the present invention clearer and clearer. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Although geometric information and semantic information which represent the three-dimensional model and are contained in the three-dimensional model can be extracted through a non-real rendering technology, the non-real rendering result usually only considers the aesthetic result and usually consists of a plurality of scattered three-dimensional lines, and how to extract one or more lines on the surface of the three-dimensional model from the scattered geometric information is also one of the problems solved by the invention.
Based on this, the present invention provides a method for generating a three-dimensional line, as shown in fig. 1, which includes the steps of:
s10, performing feature retrieval on the input three-dimensional model, and generating a three-dimensional curve structure on the surface of the three-dimensional model according to the retrieved features;
and S20, editing the three-dimensional curve structure in an interactive mode to obtain a three-dimensional line.
Specifically, different forms of line model generation may be implemented, where the first form is a given reference, such as a picture or a reference in an input form of a three-dimensional model, and then geometric features or semantic information is extracted from the reference form, for example, a picture is taken as an input form in fig. 2, and corresponding geometric information is extracted from the picture, so as to convert the input picture into a form of several long lines; for example, in fig. 3, a three-dimensional model is used as an input format, and each segment of the model is decomposed to form a network structure, thereby forming a three-dimensional line structure. The other is to use an interactive mode, and let the user perform a relatively free creation process through different designed interactive forms in a two-dimensional or three-dimensional space. These forms are mostly input in the form of a pen-touch as basic input, enabling a user to create a three-dimensional line in a three-dimensional space in a two-dimensional rendering manner by a certain design in utilizing depth information.
On one hand, the three-dimensional line generating method provided by the invention adopts a three-dimensional model input form to extract a three-dimensional curve structure from the geometric information of the three-dimensional model; in another aspect, the invention provides an interactive tool with a three-dimensional model as a reference, and a user can create a three-dimensional line model on the surface of the three-dimensional model through interactive operation from scratch. The user can also use an interactive tool to edit the result of the three-dimensional line generation method. The combination of the two can greatly reduce the difficulty of user creation and the required operand, accelerate the process of user creation, and with the help of the interactive tool provided by the invention, the user can better adjust the three-dimensional line to the target form. In this embodiment, the interactive tool may be an AR tool or a VR tool, but is not limited thereto.
In some embodiments, the method further comprises performing feature retrieval on the input three-dimensional model, and generating a three-dimensional curve structure on the surface of the three-dimensional model according to the retrieved features comprises: performing feature retrieval on an input three-dimensional model to obtain all extreme points of the three-dimensional model; and respectively extending curves to other extreme points by taking a plurality of extreme points as starting points until all the extreme points are visited by the curves, and forming a three-dimensional curve structure on the surface of the three-dimensional model.
Specifically, in this embodiment, the extreme point on the three-dimensional model refers to a point at the far end of the three-dimensional model (for example, the vertex of the human model, the fingertip, and the like), and the obtaining method is as follows: firstly, selecting a point P0 close to the gravity center position on the three-dimensional model, then calculating a point P1 farthest from the point P0, then calculating the geodesic distances from the point P1 to all the points on the three-dimensional model by taking the point P1 as a source point, and then calculating the point with a local extreme value, wherein the point is called an extreme point. This embodiment starts with an extreme point and geometric features on the three-dimensional model, the extreme point appearing geometrically as the tip point of the three-dimensional model, from one tip point to another tip point, no other nearby points being farther than the distance between the two tip points. In the curve extending process in this embodiment, extreme points are used as units, curves are respectively extended from a plurality of extreme points to other extreme points at the same time, pruning is realized after each extension, that is, curves extended too long or curves without local geometric features are excluded, and after multiple extensions, all the extreme points are accessed by the curves, so that reasonable description of most of the geometric features on the three-dimensional model by the curves can be ensured to a certain extent.
In some embodiments, as shown in fig. 4, geometric features of a three-dimensional model are represented by a set of points on the model, in order to generate a curve that takes sparsity and feature description into account, this embodiment regards the three-dimensional model as an abstract graph structure, a cusp point on the three-dimensional model corresponds to a point on the graph, an extreme point connection relationship on the three-dimensional model is defined as an edge relationship of the graph, and a weight of an edge in the graph is defined as: wherein lijIs the distance, L, between two corresponding adjacent extrema points on the three-dimensional modelrIs the influence of the generated curve on the new extension curve, and is unified as 1, L when no curve is generatedaIs the guiding effect of the inherent geometric features of the three-dimensional model on the new extension curve.
In this embodiment, L isrAnd LaIs defined as:wherein l is the average length of the three-dimensional model edge; a, b are parameters; for LaX is a three-dimensional geometric feature given by a certain extreme point distance on the three-dimensional model; for LrAnd x is a curve which is generated by a certain extreme point distance on the three-dimensional model.
In some specific embodiments, when x is a geodesic distance between a certain extreme point on the three-dimensional model and a given three-dimensional geometric feature, a is 1.8, and b is 0.5. When x is the geodesic distance between a certain extreme point on the three-dimensional model and the generated curve, a is 1.1.98, and b is 0.5. The arrangement can ensure that the generated curve can reasonably describe the geometric characteristics of the model and ensure certain sparsity, and the situation that different parts of the curve are too close to each other can not occur.
In some embodiments, after each end of the extension curve, the newly extended curve segment portion is determined as follows:if Σ e of the newly extended curve segmentijIf the value is smaller than the first preset value, the newly extended curve segment is reserved, which indicates that the curve is expected to describe the closer characteristic first and then describe the farther characteristic in the embodiment; and then if the c value of the newly extended curve segment is smaller than the second preset value, the newly extended curve segment is reserved, which indicates that the curve is expected to be well characterized without excessive redundancy.
In some embodiments, a plurality of triplets can be obtained by the methods provided hereinThe dimensional curve structure is convenient for a user to select from the three-dimensional curve structures, and the score calculation formula is designed in the embodiment to perform score statistics on the generated three-dimensional curve structures and sort the three-dimensional curve structures according to the scores. The consideration of the three-dimensional curve structure in this embodiment mainly focuses on two aspects: whether the curve better describes the information of the three-dimensional model and whether the curve has the phenomenon of repeated redundancy when describing the three-dimensional model. There is a conflict between these two aspects: curves capable of describing all information on the surface of the three-dimensional model completely are redundant to a certain extent, and a curve with an excessively simple structure may not be capable of completely describing more information. Therefore, the present embodiment separately considers the two design considerations, so that the result desired by the user can be balanced between the two, and the score calculation formula designed in the present embodiment is: e ═ EC+αErWhere α is a constant, for example, α is 0.1. In the present embodiment, scalar fields such as three-dimensional models are respectively based on: each point on the model is assigned a value representing the closest distance of the point from the generated three-dimensional curve/geometric feature, and then this value is passed through a normally distributed density function (taking μ 0 and σ 4 l). The embodiment is based on the whole three-dimensional curve, the geometric characteristics of the model surface and the three-dimensional curve segmented based on the extreme points, which are respectively set as Fp,Ff,(representing the superposition of fields formed by piecewise curves) then: eC=||Fp-Ff||,In this embodiment, Ff is calculated as follows: calculating the geodesic distance x from each extreme point on the three-dimensional model to the nearest geometric feature, and then transforming each calculated x by a Gaussian function g (x), wherein Ff is a vector containing g (x) values of all points on the model. Similarly, Fp calculates the geodesic distance from each extreme point on the three-dimensional model to the nearest point on the pathAnd (5) separating. Fpi firstly calculates the distance from a point on each model to pi for each small segment of path pi (the path between the segments is divided by an extreme point), and after Gaussian function transformation, all obtained vectors Fpi are added to obtain
In some embodiments, the step of interactively editing the three-dimensional curve structure includes: and modifying the space form of the three-dimensional curve structure through an interactive tool or drawing a path on the surface of the three-dimensional model in advance, and carrying out the process according to the form of the path when the specified curve extends.
Specifically, the interaction step provided by the present embodiment can implement two functions, first, allowing the user to quickly modify the spatial shape of the curve through an interactive tool; second, allowing the user to specify a partial path for generating a curve, the user can specify the shape of the path by drawing the path on the three-dimensional model surface before generating the curve, and specifying the curve as it extends around the region must follow the specified path. The two interactive systems greatly enhance the creative ability of the user and indirectly enhance the robustness of the system.
In some embodiments, a storage medium is further provided, where the storage medium stores one or more programs, and the one or more programs are executable by one or more processors to implement the steps in a method for generating a three-dimensional line according to the present invention.
In some embodiments, there is also provided a system for generating three-dimensional lines, as shown in fig. 5, which includes at least one processor (processor) 20; a display screen 21; and a memory (memory)22, and may further include a communication Interface (Communications Interface)23 and a bus 24. The processor 20, the display 21, the memory 22 and the communication interface 23 can communicate with each other through the bus 24. The display screen 21 is configured to display a user guidance interface preset in the initial setting mode. The communication interface 23 may transmit information. The processor 20 may call logic instructions in the memory 22 to perform the methods in the embodiments described above.
Furthermore, the logic instructions in the memory 22 may be implemented in software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product.
The memory 22, which is a computer-readable storage medium, may be configured to store a software program, a computer-executable program, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 executes the functional application and data processing, i.e. implements the method in the above-described embodiments, by executing the software program, instructions or modules stored in the memory 22.
The memory 22 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal device, and the like. Further, the memory 22 may include a high speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, may also be transient storage media.
In addition, the specific processes loaded and executed by the storage medium and the instruction processors in the terminal device are described in detail in the method, and are not stated herein.
Comprises a processor, which is suitable for realizing each instruction; and a storage medium adapted to store a plurality of instructions adapted to be loaded by a processor and to perform the steps of the method for generating a three-dimensional line according to the invention.
The system comprises a processor and a control unit, wherein the processor is suitable for realizing instructions; and a storage medium adapted to store a plurality of instructions adapted to be loaded by a processor and to perform the steps of the method for generating a three-dimensional line according to the invention.
In summary, the method for generating the three-dimensional line provided by the invention adopts a three-dimensional model input form to extract a three-dimensional curve structure from the geometric information of the three-dimensional model; in another aspect, the invention provides an interactive tool with a three-dimensional model as a reference, and a user can create a three-dimensional line model on the surface of the three-dimensional model through interactive operation from scratch; the user can also use an interactive tool to edit the result of the three-dimensional line generation method. The combination of the two can greatly reduce the difficulty of user creation and the required operand, accelerate the process of user creation, and with the help of the interactive tool provided by the invention, the user can better adjust the three-dimensional line to the target form.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:工艺产品的展示方法及展示装置、电子设备