Summary of the invention
Goal of the invention: the present invention is directed to the deficiencies in the prior art, a kind of method of the colour vision feature of three-dimensional model being classified based on neural network is provided.
Technical scheme: the invention provides a kind of method for sorting colors of the colorful three-dimensional model based on neural network, this method may further comprise the steps:
Step 1 is obtained three-dimensional model at actual object by 3-D scanning equipment or virtual modeling software;
Step 2 is set up the three-dimensional modeling data storehouse, with the three-dimensional model file storage obtained in the last step in the three-dimensional modeling data storehouse;
Step 3 reads the model data set that is used to train identification in the three-dimensional modeling data storehouse, the model data set input three-dimensional model characteristic extracting module that reads is extracted the color characteristic of three-dimensional model;
Step 4 from aspect of model database, reads the characteristic of three-dimensional model color aspect;
Step 5, the quantization sensing device of formulation color characteristic; Promptly specifically formulate the classification quantitative rule according to the numerical range of the color attribute that is obtained.At first measure the whole codomain scope of color attribute numerical value, then according to the actual classification demand with color numerical value five equilibrium or be not divided into the several interval codomain of requirement five equilibrium, define the object vector in each sub-range by the threshold value of analyzing the numerical range of color attribute in each class sub-range, neural network will need to finish judgement to color classification according to the object vector that this quantization sensing device defines out in subsequent step.
Step 6 obtains representing the tlv triple color feature vector of three-dimensional body color characteristic;
Step 7 is set up the analysis of neural network module, and adjusts network parameter;
Step 8 is carried out the decision-making computing of color feature vector by neural network;
Step 9, according to the discrimination formula of neural network, neural network output is to the recognition result of the color classification of three-dimensional model.
Among the present invention, described three-dimensional model is the three-dimensional model that contains the illumination color information, its color attribute comprises: the light color of the reflection colour of external light source, the color of direct reflection, geometrical body self emission, by adopting the tlv triple proper vector to describe, color attribute is quantized on three color dimensions in this RGB unit cube space respectively.
Among the present invention, the input vector of neural network is a tri-vector.
Among the present invention, the color recognition rule of three-dimensional model is the two-value rule in the step 3.
Among the present invention, network parameter comprises weight matrix W and bias vector b in the step 7.
Among the present invention, neural network is single-layer perceptron network or feedback-type Hopfield network in the step 7.
Among the present invention, the quantization sensing device of color characteristic described in the step 5 is formulated the classification quantitative rule according to the numerical range of the color attribute that is obtained.
Beneficial effect: increasing modeling software such as Maya, 3DMAX, Cult3D all provides the visual modeling function of comprehensive three-dimensional body now, and the mock-up on the internet is imbued with the sense of reality more and causes the characteristic information amount huge; Fields such as the industrial design of more and more widely using at three-dimensional model simultaneously, recreation education, video display animation, machine-building, medical research, Military Simulation, the generation of mass data makes that also Model Identification can not be only by manually finishing.Therefore, utilizing neural network to assist systematic searching to contain the three-dimensional model of certain color information, is to accelerate three-dimensional model search speed, makes complicated and diversified characteristic quantity analyze more efficiently a kind of mode.The method of the color identification classification then of the three-dimensional model based on neural network of the present invention has fault-tolerance preferably to the color identification of sense of reality three-dimensional model, can discern the input pattern that has noise or distortion, has very strong adaptive learning ability.The specific artificial neural network that adopts in the patented method (such as, Perceptron network, Hopfield network) all can effectively and correctly carry out the color recognition of three-dimensional body.Wherein, single-layer perceptron network structure and algorithm are fairly simple, and the training time is shorter, but recognition effect than the Hopfield network a little less than; And the Hopfield network has the learning ability voluntarily of associative memory, and fault-tolerance is better.At the details technical elements, in the colour vision tagsort method of the present invention, formulate the technology of the quantization sensing device of visual signature and use the tlv triple vector to have good dirigibility; Be convenient to the user and realize expansion according to the actual requirements, make sensor can increase more complex rule storehouse or employing reasoning notion quantification primitive character value, thereby the dimension of the feasible object vector of formulating can expand to more high-dimensional formation eigenmatrix, and so just the pattern-recognition for three-dimensional model provides the facility that more visual signatures such as texture color, material color are combined.Simultaneously, the mode of the adjustment network parameter of analysis of neural network module can make decision process further optimize again; The formulation of neural network discrimination formula also has dirigibility, can expand according to the actual requirements, makes that the neural network with certain fault-tolerance still can correctly be finished pattern classification under the situation that the loss of noise or input signal Partial Feature is arranged.Therefore, say on the whole, utilize the technology based on neural network of the present invention to finish the pattern-recognition of colorful three-dimensional model, not only can improve classification capacity according to more sample study, and do not need some statistical hypothesis are carried out in the identification of object, loosen the required constraint condition of classic method, reduced the influence of artificial subjective factor.Extensibility on the technology of the present invention, again simultaneously for more separately independently the fusion recognition of bottom visual signature approach is provided, make that how basic visual signature can be by Conjoint Analysis, thereby promote to derive the possibility of high-level semantic feature, for the retrieval of the raising nicety of grading of three dimension realistic model provides certain help.
Embodiment
As shown in Figure 1, the present invention discloses a kind of method for sorting colors of the colorful three-dimensional model based on neural network, and this method may further comprise the steps:
Step 1 is obtained three-dimensional model at actual object by 3-D scanning equipment or virtual modeling software;
Step 2 is set up the three-dimensional modeling data storehouse, with the three-dimensional model file storage obtained in the last step in the three-dimensional modeling data storehouse;
Step 3 reads the model data set that is used to train identification in the three-dimensional modeling data storehouse, the model data set input three-dimensional model characteristic extracting module that reads is extracted the color characteristic of three-dimensional model;
Step 4 from aspect of model database, reads the characteristic of three-dimensional model color aspect;
Step 5, the quantization sensing device of formulation color characteristic; Just specifically formulate the classification quantitative rule according to the numerical range of the color attribute that is obtained.At first measure the whole codomain scope of color attribute numerical value, then according to the actual classification demand with color numerical value five equilibrium or be not divided into the several interval codomain of requirement five equilibrium.Such as needs color model is divided three classes, is provided with between three main chromatic zoneses with regard to five equilibrium and forms the sub-range, define the representation vector in each sub-range by the threshold value of analyzing the numerical range of color attribute in each class sub-range.The color object vector that representation vector is just formulated out by this kind quantizing rule, the object vector that neural network will need to utilize this quantization sensing device to define out in subsequent step is finished the judgement to color classification, just need the result vector of the concrete output of neural network and the object vector between each chromatic zones are made comparisons, if equate, belong to this kind color type with regard to the decision model color.
Step 6 obtains representing the tlv triple color feature vector of three-dimensional body color characteristic;
Step 7 is set up the analysis of neural network module, and adjusts network parameter weight matrix W and bias vector b.The neural network that the present invention uses all is neural networks of common maturation, mainly for example: perceptron network (individual layer Perceptron network), feedback-type network (Hopfield network).Its structure means adopt popular general Matlab Software tool to realize, the neural network of directly calling in the Neural Network Toolbox that it provided in the Matlab environment is set up function, can set up various common neural network modules by adjusting function parameters.
Step 8 is carried out the decision-making computing of color feature vector by neural network.The decision-making calculating process of neural network is according to the concrete neural network that adopts and separately different, but on the whole, the purpose of decision process all is finally to calculate object vector, and these object vectors are unique and represent the various object features that need be distinguished independently.For example decision process is exactly the object vector that calculates the color characteristic identification that is used for three-dimensional model in the present embodiment, and specifically, neural network is read in the color feature vector of some three-dimensional body reality, the element of arithmetic operation in should vector; For different neural network configuration, have different working rules, for example, its decision-making computing of the individual layer Perceptron network that uses among the present invention is exactly the linear partition process to the individual element variable, and the Hopfield network is the iteration deterministic process to a plurality of element variables.
Step 9, according to the discrimination formula of neural network, neural network output is to the recognition result of the color classification of three-dimensional model.Neural network to the arithmetic operation in this actual color feature vector completing steps 8 that reads in after, just according to the object vector of the tlv triple color characteristic that has defined in the step 6, the output result who obtains is compared with object vector, if equate just to judge that this result belongs to this object vector, also belong to the colour type of this object vector representative with regard to the actual color of the object of making a strategic decision out.
The present invention is intended to tlv triple colour vision feature is learnt and be discerned based on neural network, thereby realizes the classification of three-dimensional body according to color characteristic.The core of sorting technique of the present invention is: the visual signature to the color aspect of three-dimensional model is described, proposition is based on the identification step of color characteristic, mainly be to have designed the common color attribute that a kind of tlv triple visual feature vector is used to describe three-dimensional model, and realize the visual signature of color aspect is carried out discriminator by setting up specific neural network (as: Perceptron perceptron network, Hopfield feedback network).Simultaneously, among the present invention specific design an enforcement example based on the color classification device of Hopfield network, be used to illustrate the implementation method of the three-dimensional model of a series of colored toy buildings being carried out color classification according to its material color.
As shown in Figure 1, the method for sorting colors of a kind of colorful three-dimensional model based on neural network of the present invention specifically may further comprise the steps:
(1) by 3-D scanning equipment or virtual modeling software, obtains three-dimensional model at actual object.
(2) in computing machine, adopt database software commonly used to set up the three-dimensional modeling data storehouse.The three-dimensional model file storage that step () is got access to is in the three-dimensional modeling data storehouse.If the model that step () is obtained relates to various object classifications (such as, natural forms modeler model), then form the general three-dimensional model bank; If step () model that is obtained only relate to a certain kind object (such as, biomolecule model, CAD part model), then form the professional domain 3 d model library.The present invention points out because that subsequent step is analyzed is required, then will at model be the sense of reality colorful three-dimensional model that must comprise color class information.
(3) from the general or professional domain three-dimensional modeling data storehouse that step (two) is set up, read the model data set that is used to train recognition system, the model set input three-dimensional model characteristic extracting module that reads is handled.Characteristic extracting module adopts some typical feature extraction algorithms that three-dimensional model is carried out signature analysis such as shape, topology, color, texture, material etc., is in order to extract model characteristic vector data in these areas.For machine (as video input apparatus such as camera, camera, scanners), color system is a master pattern with the RGB color model often, produce 24 color spaces by red (R), green (G) of each pixel, the sensitive volume of blue (B) sensor devices, color character C is described as: C=R+G+B.And, can carry out for example color histogram analysis usually, common color characteristic extraction and analysis such as the low order color moment analysis of color distribution information for the color character of the three-dimensional model that gets access to.Such as, the method for conventional calculating color histogram is exactly that color space is divided between several little chromatic zoneses, and each interval becomes a histogrammic handle, and this process is called color quantizing; Then, the pixel quantity that drops in each minizone by the calculating color can obtain color histogram.In the RGB color space, color histogram can be regarded the discrete function of an one dimension as.After feature extraction algorithm is finished analysis to model, the model color feature vector that is calculated will be stored in the model color characteristic database.
(4) from the aspect of model database that step (three) is set up, read the characteristic of color aspect.Because three-dimensional model has comprised geometric configuration often through the proper vector that processing generated of characteristic extracting module, color, texture, many-sided visual signature data such as material, even also relate to many-sided description in a certain class visual signature data, attribute such as relevant colors just has original rgb value, transparency variables A lpha, owing to may also have complicated lighting effect in actual applications, the basic color of model also can be subjected to surround lighting, diffuse reflection, direct reflection, influences such as emission light, the sense of reality color computing method that produce behind the illumination action model are generally: model surface color=material is dispersed color+decay factor * spotlight effect (surround lighting+diffuse+direct reflection).Situation when only describing the original RGB color numerical value of himself attribute among the present invention for simplicity in the description selection three-dimensional model, these characteristics will be structured in the tlv triple visual signature of color aspect by the analysis of quantization sensing device in the following step.
(5) the quantization sensing device of formulation color characteristic.The characteristic quantification sensor is the artificial quantizing rule of setting of a cover, promptly formulates the classification quantitative rule by the user according to the numerical range of the color attribute that is obtained.At first measure the whole codomain scope of color attribute numerical value, then according to the actual classification demand with color numerical value five equilibrium or be not divided into the several interval codomain of requirement five equilibrium.For example at the three-dimensional model of the RGB attribute value of having obtained, make up the numerical range that its tlv triple vector aspect color just needs to consider the color attribute of R, G, B three aspects.Therefore be divided into the sub-range of three main colors between color zones with color model, numerical range to the interval quantization analytic attribute that forms, upper and lower bound numerical range according to the numerical value value size of color attribute in each class sub-range defines object vector representative on each sub-range, can describe in detail below with reference to Fig. 2 with reference to the description rule in RGB color cube space for the described object of RGB color model.The color object vector of formulating out by this kind quantizing rule, in subsequent step, will offer the judgement that neural network is used to finish color identification, just neural network need be made comparisons the result vector of network output and the object vector between each chromatic zones, belongs to this kind color type if equate with regard to the decision model color.Therefore, the effect of quantization sensing device is exactly the color characteristic parameter according to the three-dimensional model that obtains from hardware device, suitable rule is formulated in statistical study by feature codomain scope, in order to the color characteristic of quantitative test three-dimensional model, the neural network after making it realizes the purpose of the qualitative differentiation of color.
The characteristic quantification principle of sensors: coming from object of the common resolution of human brain is the mechanism of judging from its outward appearance at first.Human brain not only can be distinguished out difference on the object meaning based on the outer shape feature in the process of certain concrete object of identification, and many times can finish from the analysis of features such as color, texture and material the details of object is distinguished.When the object external form is similar, apparent based on the importance of the visual signature of color.Wherein, RGB color model (Red Green Blue color model) is the most common expression mode of model color in the three-dimensional modeling scene.Can constitute a class color space and can be described as an XYZ cubic space that constitutes by the RGB rectangular coordinate system by the RGB three primary colours, red (R), green (G), blue (B) respectively corresponding three coordinate axis, true origin is represented black, represents white from initial point diagonal angle farthest.Therefore, the color attribute that is described as three-dimensional model based on this quantification space among the present invention designs a kind of tlv triple vector, to express model in the visual signature amount aspect the color, in order to differentiate the color of various models.
For a concrete three-dimensional model that contains the illumination color information, its color attribute that relates to generally includes: the light color (Emissive color) of the color (Specular color) of the reflection colour of external light source (Diffuse color), direct reflection, geometrical body self emission etc.By adopting the tlv triple proper vector to describe, these color attributes can quantize on three color dimensions in this RGB unit cube space respectively.
In the characteristic quantification process of a reality, feature is divided into the quantization level of two-layer or multilayer, and the characteristic parameter of selection is accepted or rejected at the significance level of thingness, and the complexity of quantizing rule is determined according to the precision of when retrieval needs.The color recognition example of three-dimensional model in the present invention is exactly to have used the most succinct two-value rule: for example, the black and white of the light and shade of the color of light photograph of object, color is carried out two classes when distinguishing, according to RGB cube color space, average as intermediate quantity, be vectorial RGB=[0.5 0.5 0.5] color represent Intermediate grey, object vector [1 1 1] is represented white, and object vector [0 0 0] is represented black; If finish classification, be that intermediate vector can be divided into two classes roughly with model with [0.5 0.5 0.5] so according to light and shade.If therefore three-dimensional model needs distinguishing according to red, green, blue three class colors of refinement more, then the quantization sensing device need define and satisfy the color classification that red, green, blue amount of color corresponding ternary group color character object vector is used to judge three-dimensional model accordingly.
Can see that by Fig. 2 the characteristic quantification expression of space of the color attribute that adopts among the present invention is a tlv triple feature input space of being described by XYZ coordinate system.Owing to adopt the two-value quantizing rule in this step, thereby the span of XYZ coordinate herein is specific codomain [0,1], the 0 and 1 extreme feature of representative model respectively, intermediate value then representative model to the close degree of extreme feature.Adopt the quantification manner of two-value rule very succinct among the present invention, be easy to calculate, make that the neural network learning decision process commonly used in the subsequent step becomes fast simple.
(6) handle through the characteristic quantification in the step (five), will obtain unique tlv triple feature object vector of representing a certain class color characteristic of three-dimensional body clearly in this step.Tlv triple proper vector after sensor quantizes (adopting a three-dimensional array to express) is transfused to neural network and is used to discern three-dimensional body.Input vector as neural network is designed to following exemplary forms with this vector:
Suppose: by shown in Figure 2, at the red round dot that is in diverse location, green asterism, the blue side point that the feature input space is seen, the representative model that A, B, the C under the three-dimensional model that representative promptly will be classified is three types.
Definition: object A (red round dot) is P in the proper vector of the input space
1, the proper vector of object B (green asterism) is P
2, the proper vector of object C (blue side's point) is P
3
Because through characteristic extracting module, original tlv triple proper vector is expressed as:
Therefore, through the quantification treatment of two-value rule, the object vector of the color characteristic of definition three-dimensional model on above-mentioned three dimensions is:
So, in subsequent step, adopt neural network to finish the color identifying, just will need the color attribute input neural network of the three-dimensional body differentiated, and with the proper vector of output and three P of above-mentioned definition
1, P
2, P
3Object vector compares, and the color that just can draw three-dimensional model belongs to wherein one type classification results of A, B, C.The color feature vector of representing three-dimensional model is behind input neural network, and the network learning procedure that need finish specifically describes in following step (seven) and (eight).
(7) the tlv triple color feature vector of analysis of neural network quantization step (six) generation of the present invention's use is realized the color identification to three-dimensional model.Particularly, this step comprises step by step following:
(a) in the Matlab environment, set up specific neural network.The neural network configuration of some common maturations for example, what the present invention used has: single-layer perceptron network (Perceptron network), have the associative memory feedback-type network of learning ability (Hopfield network) voluntarily.
(b) the classification degree of discerning according to the three-dimensional model needs is selected the type of neural network, and determines the transport function of this neural network.
(i) for example, the present invention is for adopting single-layer perceptron (Perceptron) network when judging that two class models are divided into two parts with the input space, its transport function may be defined as the symmetric form function hardlims () of a strict threshold limit scope [1,1], i.e. a=hardlims (Wp+b).If the inner product Wp of weighting matrix W and input vector p then is output as 1 more than or equal to-b; If inner product then is output as-1 less than-b.
(ii) for feedback-type Hopfield network in judging more multiclass model classification process, the present invention adopts: a (0)=p, (one group of iterative formula of Wa (t)+b) is described transport function to a (t+1)=satlin, operates processing.Transport function satlin is defined as the asymmetric saturated linear transfer function of a threshold limit scope [0,1] in the formula; Promptly this function changes in [0,1] scope internal linear, and when importing greater than 1 the time, the upper limit is constrained to 1; On duty less than 0 o'clock, lower limit is constrained to 0.
(8) after above-mentioned neural network was set up and finished, the decision process that network is discerned the tlv triple color feature vector of three-dimensional model was as follows, and particularly, this step comprises step by step following:
(a) feature in the feature space of the present invention's design is tlv triple, so the input vector of neural network is three-dimensional (R=3).After the neural network that the tlv triple color feature vector input step (seven) of three-dimensional model (b) is set up, will be by the calculating of making a strategic decision of the neuron in the neural network.
(b) finish the judgement of decision boundary according to the discrimination formula of specific neural network, obtain classification results.For example, the discrimination formula Wp+b=0 of the single-layer perceptron network described in following (i) has just represented decision boundary, but be used to discern the object pattern of linear separation, show that the key property of single neuron perceptron is input vector to be separated into two classes.Adjust the relevant parameter (weight matrix W, bias vector b) in the network, decision boundary will change, and therefore will obtain fast or slow analytic process; For example, following Hopfield network described in (ii), the variation of parameter will make the speed of its iterative process change, concrete relevance is decided according to the parameter values size; To accelerate such as the big more iteration speed of parameter value in the present embodiment, the iteration number of plies reduces, and precision can descend; The more little iteration speed of parameter value will slow down, and the iteration number of plies increases, but precision can increase.The neural network operation is finished afterwards the output category result.
(i) the present invention is directed to when single-layer perceptron (Perceptron) network is used to differentiate two type objects, the categorised decision process is a linear process of dividing, and decision boundary is by initial point, and weighting matrix is orthogonal to decision boundary, therefore can design weighting matrix W=[0 1 0], bias vector b=0.Using formula Wp+b=0 describes decision boundary and finishes differentiation, and the literary style that discrimination formula is launched is shown below:
(ii) the present invention is directed to feedback-type Hopfield network, then the selection of parameter is determined according to the needs of category of model in the matrix, and orthogonalized weights method for designing is adopted in the design of weighting matrix W and bias vector b.The running of Hopfield network is handled and is finished differentiation with formula W p+b formal description iterative process, expands into concrete literary style, shown in following two formulas:
The decision-making assorting process comes from the iteration evolution process of neural network state.Specifically describe based on the correct iteration evolution process of the pattern classifier of Hopfield network among the present invention and be: as the vectorial X of input during as an initial value, network develops by feedback, obtain a vectorial Y from network output, Y is a stable memory of associating from initial value X evolution.Then make the stable point of the sample of memory pattern, promptly import the dissimilar vectorial X of a plurality of representatives corresponding to network
i, obtain corresponding a plurality of different object vector Y
i, this is equivalent to the training process of neural network.Can be according to actual classification demand training memory pattern (X
iTo corresponding Y
iMapping process), make that the memory pattern train is corresponding with the tagsort standard grading of three-dimensional model.Then with new data vector to be classified (being the colour vision proper vector of model to be identified) as the initial state input neural network, the memory pattern sample that network reference is known carries out associative recall, is promptly recalled the function of the Y that certain previously-known by the initial state X ' that newly gives.Particularly, network is regarded initial state X ' as a kind of new prompt modes (some distortion promptly takes place and contain the memory pattern of noise), thereby finishing iteration by known memory pattern develops, make initial state X ' converge to the pairing object vector Y of known vector X part, so just new X ' has been evolved into the vectorial Y of a certain known target from self " the most approaching " (differing minimum even differ with the form of initial state vector and numerical value is zero).Therefore, the feedback-type Hopfield network class pattern classification process that identifies three-dimensional body is made up of memory and two complementary subprocess of associative recall.Predefined object vector P in this neural network output step (six)
1, P
2, P
3In one, be used for judging classification (one of A, B, C) situation under the three-dimensional model of input.
(9), institute finishes in steps.After the identification of visual signature is finished, can estimate the processing power of the neuron network simulation human brain that is adopted by the analysis decision result, just according to the color detection ability of human eye vision perception, the user can make subjective evaluation to the classification results of three-dimensional model recognition system.The classification output result of better representative model of making a strategic decision meets the classification results of human brain perception, the neural network form that shows selection is better, the quantizing rule that the quantization sensing device is formulated is reasonable, and the feature of being extracted is the more representational visual signature that three-dimensional body itself is contained.Therefore, can also adopt than the complicated many-valued quantizing rule of two-value rule, to realize more many-sided Classification and Identification demand of three-dimensional model in order to improve the Decision of Neural Network ability.
Exemplify a embodiment of the present invention's design herein in detail based on the VRML three-dimensional model color classification device of Hopfield network.Because the light color (Emissive color) of the reflection colour (Diffuse color) of the external light source in the VRML model, the color (Specular color) of direct reflection, geometrical body self emission is the typical color information that the object sense of reality is expressed, therefore the present invention at first judges the trichromatic content of RGB at the reflecting attribute (Diffuse color) of material color, and then differentiates the red, green, blue color tendency of model material color aspect.
Below in conjunction with accompanying drawing example of the present invention is elaborated.
As shown in Figure 1, be the overall flow that colorful three-dimensional model is discerned.
(1) step 1 among Fig. 1 is an initial actuating, obtains the products in kind of concrete toy building.This enforcement example has obtained the colored toy building model of a series of basic geometric modelings, shown in visible Fig. 5 a.
(2) use 3-D scanning equipment that these building blocks models are scanned in the computing machine, and use the virtual reality modelling instrument to describe attributes such as the shape of these building blocks, color, material, (Virtual RML is virtual modeling language to generate the VRML model file, the model file of abideing by this modeling standard to describe generally is the file of suffix .wr1 .x3d by name, this standard is widely used in internet and industrial emulation field now), and be stored in the computing machine.
(3) adopt frequently-used data library software (for example, MySQL database software) to set up the three-dimensional modeling data storehouse of block toy for the VRML model moulding file of step (2) storage.
(4) from toy building three-dimensional modeling data storehouse, read the VRML moulding file of each model correspondence one by one,, adopt feature extraction algorithm to obtain the characteristic of building blocks model moulding file input feature vector extraction module.This implements in example mainly is the color attribute value of obtaining in the color gamut (Color) that the Material node in the moulding file describes, and promptly extracts the RGB numerical value of material color (Diffuse color), and with this value storage in the material color feature vector.After all building blocks models extract end, form the property data base of material color.
(5) the color classification device of three-dimensional building blocks model comprise module such as Fig. 3 designs, this module composition diagram is specifically realized the color classification device that in conjunction with the identification process figure of integral body the step of material color classification implements as follows:
(6) the material color characteristic data input with the building blocks model of storage in the step (3) quantizes sensor, in order to define the tlv triple feature object vector of color classification model.Specific implementation is to adopt the RGB color feature vector in the DiffuseColor field that model is classified, and needs three object vector Red class (P of definition
1), Green class (P
2), Blue class (P
3) forming the color characteristic space, classification will consider that simultaneously color proportion that each component of RGB accounts for is to sort out the color deflection of model.Object vector according to the tlv triple proper vector of the material color of two-value quantizing rule definition building blocks model is:
(7) in the Matlab environment, set up the analysis module of feedback-type Hopfield neural network.
The object vector of definition is the index that neural network is differentiated building blocks model colour type in the step (6).The present invention adopts the Hopfield network structure by simplified construction after the standard Hopfield network variations, its net structure as shown in Figure 4, wherein W is a weighting matrix, b is a bias vector,
Be inner product operation,
Be transport function,
Be network delay.Because the critical process of sorting technique is that the color vector input Hopfield network of building blocks model is analyzed, in the time of some vectors among neural network finally converges in the step (2) three object vectors of definition, reach stable with regard to the state that shows neural network, the result vector of judging output is consistent with this object vector, and export this object vector and just finished color classification this moment.Because no matter for pattern P
1, P
2, P
3Require all to adjust that the parameter of weighting matrix and bias vector makes the output result finally correctly be tending towards convergence apace in the Hopfield network.Therefore according to the weighted value of feed-forward layer be prototype pattern be provided with network (W, b) parameter combinations, to concrete substitution weight matrix of satlin () transport function and deviate parameter:
(8) Hopfield neural network iteration decision process that color attribute is classified.
Since respectively input altogether the RGB color feature vector in the material color (DiffuseColor) of the colored toy building three-dimensional model of 30 needs classification give analysis of neural network, therefore, the transport function of process Hopfield network just makes the RGB element value arrive set upper limit/lower threshold in certain hour and scope constantly to the steady state (SS) iteration.Codomain character according to transport function satlin (), the threshold range of all elements is set in [0 in the present embodiment, 1] in the scope, also just say that the numerical upper limits of each element in the vector is constrained to 1 to the RGB color feature vector of a concrete representative model color, lower limit is constrained to 0, element value drops to 1 greater than 1, value rises to 0 less than 0, value between 0-1 then with two borderline phases relatively and select that approaching numerical value, if by chance then select at random in the centre.Simultaneously, the final convergent form of three elements of Shi Ji color vector also is limited in promptly can only exporting P in the form scope of the defined three kinds of object vectors of step (6)
1, P
2, P
3The vector of three kinds of forms can determine that like this which kind of among red (A), green (B), blue (C) the model of cognition color belong to.
Neuron in the Hopfield network is by the input vector initialization, and network iterates then, stops iteration up to the output vector convergence.In the time of the neural network proper operation, as the nonlinear dynamic system of a complexity, the stability of system adopts energy function E (Liapunov function) to judge.Satisfying under the certain condition, the energy of network constantly reduces, and converges on the stable point of system at last.Be P
1, P
2, P
3The element numerical value of that one dimension color that can be used for judging in the vector will constantly increase until reaching upper limit threshold 1; Otherwise element numerical value will constantly descend until arriving lower threshold 0; When the number of elements value stabilization no longer changes, show network convergence, stop interative computation.
Be example with the m_1 model specifically, the material color of m_1 building blocks model is [0.01; 0.54; 0.13], the convergence process that its color feature vector is identified in the Hopfield network is as follows:
W=[1.2?0?0;0?1.2?0;0?0?1.2];b=[0;0;0];
RGB=[0.01; 0.54; 0.131; (m_1 model original color)
P=[-0.53; 0.54;-0.41]; A (0)=[0.53; 0.54;-0.41]; (original state)
a(1)=satlin(W*a(0)+b);a(1)=[0;0.65;0];
a(2)=satlin(W*a(1)+b);a(2)=[0;0.78;0];
a(3)=satlin(W*a(2)+b);a(3)=[0;0.94;0];
A (4)=satlin (W*a (3)+b); A (4)=[0; 1; 0]; (steady state (SS))
As seen, m_1 building blocks model is identified as the model that belongs to green class, finds out the correct classification results (for the ease of identification, having added literal under the corresponding color of accompanying drawing) that meets the human eye perception from Fig. 5 b.
(9) based on the Hopfield neural network material color attribute of the three-dimensional building blocks model of computing one by one, finally obtain the color recognition result of each colored building blocks model, finish color classification after flow process finish.
According to the memory and the association function of feedback-type Hopfield network, after the neural network iteration evolution process of describing in the step (8) finishes, promptly obtain the classification results of color model.As being shown in the three-dimensional model of 30 colored block toy modelings from the virtual reality instrument among Fig. 5 a and Fig. 5 b, the arrangement on the left side is the original randomize order without color identification of these block toys, it has been marked the label of m_1 to m_30, for ease of with identification after classification results contrast, roughly these models have been marked color attribute according to the human eye perception among the figure.And the model order on the right is the ordering of these block toys having been finished the red, green, blue color deflection after the identification of material color by neural network among Fig. 5 a and Fig. 5 b.The visually-perceptible that can see color recognition effect and human eye is more similar, and the result of color classification is apparent in view and comparatively correct.
Description above summing up, this patent is having certain purposes aspect the discriminator of the visual signature (being primarily aimed at color attribute) of three-dimensional model.Because the contained characteristic quantity of sense of reality virtual three-dimensional model is more complicated various in the practical application of three-dimensional model search, so the three-dimensional model that utilizes neural network to assist to classify to have color information is an effective thinking; Therefore the user just can adopt the utilization of uniting of 3-D scanning equipment, virtual modeling software, neural network recognition system to realize the classification of three-dimensional model in the more areas based on color identification by a whole set of method of the present invention, such as, fruit finished product during agricultural product detect is picked, mineral products in the industrial exploration are identified, background object identification in the road traffic or the like will have certain function in the retrieval in kind of these commodity in reality.
The invention provides a kind of thinking of method for sorting colors of the colorful three-dimensional model based on neural network; the method and the approach of this technical scheme of specific implementation are a lot; the above only is a preferred implementation of the present invention; should be understood that; for those skilled in the art; under the prerequisite that does not break away from the principle of the invention, can also make some improvements and modifications, these improvements and modifications also should be considered as protection domain of the present utility model.The all available prior art of each component part not clear and definite in the present embodiment is realized.