CN105303606B - Tomato plant modeling method based on BP neural network - Google Patents

Tomato plant modeling method based on BP neural network Download PDF

Info

Publication number
CN105303606B
CN105303606B CN201510711702.5A CN201510711702A CN105303606B CN 105303606 B CN105303606 B CN 105303606B CN 201510711702 A CN201510711702 A CN 201510711702A CN 105303606 B CN105303606 B CN 105303606B
Authority
CN
China
Prior art keywords
stem
tomato plant
contours
user
neural network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510711702.5A
Other languages
Chinese (zh)
Other versions
CN105303606A (en
Inventor
刘佳
李红军
孟维亮
张晓鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Automation of Chinese Academy of Science
Original Assignee
Institute of Automation of Chinese Academy of Science
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Institute of Automation of Chinese Academy of Science filed Critical Institute of Automation of Chinese Academy of Science
Priority to CN201510711702.5A priority Critical patent/CN105303606B/en
Publication of CN105303606A publication Critical patent/CN105303606A/en
Application granted granted Critical
Publication of CN105303606B publication Critical patent/CN105303606B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the invention discloses a kind of tomato plant modeling method based on BP neural network, this method comprises the following steps:Step S1, the stem sketched the contours based on user on single width tomato plant image, builds two-dimentional stem;Step S2, the crown profile sketched the contours based on user on single width tomato plant image, replicated, corrected and rotated by the stem sketched the contours to user on single width tomato plant image, build three-dimensional stem;Step S3, according to the parameter of three-dimensional stem, build and train a BP neural network;Step S4, the crown profile sketched the contours based on user on single width tomato plant image, side stem parameter is predicted by BP neural network, and side stem is produced by self-similar principle;Step S5, based on leaf model, leaf is added for side stem, obtains intact plant.The embodiment of the present invention provides a kind of quick Solution for tomato plant modeling, and the plant model of structure is realistic, the scenario simulation that can be applied in virtual reality.

Description

Tomato plant modeling method based on BP neural network
Technical field
The present embodiments relate to computer graphics disposal technology field, more particularly, to a kind of based on BP neural network Tomato plant modeling method.
Background technology
The scene simulation of field of virtual reality needs substantial amounts of three-dimensional plant model.But because plant structure is complicated, species Various, cauline leaf serious shielding, its three-dimensional modeling are the difficult point and hot issue in the field.
Current Plants modeling method can substantially be divided into following four major class:
The first kind is the method being modeled to phytomorph of being gained knowledge based on plant.This kind of method mainly considers that plant gives birth to Long rule, the L system proposed such as Lindenmayer.
Second class is the Plants modeling method based on image.This kind of method is using plant picture as input information, by each Kind optical rehabilitation method structure plant model, the Plants modeling method that such as Quan in 2006 is proposed.
3rd class is the Plants modeling method based on 3-D scanning.This kind of method is built using 3 d scan data as input Plant model, the tree modeling method that such as Livny in 2011 is proposed.
4th class is the Plants modeling method based on manual interaction.This kind of method is using the two-dimentional sketch that user delineates as defeated Enter, or the threedimensional model shape of output directly controlled by three-dimension interaction, Plants modeling method that such as Okabe in 2005 is proposed and The tree modeling method that Wither in 2009 is proposed.
Method based on growth mechanism is applied to growth simulation, agricultural analysis etc., but generally requires adjusting parameter, inconvenience Exported in control, therefore be not suitable for real plants modeling;Made based on the method for 3-D scanning with the 3 d scan data of plant For input, geological information enriches, and precision is high, suitable for requiring model accuracy higher application, but three-dimensional scanning device price Costliness, the scanning process cost time is longer, and three-dimensional data amount is big, is unsuitable for rapid modeling;Method input information based on image It is convenient to obtain, and modeling method is flexible, is applicable to the application of various required precisions, but it is than the modeling method based on 3-D scanning Precision is low;Method based on manual interaction is a kind of more flexible method, available for the rapid modeling of plant model, but truly Sense is poor.
The modeling of tomato plant belongs to the category of Plants modeling, and more commonly used technology is gained knowledge spy based on plant at present It is not the three-dimensional modeling of mathematical modeling, such as tomato Greenlab models, and view-based access control model method rebuilds part organ structure, then Block mold is formed by template assembly.Three-dimensional modeling based on mathematical modeling is applied to functional simulation, morphological Simulation it is true Feel poor, and the plant structure restructured of view-based access control model is excessively simple.
In view of this, it is special to propose the present invention.
The content of the invention
The embodiment of the present invention provides a kind of tomato plant modeling method based on BP neural network, and it is solved at least in part How quick, realistic modeling the technical problem of tomato plant is realized.
To achieve these goals, according to an aspect of the present invention, there is provided a kind of tomato based on BP neural network is planted Strain modeling method, this method may comprise steps of:
Step S1, the stem sketched the contours based on user on single width tomato plant image, builds two-dimentional stem;
Step S2, the crown profile sketched the contours based on the user on the single width tomato plant image, by described The stem that user sketches the contours on the single width tomato plant image is replicated, corrected and rotated, and builds three-dimensional stem;
Step S3, according to the parameter of the three-dimensional stem, build and train a BP neural network;
Step S4, the crown profile sketched the contours based on the user on single width tomato plant image, BP nerves are passed through Neural network forecast side stem parameter, and produce side stem using self-similar principle;
Step S5, based on leaf model, leaf is added for side stem, obtains intact plant.
Compared with prior art, above-mentioned technical proposal at least has the advantages that:
The embodiment of the present invention proposes a kind of tomato plant fast modeling method based on BP neural network.The present invention is implemented The acquisition that the difference of example and forefathers' method is mainly reflected in three-dimensional information is not by image registration, camera calibration and vision weight Build, but realized by the efficient transformation of two-dimentional stem, i.e.,:The stem sketched the contours on single width tomato plant image based on user come Two-dimentional stem is built, then two-dimentional stem is replicated, corrected and rotated, it is then main by three-dimensional to build three-dimensional stem Stem builds and trained a BP neural network, predicts side stem parameter further through BP neural network, and produce by self-similar principle Raw side stem, finally adds leaf, so as to obtain intact plant for side stem.Experiment shows that the tomato of construction of the embodiment of the present invention is planted Strain model remains two dimension input information, it is not necessary to image registration and parameter regulation, and it is realistic.Institute of the embodiment of the present invention The modeling result of acquisition can be used in the scene simulation application of virtual reality.
Brief description of the drawings
A part of the accompanying drawing as the present invention, for providing further understanding of the invention, of the invention is schematic Embodiment and its illustrate to be used to explain the present invention, but do not form inappropriate limitation of the present invention.Obviously, drawings in the following description Only some embodiments, to those skilled in the art, on the premise of not paying creative work, can be with Other accompanying drawings are obtained according to these accompanying drawings.In the accompanying drawings:
Fig. 1 is the flow of the tomato plant modeling method based on BP neural network according to an exemplary embodiment Figure;
Fig. 2 a are the current skeletal point according to an exemplary embodiment:O, D and G;
8 neighbours and the 16 neighbour's schematic diagrames that Fig. 2 b are the O according to an exemplary embodiment;
Fig. 2 c are that 16 neighbours according to an exemplary embodiment cluster schematic diagram;
Fig. 2 d are outside effectively group and the internal valid pixel schematic diagram according to an exemplary embodiment;
Fig. 2 e are new the skeletal point A and C of the determination according to exemplary embodiment schematic diagram;
Fig. 2 f are the schematic diagram of the new skeletal point of connection according to an exemplary embodiment;
Fig. 3 is coordinate system used in the duplication of the two-dimentional stem according to an exemplary embodiment;
Fig. 4 is the constructed BP neural network schematic structure according to an exemplary embodiment;
Fig. 5 a are the input picture 1 according to an exemplary embodiment;
Fig. 5 b are the sketch 1 that the user according to an exemplary embodiment sketches the contours;
Fig. 5 c are the threedimensional model 1 according to an exemplary embodiment;
Fig. 5 d are the input picture 2 according to an exemplary embodiment;
Fig. 5 e are the sketch 2 that the user according to an exemplary embodiment sketches the contours;
Fig. 5 f are the threedimensional model 2 according to an exemplary embodiment;
Fig. 5 g are the input picture 3 according to an exemplary embodiment;
Fig. 5 h are to sketch the contours sketch 3 according to an exemplary embodiment;
Fig. 5 i are the threedimensional model 3 according to an exemplary embodiment.
Embodiment
Below in conjunction with the accompanying drawings and specific embodiment solved to the embodiment of the present invention technical problem, used technical side Case and the technique effect of realization carry out clear, complete description.Obviously, described embodiment is only one of the application Divide embodiment, be not whole embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not paying creation Property work on the premise of, the embodiment of all other equivalent or obvious modification obtained is all fallen within protection scope of the present invention. The embodiment of the present invention can embody according to the multitude of different ways being defined and covered by claim.
It should be noted that in the following description, understand for convenience, give many details.It is but very bright Aobvious, realization of the invention can be without these details.
It should be noted that in the case where not limiting clearly or not conflicting, each embodiment in the present invention and its In technical characteristic can be mutually combined and form technical scheme.
The core concept of the embodiment of the present invention is that the acquisition of three-dimensional information is realized by the efficient transformation of two-dimentional stem, is led to Cross stem parameter training and obtain BP neural network, side stem parameter is predicted to obtain by BP neural network so that side stem models more adduction Reason.
Fig. 1 is the flow of the tomato plant modeling method based on BP neural network according to an exemplary embodiment Figure.As shown in figure 1, the method comprising the steps of S1 to step S5.
Step S1, the stem sketched the contours based on user on single width tomato plant image, builds two-dimentional stem.
In this step, for single width plant picture that is shooting or downloading from the Internet, as long as human eye can tell plant Plant shape shape can be used in sketching the contours.User sketches the contours of stem on single width tomato plant image and the process of crown profile takes around 2-3 minutes.
Preferably, the two-dimentional stem extracting method that the embodiment of the present invention uses, available on the sketch sketched the contours from user Two-dimentional stem is extracted in single pixel stroke.
In a preferred embodiment, the detailed process for extracting two-dimentional stem is as follows:
The method that two-dimentional stem is extracted from single pixel stroke is applied to the situation that all strokes are all connections.This method master Next tie point is obtained by analyzing each stroke pixel neighbour situation.Fig. 2 be partial analysis at stroke pixel O and Connection.As shown in Figure 2 a, it is known that G, D and O are the skeletal points that the region had determined that and be already connected to current stem, after obtaining O The new skeletal point in face, following partial analysis is carried out at O:
1) stroke pixel O, is read in.
2) stroke pixel O 8 neighbor pixels and 16 neighbor pixels, and the fixed skeletal point in the region, are searched for.It is right In any one stroke pixel O, the stroke pixel that the embodiment of the present invention is in close to 8 positions of its first layer is referred to as O's " 8 neighbor pixel ", and the stroke pixel in 16 connected positions of its second layer is O " 16 neighbor pixel ", such as Fig. 2 b institutes Show, A, B, C and D are O 8 neighbours, and E, F and G are O 16 neighbours.
3) stroke pixel O 16 neighbours cluster, is carried out.According to location of pixels, 16 adjacent neighbor pixels cluster is one Group, 16 so all neighbor pixels can be clustered into some non-conterminous pixel groups.As shown in Figure 2 c, 16 all neighbor pixels Three groups are clustered into, and each group only has a pixel, i.e., E, F and G are respectively into one group.
4) " outside effective group " and " internal valid pixel ", are determined.For any one being clustered into by 16 neighbor pixels Pixel groups, if not including fixed skeletal point wherein, then this group is referred to as " outside effective group ";For all 8 neighbours Pixel, if it is not fixed skeletal point, then it is referred to as " internal valid pixel ".As shown in Figure 2 d, E and F is two Individual effective group of outside, A, B and C are three internal valid pixels.
5) new skeletal point, is determined.It is outside effective group for each, choose any one adjacent inside valid pixel and make For new skeletal point, as shown in Figure 2 e.The new skeletal point behind pixel O is thus obtained.
After carrying out partial analysis at stroke pixel O, new skeletal point P has been obtainedi, i=1,2 ... N.It is several below point Situation is attached processing:
If 1), N=1, by this point P1Current stem is connected to as a new skeletal point.Then in P1Carry out equally Skeletal point below is found in partial analysis.
If 2), N>1, in PiSelected a bit in (i=1,2 ... N), such as select PxBone (x ∈ i) new as current stem Frame point, then in this point PxCarry out same partial analysis.Choosing the principle of the new skeletal point of current stem is:As far as possible choose with The less point of tangential angle of current stem.Remaining puts second skeletal point (first of these new stems as other new stems Skeletal point is O) it is saved, wait processing below.As shown in figure 2f, A is connected to current stem as new skeletal point, The second new as one C node remains.
If 3), N=0, current stem terminates.If there is the second new node, then go to this node and carry out part Analysis.If there is no such node, connection procedure terminates.
This method proceeds by partial analysis from minimum stroke pixel, all passes through until all pixels and handles, most The skeleton of an acyclic connected graph shape is connected into afterwards.
Step S2, the crown profile sketched the contours based on user on single width tomato plant image, by user in single width kind The stem sketched the contours on eggplant plant image is replicated, corrected and rotated, and builds three-dimensional stem.
In this step, in most cases, user can only sketch the contours of what can be distinguished on single width tomato plant image Stem, this is a part for stem, therefore the breeding of stem is first carried out before two-dimentional stem is expanded into three-dimensional stem.This hair The two-dimentional stem that bright embodiment obtains the stem sketched the contours from user expands to its 2-3 times, and its sum passes through tomato plant Characteristic determines.The process is traveled through in two-dimentional stem based on hierarchical order.
In an optional embodiment, the stem sketched the contours to user on single width tomato plant image replicates, can With including:
All stems of whole two-dimentional stem are traveled through based on hierarchical order;All fall what is sketched the contours in user for all stem spot projections Stem in the crown profile of tomato plant, replicated by former stem size and relative position is constant;Fall for part stem spot projection The stem in the crown profile of tomato plant that user sketches the contours, if the stem points in crown profile are more than or equal to predetermined threshold, only Replicate the stem point in crown profile and position is constant, if the stem points in crown profile are less than predetermined threshold, do not replicate this Stem.
In an optional embodiment, the stem sketched the contours to user on single width tomato plant image is corrected, can With including:
According to the feature structure feature of Lycopersicon spp, the length of all stems of two-dimentional stem is trimmed or extended, and The position of all stems of two-dimentional stem is moved.
In actual applications, the stem sketched the contours to user on single width tomato plant image is replicated and corrected specific Step can include:
1) hierarchical order from root to hat is pressed in two-dimentional stem, reads in a stem lσ(σ=0,1,2 ... Q) wherein Q is to use The number for the stem that family is sketched the contours on single width tomato plant image;Go to step 2).
If 2) all stem points of the stem all fall in the crown profile of the tomato plant sketched the contours in user, step is gone to 3);Otherwise step 4) is gone to.
3) a part of stem point of the stem is written in a new stem, and connects this new stem to stem structure, checking should Whether new stem length degree meets the feature structure feature of Lycopersicon spp, such as improper, suitably trims or extends the new stem, checks new Whether link position meets the feature structure feature of Lycopersicon spp, if improper, appropriate movement is carried out to the new stem;Turn To step 1).
4) inquiry falls the border stem point at the crown profile of tomato plant, it is determined that falling the portion in the crown profile of tomato plant Divide stem point;Go to step 5).
5) if the part stem point fallen in the crown profile of tomato plant is less than predetermined threshold W (W round numbers, it is preferable that W Take 5), then go to step 1);Otherwise step 6) is gone to.
6) choose a part of stem point in crown profile, be written to a new stem, and be connected in two-dimentional stem, examine The feature structure the feature whether new stem length degree meets Lycopersicon spp is looked into, if improper, the new stem is suitably trimmed Or extend;Check whether new link position meets the feature structure feature of Lycopersicon spp, if improper, the new stem is entered The appropriate movement of row, otherwise goes to step 1).
Above procedure circulation is carried out, until total plants stems number reaches tomato plant characteristic requirements.
After the duplication of stem is carried out, correct, new two-dimentional stem contains N (N>Q) individual stem.Rotate all two dimensions Stem, to obtain a three-dimensional stem, it is uniformly distributed stem as far as possible during this, and it is similar to the stem that user sketches the contours.
Stem in new two-dimentional stem is divided into two parts, i.e., original stem and duplication stem, what original stem sketched the contours from user Two-dimentional stem, and stem is replicated from the duplication to original stem.The rotary course of stem is to make its angle equal by rotating all stems Even distribution, and make original stem smaller around the anglec of rotation of all directions in rotary course, the purpose is to the three-dimensional stem for making to obtain to exist Upright projection on x/y plane (as shown in Figure 3) keeps original two dimension to sketch the contours shape substantially, and ensures that all stems are evenly distributed.
In an optional embodiment, the stem sketched the contours to user on single width tomato plant image rotates, can With including:
If stem end is original stem, if original stem is the stem sketched the contours of from root node, without rotation;Otherwise, will be original Stem is around longitudinal axis anglec of rotation cσ;As stem end for replicate stem, by stem around longitudinal axis anglec of rotation cσ, then further around transverse axis anglec of rotation dσ
Wherein, cσ=σ * 2* π/N, dσ=π * (- 1)σ/ M, N are the sums of two-dimentional stem in two-dimentional stem, and σ is the sequence number of stem, M It is a constant.
In actual applications, the detailed process of the rotation of stem can be carried out as follows:
1) a two-dimentional stem l is read inσ(σ=0,1,2 ... N), if the stem is original stem, goes to step 2), otherwise goes to Step 5).
2) such as stem end lσRank be 0, go to step 3), otherwise go to step 4).
Wherein, it is 0 rank to define from the stem of root node, and the stem grown on 0 grade is 1 grade, the like.
3) without rotation.Known stem lσRoot node be P0(x0,y0,z0=0), P0It is converted to a three-dimensional point P0’ (x0,y0,z0=x0), wherein conversion is by z assignment x0To realize.For stem lσOn other arbitrary point P (x, y, z= 0), its three-dimensional position is arranged to P ' (x, y, z=z0), it is provided with being by by z assignment z0To realize;Go to step 1).
4) by stem lσAround Y-axis anglec of rotation cσ(in the coordinate system shown in Fig. 3, input picture is located at X/Y plane);Wherein cσ Calculated by following formula:cσ=σ * 2* π/N (wherein N is the sum of two-dimentional stem in new two-dimentional stem);Go to step 1).
5) in the coordinate system shown in Fig. 3, by stem lσAround Y-axis anglec of rotation cσ, then by stem lσAround X-axis anglec of rotation dσ。 cσCalculated by formula:cσ=σ * 2* π/N, and dσCalculated by formula:dσ=π * (- 1)σ/ M, wherein N are two-dimentional in two-dimentional stem The sum of stem, σ are the sequence numbers of stem, and M is a constant, it is preferable that M=10, goes to step 1).
Process circulation is carried out, until all stems are all traversed.
It should be noted that although term " x-axis ", " y-axis " and " z-axis " is some in specific pattern for illustrating herein Direction, it should be appreciated that these terms do not refer to absolute direction.In other words, " x-axis " can be arbitrary corresponding axle, and " y-axis " can For the specific axis different from x-axis.Generally, x-axis is perpendicular to y-axis." z-axis " is different from " x-axis " and " y-axis ", and is typically normal to " x Both axle " and " y-axis ".
A three-dimensional stem is just had been obtained for after being replicated, being corrected and being rotated to stem, but in three-dimensional stem Some three-dimensional stems and the angle of adjacent blades are problematic, and this can cause the unnatural of total, for example, some angles are excessive, one A little angles are too small.Therefore, it is necessary to which some three-dimensional stems are adjusted.
In an optional embodiment, the step of embodiment of the present invention also includes adjusting the Branch Angle of three-dimensional stem. The regulation process of the Branch Angle of three-dimensional stem includes coarse adjustment and fine tuning.
Preferably, the Branch Angle of three-dimensional stem is adjusted, can specifically be included:
For the arbitrary three-dimensional stem lσ(σ=0,1,2 ... N), his father's stem are lf, duplication stem is lk;Wherein f=0, 1,2 ... N, k=0,1,2......N, N are stem sum, and span is 0~3Q, and Q is user on single width tomato plant image The number of the stem sketched the contours, is followed the steps below:
Coarse tuning process includes:If lfLevel of approximation and lσAnd lfBetween angle thetaσfFor obtuse angle, then by lσRevolved around the longitudinal axis Turn C degree;If lσAnd lkBetween angleLess than certain threshold value, then by lσAround longitudinal axis counter-rotating B angles;Then, fine tuning Process includes:If lfWith the l after horizontal plane near normal and coarse adjustmentσAnd lfBetween angle thetaσfLess than certain threshold value, then exist L after coarse adjustmentσAnd lfL is rotated in the plane of compositionσMake it away from lfAngle D;Otherwise, if l after coarse adjustmentσAnd lfBetween folder Angle θσfMore than certain threshold value, then the l after coarse adjustmentσAnd lfL is rotated in the plane of compositionσMake it close to lfAngle E.
In actual applications, specific step can include:
(in the following step, B, C, D, E are angle constants, are determined by experiment)
1) a three-dimensional stem l is read inσ(σ=0,1,2 ... N), his father's stem are lf(f=0,1,2 ... N).Wherein N is stem sum, Span is 0~3Q, and Q is the number for the stem that user sketches the contours on single width tomato plant image.Such as stem end lσIt is an original Beginning stem, then step 1) is gone to, otherwise goes to step 2).
2) stem l is assumedσCorresponding original stem is lk, i.e. lσIt is by lk(k=0,1,2......N) obtained duplication is replicated Stem.Coarse tuning process includes:If lfLevel of approximation and lσAnd lfBetween angle thetaσfFor obtuse angle, by lσAround Y-axis rotate C degree with Reduce angle;If lσAnd lkBetween angleLess than certain threshold value, by lσAround Y-axis counter-rotating B angles to increase angle; Go to step 3).
3) fine-tune:If lfWith horizontal plane near normal and lσAnd lfBetween angle thetaσfLess than certain threshold value, lσAnd lfL is rotated in the plane of compositionσMake it away from lfAngle D, to increase its angle, step 1) is gone to, otherwise goes to step 4)。
If 4) lσAnd lfBetween angle thetaσfMore than certain threshold value, in lσAnd lfL is rotated in the plane of compositionσLean on it Nearly lfAngle E, to reduce its angle, go to step 1).
Because coarse adjustment is rotated around Y-axis, compared to more saving the time for fine tuning, therefore most of angle is reached by coarse adjustment To requiring, and only small part angle needs fine tuning, can so reduce run time to the full extent.
By the duplication, rotation and regulation of stem, the equally distributed three-dimensional stem skeleton of a stem can be obtained.
Step S3, according to the parameter of three-dimensional stem, build and train a BP neural network.
Assuming that lσIt is by his father's stem lfOn node Px(x=0,1,2 ... Tf) any stem for bearing.Wherein, TfFor father's stem lf Total nodal point number, it is integer.The hypothesis is not construed as implementing the present invention just for the sake of the embodiment of the present invention is better described The limitation of example.
In an optional embodiment, building the process of BP neural network can include:
BP neural network Net input is father's stem lfParameter, it includes normalized lfDirection, i.e. (vf.x,vf.y, vf), in addition to P .zxIn stem lfOn relative position, i.e. r=length (P0→Px)/length(lf), that is, some point Px To P0The distance of point is than the length of upper whole branch stem, in addition to node PxThe l at placeσFraternal stem number mesh, i.e.,:By node PxBear at place , except lσThe number of other stems in addition.Output is stem lσDirectioin parameter, it includes lσAnd lfBetween angle thetaσfCosine, i.e., cosθσf, and lσWith fraternal stem lkBetween angleCosine, i.e.,Thus construct three layers of BP nerve nets Network, its each layer nodal point number are 5-10-2, as shown in Figure 4.
Neutral net Net uses S type function f (x)=1/ [1+exp (- x)].Weights between adjacent layer are adjusted by training Section.Preferably, training process is as follows:
Known j is a node of hidden layer or output layer, then node j input sjIt is the weighting of preceding layer output With that is,:
Wherein, wijIt is the weights between preceding layer node i and current layer node j, yiIt is preceding layer node i output.It is false If node j threshold value is θj, then node j's actually enters ujIt is as follows:
Node j output yjIt is:
yj=f (uj)=f (sjj) (3)
In above formula, f (x) represents S type functions.
Data for BP neural network training are by being calculated to stem.The training of BP neural network includes Two processes:Forward calculation and back-propagation.
In an optional embodiment, the detailed process of BP neural network training can include:
1) parameter calculating is carried out to all stems of three-dimensional stem, input and output training data as Net;
2) Net initial weight and threshold value is set;
3) forward calculation:The output of input layer node is equal to its input xi,, and hidden layer or output layer node j input ujWith output yjIt can be calculated by following formula:
yj=f (uj[the 1+exp (- u of)=1/j)] (5)
4) backpropagation of error:The amendment of error is calculated by formula (6):
ΔwIj=wij(n+1)-wij(n)=η δjyi (6)
Wherein η represents learning rate, and n represents iterations, yiIt is preceding layer node i output, if j is output layer knot Point, then
δj=f ' (uj)(dj-yj)
=yj(1-yj)(dj-yj) (7)
Wherein, djRepresent output layer node j target output.If j is hidden layer node,
5) circulation of forward and backward process is carried out until the quadratic sum of error is less than a definite value or cycle-index reaches Maximum.After the completion of BP neural network training, side stem breeding parameter is predicted with it.
Step S4, the crown profile sketched the contours based on user on single width tomato plant image, is predicted by BP neural network Side stem parameter, and produce side stem using self-similar principle.
Side stem modeling parameters are predicted using the BP neural network trained, to reach the purpose that parameter automatically adjusts.BP Neutral net Net is based on the new side stem directioin parameter of existing stem particularly his father's stem parameter prediction.Side stem is three-dimensional by replicating Stem is obtained, and the angle parameter between side stem and three-dimensional stem and side stem and its fraternal stem is predicted from BP neural network, and is used The crown profile that family is sketched the contours is used to constrain the crown profile that side stem is formed.Based on self-similar principle, side stem is inferred to obtain by stem, And be connected to reasonable manner on stem, so new stem just remains the features of shape of stem.
In an optional embodiment, producing the specific steps of side stem can include:
Step 1) is for any stem lf, its part is replicated, is rotated, translated, and this part that will be replicated It is connected to lfSome node on, thus obtained a new stem lσ.In this process, lσAnd lfBetween angle thetaσf、lσ With its fraternal stem lkBetween angleShould be in certain angular range, i.e. Range (θσf) and
Angular range in step 2) step 1) is predicted to obtain in the following manner by BP neural network Net:lfParameter It is known, they are the inputs of BP neural network;lσAnd lfBetween angle thetaσf(use cos θσfRepresent), lσAnd lkBetween folder Angle(useRepresent) it can be obtained by Net forward calculation (formula (5)), angular range Range (θσf) andCalculated by below equation:
Range(θσf)=[cos θσf-0.2,cosθσf+0.2] (9)
Step 3) searches for a direction vector vσ, make itself and lfBetween angle, and and lkBetween angle simultaneously respectively Fall in Range (θσf) andIt is interior, vσIt is exactly stem lσDirection vector.
In the stem modeling process of side, the crown profile that user sketches the contours on single width tomato plant image is used for the trimming of stem. Finally, by the way that three-dimensional stem is converted into generalized cylinder, the three-dimensional stem similar to two-dimentional input is formed.
Step S5, based on leaf model, leaf is added for side stem, obtains intact plant.
Specifically, each leaf (or fruit) is represented with the quadrangle of a channel image texture of band 4.Leaf (or fruit Addition in fact) is realized by making phyllotaxy and being put on stem polygon leaf model.Added in leaf (or fruit) Cheng Zhong, the position of leaf, the angle in direction and Ye Yuye, the angle of leaf and stem, introduces enchancement factor.Ye Yuye, and Real data of the average angle of leaf and stem based on measurement or priori adjust.It so can be obtained by textured and leaf Three-dimensional tomato model.
In experiment, the embodiment of the present invention is modeled using 2GHzCPU computer, the structure of two-dimentional stem and three The modeling of dimension stem needs several seconds, and the reproduction speed of side stem is about 200 stems of increase per second.After the completion of sketch sketches the contours, tomato The time of plant modeling is usually no more than 1 minute.Fig. 5 a to Fig. 5 i show experimental result.Wherein, Fig. 5 a are according to an example Property implement the schematic diagram of input picture 1 that exemplifies;Fig. 5 b are the sketch that the user according to an exemplary embodiment sketches the contours 1;Fig. 5 c are the threedimensional model 1 according to an exemplary embodiment;Fig. 5 d are the input according to an exemplary embodiment Image 2;Fig. 5 e are the sketch 2 that the user according to an exemplary embodiment sketches the contours;Fig. 5 f are according to an exemplary embodiment The threedimensional model 2 shown;Fig. 5 g are the input picture 3 according to an exemplary embodiment;Fig. 5 h are according to an exemplary reality Apply exemplify sketch the contours sketch 3;Fig. 5 i are the threedimensional model 3 according to an exemplary embodiment.
Above-mentioned experimental result and the tomato plant modeling method based on BP neural network, can be used for field of virtual reality Scene simulation, there is actual application value.
It should be noted that each square frame in flow chart or block diagram can represent one of a module, program segment or code Point, a part of one or more that can include of the module, program segment or code is advised for realizing in each embodiment The executable instruction of fixed logic function.It should also be noted that in some realizations alternately, the function that is marked in square frame It can also occur according to the order different from being marked in accompanying drawing.For example, two square frames succeedingly represented can essentially base Originally it is performed in parallel, or they can also be performed in a reverse order sometimes, this depends on involved function.Equally should , can be with when it is noted that the combination of the square frame in each square frame and flow chart and/or block diagram in flow chart and/or block diagram Realized using function as defined in execution or the special hardware based system of operation, or specialized hardware and meter can be used The combination of calculation machine instruction is realized.
Particular embodiments described above, the purpose of the present invention, technical scheme and beneficial effect are carried out further in detail Describe in detail it is bright, should be understood that the foregoing is only the present invention specific embodiment, be not intended to limit the invention, it is all Within the spirit and principles in the present invention, any modification, equivalent substitution and improvements done etc., it should be included in the guarantor of the present invention Within the scope of shield.

Claims (7)

1. a kind of tomato plant modeling method based on BP neural network, it is characterised in that this method comprises the following steps:
Step S1, the stem sketched the contours based on user on single width tomato plant image, builds two-dimentional stem;
Step S2, the crown profile sketched the contours based on the user on the single width tomato plant image, by the user The stem sketched the contours on the single width tomato plant image is replicated, corrected and rotated, to build three-dimensional stem;
Step S3, according to the parameter of the three-dimensional stem, build and train a BP neural network;
Step S4, the crown profile sketched the contours based on the user on single width tomato plant image, passes through the BP neural network Side stem parameter is predicted, and side stem is produced using self-similar principle;
The step S4 is specifically included:
Based on self-similar principle, the three-dimensional stem is replicated, to produce side stem;
The angle between the side stem and the three-dimensional stem and the side stem and its fraternal stem is predicted using BP neural network Parameter;
The crown profile sketched the contours based on the user on single width tomato plant image, the crown profile that constraint side stem is formed;
Step S5, based on leaf model, leaf is added for the side stem, obtains intact plant.
2. according to the method for claim 1, it is characterised in that it is described to the user in the single width tomato plant image On the stem that sketches the contours replicated, specifically include:
All stems of whole two-dimentional stem are traveled through based on hierarchical order;
All fall the stem in the crown profile of the tomato plant sketched the contours in the user for all stem spot projections, by former stem size Replicated and relative position is constant;
Fall the stem in the crown profile of the tomato plant sketched the contours in the user for part stem spot projection, if described crown Stem points in profile are more than or equal to predetermined threshold, only replicate stem point in the crown profile and position is constant, if institute State the points of the stem in crown profile and be less than predetermined threshold, then do not replicate the stem.
3. according to the method for claim 2, it is characterised in that it is described to the user in the single width tomato plant image On the stem that sketches the contours corrected, specifically include:
According to the feature structure feature of Lycopersicon spp, the length of all stems of the two-dimentional stem is trimmed or extended, and The position of all stems of the two-dimentional stem is moved.
4. according to the method for claim 3, it is characterised in that the user is hooked on the single width tomato plant image The stem of Le is rotated, and is specifically included:
If the stem is original stem, if the original stem is the stem sketched the contours of from root node, without rotation;Otherwise, will The original stem is around longitudinal axis anglec of rotation cσ
If the stem is replicates stem, by the stem around longitudinal axis anglec of rotation cσ, then further around transverse axis anglec of rotation dσ
Wherein, cσ=σ * 2* π/N, dσ=π * (- 1)σ/ M, N are the sums of two-dimentional stem in two-dimentional stem, and σ is the sequence number of stem, and M is one Individual constant.
5. according to the method for claim 4, it is characterised in that the step S2 also includes:Adjust the three-dimensional stem Branch Angle.
6. according to the method for claim 5, it is characterised in that the Branch Angle of the regulation three-dimensional stem, specifically Including:
For the arbitrary three-dimensional stem lσ, his father's stem is lf, duplication stem is lk;Wherein described σ=0,1,2 ... N, f=0,1, 2 ... N, k=0,1,2......N, N are stem sum, and span is 0~3Q, and Q is that user hooks on single width tomato plant image The number of the stem of Le, is followed the steps below:
Coarse tuning process includes:If lfLevel of approximation and lσAnd lfBetween angle thetaσfFor obtuse angle, then by lσC is rotated around the longitudinal axis Degree;If lσAnd lkBetween angleLess than certain threshold value, then by lσAround longitudinal axis counter-rotating B angles;Then carry out following Step:
Fine-tuning process includes:If lfWith the l after horizontal plane near normal and coarse adjustmentσAnd lfBetween angle thetaσfLess than certain Threshold value, the then l after coarse adjustmentσAnd lfL is rotated in the plane of compositionσMake it away from lfAngle D;Otherwise:
If the l after coarse adjustmentσAnd lfBetween angle thetaσfMore than certain threshold value, then the l after coarse adjustmentσAnd lfIn the plane of composition Rotate lσMake it close to lfAngle E.
7. according to the method for claim 1, it is characterised in that the structure BP neural network, specifically include:
For by his father's stem lfOn node Px, any stem l for bearingσ, wherein, the x=0,1,2 ... Tf, TfFor father's stem lfAlways Nodal point number, round numbers, configured as follows:
The input for configuring the BP neural network is father's stem lfParameter, it includes normalized lfDirection, node PxIn lfOn Relative position, and node PxThe l at placeσFraternal stem number mesh;
The output for configuring the BP neural network is stem lσDirectioin parameter, it includes lσAnd lfBetween angle thetaσfCosine, and lσWith fraternal stem lkBetween angleCosine.
CN201510711702.5A 2015-10-28 2015-10-28 Tomato plant modeling method based on BP neural network Active CN105303606B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510711702.5A CN105303606B (en) 2015-10-28 2015-10-28 Tomato plant modeling method based on BP neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510711702.5A CN105303606B (en) 2015-10-28 2015-10-28 Tomato plant modeling method based on BP neural network

Publications (2)

Publication Number Publication Date
CN105303606A CN105303606A (en) 2016-02-03
CN105303606B true CN105303606B (en) 2018-01-26

Family

ID=55200823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510711702.5A Active CN105303606B (en) 2015-10-28 2015-10-28 Tomato plant modeling method based on BP neural network

Country Status (1)

Country Link
CN (1) CN105303606B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739714A (en) * 2008-11-14 2010-06-16 北京大学 Method for reconstructing plant branch model from image
CN101847267A (en) * 2010-06-01 2010-09-29 中国科学院自动化研究所 Tree modeling method based on depth search
CN101866495A (en) * 2010-06-01 2010-10-20 中国科学院自动化研究所 Tree modeling method based on skeleton point cloud
CN104408765A (en) * 2014-11-11 2015-03-11 中国科学院深圳先进技术研究院 Plant scanning and reconstruction method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739714A (en) * 2008-11-14 2010-06-16 北京大学 Method for reconstructing plant branch model from image
CN101847267A (en) * 2010-06-01 2010-09-29 中国科学院自动化研究所 Tree modeling method based on depth search
CN101866495A (en) * 2010-06-01 2010-10-20 中国科学院自动化研究所 Tree modeling method based on skeleton point cloud
CN104408765A (en) * 2014-11-11 2015-03-11 中国科学院深圳先进技术研究院 Plant scanning and reconstruction method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《基于BP神经网络的番茄叶面积指数测定方法研究》;马丽丽等;《中国蔬菜》;20091231(第16期);45-50 *
《基于模糊神经网络的植物生长建模》;王光等;《计算机工程》;20120331;第38卷(第6期);273-275 *

Also Published As

Publication number Publication date
CN105303606A (en) 2016-02-03

Similar Documents

Publication Publication Date Title
CN109255831B (en) Single-view face three-dimensional reconstruction and texture generation method based on multi-task learning
Livny et al. Automatic reconstruction of tree skeletal structures from point clouds
CN108510577B (en) Realistic motion migration and generation method and system based on existing motion data
Pirk et al. Plastic trees: interactive self-adapting botanical tree models
CN101866495B (en) Tree modeling method based on skeleton point cloud
CN107924563A (en) Odontotherapy and the assessment based on photo of operation
CN106548208A (en) A kind of quick, intelligent stylizing method of photograph image
CN105069746A (en) Video real-time human face substitution method and system based on partial affine and color transfer technology
Li et al. Learning to reconstruct botanical trees from single images
CN112991502B (en) Model training method, device, equipment and storage medium
CN110097609A (en) A kind of fining embroidery texture moving method based on sample territory
CN109949386A (en) A kind of Method for Texture Image Synthesis and device
CN113111861A (en) Face texture feature extraction method, 3D face reconstruction method, device and storage medium
CN109191366A (en) Multi-angle of view human body image synthetic method and device based on human body attitude
CN101847267B (en) Tree modeling method based on depth search
CN101356549B (en) Defrobulated angles for character joint representation
Zhang et al. Virtual reality design and realization of interactive garden landscape
Chen Research on college physical education model based on virtual crowd simulation and digital media
CN106570935A (en) Vegetation distribution simulation method and apparatus
CN105303606B (en) Tomato plant modeling method based on BP neural network
CN108320326A (en) A kind of three-dimensional modeling method for human hand
Zhou et al. Deeptree: Modeling trees with situated latents
CN110264551B (en) Motion redirection method and system
Galbraith et al. Implicit visualization and inverse modeling of growing trees
CN104091318B (en) A kind of synthetic method of Chinese Sign Language video transition frame

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant