A kind of color adjustment method and system of model
Technical field
The present invention relates to model treatment technical field more particularly to the color adjustment methods and system of a kind of model.
Background technique
With the development of computer hardware and software technology, and the reinforcement of image-capable, 3D model using more and more, have application in all trades and professions, such as medical field is studied using 3D manikin, garment industry tries on clothes etc. using 3D manikin.
In general, can generate model during one true man's 3D model of production with 3D body-scanner, then be formed after manually adjusting, correcting.However higher cost needed for artificial, spend the time long, it is difficult to accomplish Mass production.There is the scheme being transplanted to the modification part in model after separately formed on male model in the prior art, however how the part of modification is carried out to the unification of color during transplanting with male model, visually more merging for the model allowed becomes insoluble problem.If not only higher cost needed for artificial, spends the time long, it is difficult to accomplish Mass production using color is manually adjusted.
Summary of the invention
The color adjustment method and system of a kind of the object of the present invention is to provide costs lower, more efficient model
The purpose of the present invention is achieved through the following technical solutions:
A kind of color adjustment method of model, comprising:
S101, independent model to be transplanted and male model to be transplanted are obtained, wherein the corresponding position of the male model is arranged in the independent model, join domain is equipped between the independent model and the male model;
S102, independent model and male model are separately converted to two dimensional image, obtain the first color and the second color, first color is the color of the two dimensional image of the independent model, and second color is the color of the two dimensional image of the male model;
S103, the two dimensional image of the two dimensional image of independent model and male model is adjusted to the first color or the second color, obtains the two dimensional image of uniform color;
S104, the color of the join domain is adjusted to the uniform color two dimensional image color.
Preferably, the two dimensional image of the two dimensional image of independent model and male model is adjusted to the first color or the second color specifically, the two dimensional image of independent model is adjusted to the second color in the step S103;
The color by the join domain in the step S104 is adjusted to the color of the two dimensional image of the uniform color specifically, the color of the join domain is adjusted to the second color.
Preferably, being specifically included the step of independent model and male model are separately converted to two dimensional image in the step S102:
By the drawout on the direction of any axis respectively of the point in the independent model and male model;
The vertex color for extracting the independent model obtains the two dimensional image of independent model;And the vertex color of the male model is extracted, obtain the two dimensional image of male model.
Preferably, the point by the independent model and male model respectively the drawout on the direction of any axis the step of in when carrying out drawout: carried out on the direction of same axis, the axis is X-axis, Y-axis or Z axis.
Preferably, in the step S101, the independent model wait transplant be will after transplantation site is individually cut obtained model;The male model to be transplanted is complete model.
The present invention discloses a kind of color adjustment system of model, comprising:
Module is obtained, for obtaining independent model to be transplanted and male model to be transplanted, wherein the corresponding position of the male model is arranged in the independent model, join domain is equipped between the independent model and the male model;
Extraction module is converted, for independent model and male model to be separately converted to two dimensional image, obtains the first color and the second color, first color is the color of the two dimensional image of the independent model, and second color is the color of the two dimensional image of the male model;
It adjusts module and obtains the two dimensional image of uniform color for the two dimensional image of the two dimensional image of independent model and male model to be adjusted to the first color or the second color;
Staining module, the color of the two dimensional image for the color of the join domain to be adjusted to the uniform color.
Preferably, the adjustment module is specifically used for, and the two dimensional image of independent model is adjusted to the second color;
The staining module is specifically used for, and the color of the join domain is adjusted to the second color.
Preferably, the conversion extraction module is specifically used for:
By the drawout on the direction of any axis respectively of the point in the independent model and male model;
The vertex color for extracting the independent model obtains the two dimensional image of independent model;And it extracts
The vertex color of the male model obtains the two dimensional image of male model.
Preferably, the point by the independent model and male model is respectively in drawout on the direction of any axis: carrying out on the direction of same axis, the axis is X-axis, Y-axis or Z axis.
Preferably, the acquisition module obtain when: the independent model wait transplant be will after transplantation site is individually cut obtained model;The male model to be transplanted is complete model.
The color adjustment method of model of the present invention is due to including: S101, obtaining independent model to be transplanted and male model to be transplanted, wherein the corresponding position of the male model is arranged in the independent model, join domain is equipped between the independent model and the male model;S102, independent model and male model are separately converted to two dimensional image, obtain the first color and the second color, first color is the color of the two dimensional image of the independent model, and second color is the color of the two dimensional image of the male model;S103, the two dimensional image of the two dimensional image of independent model and male model is adjusted to the first color or the second color, obtains the two dimensional image of uniform color;S104, the color of the join domain is adjusted to the uniform color two dimensional image color.In this way, it can be by independent model and male model in post synthesis, by carrying out color sample to independent model and male model, the color of two dimensional image is carried out unification, then according to the color on the two dimensional image of color after reunification by the color then obtained according to sampling, join domain between independent model and male model is coloured, to carry out the unification of color, the model allowed is visually more merged, and cost is lower, the more efficient color to model is adjusted.
Detailed description of the invention
Fig. 1 is the flow chart of the image partition method based on genetic algorithm of the embodiment of the present invention;
Fig. 2 is the schematic diagram of the image segmentation system based on genetic algorithm of the embodiment of the present invention.
Specific embodiment
Although operations are described as the processing of sequence by flow chart, many of these operations can be implemented concurrently, concomitantly or simultaneously.The sequence of operations can be rearranged.Processing can be terminated when its operations are completed, it is also possible to have the additional step being not included in attached drawing.Processing can correspond to method, function, regulation, subroutine, subprogram etc..
Computer equipment includes user equipment and the network equipment.Wherein, user equipment or client include but is not limited to computer, smart phone, PDA etc.;The network equipment includes but is not limited to single network server, the server group of multiple network servers composition or the cloud consisting of a large number of computers or network servers based on cloud computing.Computer equipment can isolated operation realize the present invention, also can access network and the present invention realized by the interactive operation with other computer equipments in network.Computer equipment institute
The network at place includes but is not limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, VPN network etc..
It may have been used term " first ", " second " etc. herein to describe each unit, but these units should not be limited by these terms, the use of these items is only for distinguish a unit with another unit.Term "and/or" used herein above includes any and all combinations of associated item listed by one of them or more.When a unit referred to as " connects " or when " coupled " to another unit, can be connected or coupled to another unit, or may exist temporary location.
Term used herein above is not intended to limit exemplary embodiment just for the sake of description specific embodiment.Unless the context clearly dictates otherwise, otherwise singular used herein above "one", " one " also attempt to include plural number.It is to be further understood that, term " includes " and/or "comprising" used herein above provide the presence of stated feature, integer, step, operation, unit and/or component, and do not preclude the presence or addition of other one or more features, integer, step, operation, unit, component and/or combination thereof.
The invention will be further described with preferred embodiment with reference to the accompanying drawing.
As shown in Figure 1, disclosing a kind of color adjustment method of model in the present embodiment, comprising:
S101, independent model to be transplanted and male model to be transplanted are obtained, wherein the corresponding position of the male model is arranged in the independent model, join domain is equipped between the independent model and the male model;
S102, independent model and male model are separately converted to two dimensional image, obtain the first color and the second color, first color is the color of the two dimensional image of the independent model, and second color is the color of the two dimensional image of the male model;
S103, the two dimensional image of the two dimensional image of independent model and male model is adjusted to the first color or the second color, obtains the two dimensional image of uniform color;
S104, the color of the join domain is adjusted to the uniform color two dimensional image color.
In this way, it can be by independent model and male model in post synthesis, by carrying out color sample to independent model and male model, the color of two dimensional image is carried out unification, then according to the color on the two dimensional image of color after reunification by the color then obtained according to sampling, join domain between independent model and male model is coloured, to carry out the unification of color, the model allowed is visually more merged, and cost is lower, the more efficient color to model is adjusted.
Because of higher cost needed for artificial, spend the time long.Technical staff develops every molding type in the present embodiment, so-called every molding type, as on the basis of male model, completion is fabricated separately in the part of the adjustment of needs, is then transplanted on the corresponding site of male model, form desired 3D model.Such as a faceform's (independent model) to complete is chosen, the face that besom is retouched is cut into, is put into
The face location of ready-made male model synthesizes a complete head model.And in post synthesis, need to be adjusted the colour of skin, unification carried out to the color of male model and faceform, the model allowed visually more merges, it is therefore desirable to use above-mentioned color adjustment method, so as to it is faster, efficient, accurately adjust color.
According to one of example, in the step S101, the independent model wait transplant be will after transplantation site is individually cut obtained model;The male model to be transplanted is complete model.
The independent model of the transplanting of needs, which is individually cut down, in this way can be convenient transplanting, such as when only needing to modify the face part in male model, so that it may cut down face part from model, obtain the independent model of individual face.In order to facilitate uniform color, complete model is can be used in male model, does not carry out cutting, adjusts more convenient color sample when color in this way.
According to another one example, being specifically included the step of independent model and male model are separately converted to two dimensional image in the step S102:
By the drawout on the direction of any axis respectively of the point in the independent model and male model;
The vertex color for extracting the independent model obtains the two dimensional image of independent model;And the vertex color of the male model is extracted, obtain the two dimensional image of male model.
Specifically, by the point in the independent model and male model respectively the drawout on the direction of any axis the step of in when carrying out drawout: carried out on the direction of same axis, the axis is X-axis, Y-axis or Z axis.Can certainly carry out drawout on the direction of other axis, X-axis, Y-axis or Z axis, the direction of these axis is selected definitely, conveniently to sprawl, the present embodiment selects left-handed coordinate system, can be selected in Z axis expansion.When sprawling, three-dimensional model can be unfolded, become the image of plane, thus can more accurately obtain the color of model.Because the color sample on threedimensional model is inconvenient, and the color that three-dimensional color samples is often inaccurate, carries out the color that color sample can be accurately obtained model in this way.In the axis for when distinguishing drawout on the direction of any axis, being taken the point in independent model and male model for the same axis so that it is convenient to which the comparison of sampled colors, control generate less variable.
In the step of extraction independent model and the vertex color of male model, because model can be rendered in production using the method for vertex coloring, therefore the vertex color of independent model and male model can be got according to the feature of model.Vertex coloring (gouraud shading) is a kind of more popular rendering method, it is coloured than plane more advanced, it provides one group of individual tone value for each vertex of 3D object, and smooth, fusion treatment is carried out to the color on each vertex, for the upper gradient color of polygon, the object that it is rendered has color quite abundant and smooth color changeable effect.Two dimensional image can be generated in this way, it is efficient and convenient also very accurate.
According to another one example, the two dimensional image of the two dimensional image of independent model and male model is adjusted to the first color or the second color specifically, the two dimensional image of independent model is adjusted to the second color in the step S103;
The color by the join domain in step S104 is adjusted to the color of the two dimensional image of the uniform color specifically, the color of the join domain is adjusted to the second color.
As shown in Figures 2 and 3, Fig. 2 is the model before color adjustment, and 80 be male model, and 90 be independent model, is join domain 85 between male model 80 and independent model 90, is the model after adjusting color in Fig. 3, the color of join domain is adjusted to consistent with male model.The color of join domain can also be adjusted in this way with the consistent color of male model, to allow the more preferable of join domain transition, visual effect seems more there is associative perception.
As shown in figure 4, the embodiment of the present invention discloses a kind of color adjustment system of model, comprising:
Module 201 is obtained, for obtaining independent model to be transplanted and male model to be transplanted, wherein the corresponding position of the male model is arranged in the independent model, join domain is equipped between the independent model and the male model;
Extraction module 202 is converted, for independent model and male model to be separately converted to two dimensional image, obtains the first color and the second color, first color is the color of the two dimensional image of the independent model, and second color is the color of the two dimensional image of the male model;
It adjusts module 203 and obtains the two dimensional image of uniform color for the two dimensional image of the two dimensional image of independent model and male model to be adjusted to the first color or the second color;
Staining module 204, the color of the two dimensional image for the color of the join domain to be adjusted to the uniform color.
In this way, it can be by independent model and male model in post synthesis, by carrying out color sample to independent model and male model, the color of two dimensional image is carried out unification, then according to the color on the two dimensional image of color after reunification by the color then obtained according to sampling, join domain between independent model and male model is coloured, to carry out the unification of color, the model allowed is visually more merged, and cost is lower, the more efficient color to model is adjusted.
Because of higher cost needed for artificial, spend the time long.Technical staff develops every molding type in the present embodiment, so-called every molding type, as on the basis of male model, completion is fabricated separately in the part of the adjustment of needs, is then transplanted on the corresponding site of male model, form desired 3D model.Such as a faceform's (independent model) to complete is chosen, the face that besom is retouched is cut into, and is put into the face location of ready-made male model, synthesizes a complete head model.And in post synthesis, it needs to be adjusted the colour of skin, unification, the vision of the model allowed is carried out to the color of male model and faceform
On more merge, it is therefore desirable to use above-mentioned color adjustment method, so as to it is faster, efficient, accurately adjust color.
According to one of example, the acquisition module 201 obtain when: the independent model wait transplant be will after transplantation site is individually cut obtained model;The male model to be transplanted is complete model.
The independent model of the transplanting of needs, which is individually cut down, in this way can be convenient transplanting, such as when only needing to modify the face part in male model, so that it may cut down face part from model, obtain the independent model of individual face.In order to facilitate uniform color, complete model is can be used in male model, does not carry out cutting, adjusts more convenient color sample when color in this way.
According to another one example, the conversion extraction module 202 is specifically used for:
By the drawout on the direction of any axis respectively of the point in the independent model and male model;
The vertex color for extracting the independent model obtains the two dimensional image of independent model;And the vertex color of the male model is extracted, obtain the two dimensional image of male model.
Specifically, by the point in the independent model and male model respectively in drawout on the direction of any axis: being carried out on the direction of same axis, the axis is X-axis, Y-axis or Z axis.
Can certainly carry out drawout on the direction of other axis, X-axis, Y-axis or Z axis, the direction of these axis is selected definitely, conveniently to sprawl, the present embodiment selects left-handed coordinate system, can be selected in Z axis expansion.When sprawling, three-dimensional model can be unfolded, become the image of plane, thus can more accurately obtain the color of model.Because the color sample on threedimensional model is inconvenient, and the color that three-dimensional color samples is often inaccurate, carries out the color that color sample can be accurately obtained model in this way.In the axis for when distinguishing drawout on the direction of any axis, being taken the point in independent model and male model for the same axis so that it is convenient to which the comparison of sampled colors, control generate less variable.
In the step of extraction independent model and the vertex color of male model, because model can be rendered in production using the method for vertex coloring, therefore the vertex color of independent model and male model can be got according to the feature of model.Vertex coloring (gouraud shading) is a kind of more popular rendering method, it is coloured than plane more advanced, it provides one group of individual tone value for each vertex of 3D object, and smooth, fusion treatment is carried out to the color on each vertex, for the upper gradient color of polygon, the object that it is rendered has color quite abundant and smooth color changeable effect.Two dimensional image can be generated in this way, it is efficient and convenient also very accurate.
According to another one example, the adjustment module 203 is specifically used for, and the two dimensional image of independent model is adjusted to the second color;
The staining module 204 is specifically used for, and the color of the join domain is adjusted to the second color.
The color of join domain can also be adjusted in this way with the consistent color of male model, to allow the more preferable of join domain transition, visual effect seems more there is associative perception.
The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be said that specific implementation of the invention is only limited to these instructions.For those of ordinary skill in the art to which the present invention belongs, without departing from the inventive concept of the premise, a number of simple deductions or replacements can also be made, all shall be regarded as belonging to protection scope of the present invention.