CN108171650A - One kind has the function of that stroke optimizes Chinese flower ink and wash style stroke generation method - Google Patents
One kind has the function of that stroke optimizes Chinese flower ink and wash style stroke generation method Download PDFInfo
- Publication number
- CN108171650A CN108171650A CN201711340014.8A CN201711340014A CN108171650A CN 108171650 A CN108171650 A CN 108171650A CN 201711340014 A CN201711340014 A CN 201711340014A CN 108171650 A CN108171650 A CN 108171650A
- Authority
- CN
- China
- Prior art keywords
- stroke
- sample
- path
- pixel
- elementary
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 24
- 239000000976 ink Substances 0.000 claims abstract description 52
- 238000010422 painting Methods 0.000 claims abstract description 16
- 238000004422 calculation algorithm Methods 0.000 claims description 17
- 238000006073 displacement reaction Methods 0.000 claims description 12
- 238000011049 filling Methods 0.000 claims description 11
- 238000013507 mapping Methods 0.000 claims description 9
- 239000004576 sand Substances 0.000 claims description 7
- 210000000988 bone and bone Anatomy 0.000 claims description 5
- 239000000523 sample Substances 0.000 claims 37
- 239000013074 reference sample Substances 0.000 claims 1
- 230000017105 transposition Effects 0.000 claims 1
- 238000005457 optimization Methods 0.000 abstract description 13
- 230000006870 function Effects 0.000 description 13
- 238000004590 computer program Methods 0.000 description 11
- 230000006872 improvement Effects 0.000 description 9
- 238000009877 rendering Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 4
- 230000002452 interceptive effect Effects 0.000 description 4
- 239000003973 paint Substances 0.000 description 4
- 238000003860 storage Methods 0.000 description 4
- 239000013256 coordination polymer Substances 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 241000196324 Embryophyta Species 0.000 description 2
- XCWPUUGSGHNIDZ-UHFFFAOYSA-N Oxypertine Chemical compound C1=2C=C(OC)C(OC)=CC=2NC(C)=C1CCN(CC1)CCN1C1=CC=CC=C1 XCWPUUGSGHNIDZ-UHFFFAOYSA-N 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000009792 diffusion process Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 2
- 244000025254 Cannabis sativa Species 0.000 description 1
- 101100346764 Mus musculus Mtln gene Proteins 0.000 description 1
- 230000002745 absorbent Effects 0.000 description 1
- 239000002250 absorbent Substances 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 239000002537 cosmetic Substances 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 239000006185 dispersion Substances 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 238000002513 implantation Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000002156 mixing Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
- 238000012549 training Methods 0.000 description 1
Classifications
-
- G06T3/04—
Abstract
The present invention discloses a kind of Chinese flower ink and wash style stroke generation method with stroke optimization, includes the following steps, obtains an image comprising ramage as image object;A delineation operation is obtained on the flowers ink and wash drawing sample to prestore, delineation operation includes at least a stroke sample;The elementary contour that user delineates on image object is obtained, elementary contour forms the preliminary elementary path of stroke to be generated;Preliminary elementary path is corrected, obtains accurate elementary path;It is selected in form sample group with the most matched form sample of accurate elementary path as final stroke sample;The style and features of final stroke sample are mapped on accurate elementary path, output image of the generation with Chinese ink painting's style.
Description
Technical field
Style Transfer technology more particularly to one kind the present invention relates to computer graphics non-photorealistic rendering have pen
Draw optimization function Chinese flower ink and wash style stroke generation method.
Background technology
Chinese freehand brushwork ink and wash is different from other drawing types (such as western canvas, watercolor), describes to have with very few strokes
The scenery object or scene of body express the creation intention and artistic individuality of artist.Enjoyable ink and wash is inhaled with its unique artistry
Draw more and more people and learn creation ink and wash, include the drawing fan on no drawing techniques basis.It is moreover, big at present
Most graphics class business softwares (such as Adobe Illustrator, Adobe Photoshop, CorelDRAW etc.) are supported
The Core Generator of Chinoiserie.However, the paint of generation high quality usually requires the knowledge and skills of profession, and
Existing draw tool is required complicated and is accurately entered in terms of drawing skill, meanwhile, it is generated and painted using Style Transfer
Tool (such as Fig. 1 (b)) only by certain drawing style bulk migration to given object, seldom consider the stroke shape of part
State and color.
Flowers ink and wash is one of primary categories in Chinese ink painting, and the important artistic that it represents oriental painting is special
Sign.In other words, the unique artistic charm of ink and wash and value are typically formd in flower-and-plant painting with pen, with black gimmick:It
Stroke is curved or straight bold or soft wide or narrow pale or simple and honest;Its mass colour passes through the mixing between water and ink
Diffusion reaches the deep or light a variety of variations of dry and wet.Therefore, the professional skill of the diversity and complexity and drawing of stroke and mass colour
It is skilful to make the work that generation is painted rich in challenge.
In general, non-photorealistic rendering refers to by building different brush models, pen of the output with artistic style
It draws, describes specific object as Freehandhand-drawing.In recent years, have some to obtain with the relevant outstanding working value of non-photorealistic rendering
Study and reference.Mainly there is the work of following two aspects:
On the one hand it is the model based on physics:Lead to provide the user with intuitive naturally impression, the equipment as pen
It crosses and the physical attribute of pen or other media is modeled, simulate the physical process of drawing.Wherein, Chu and Tai are in document
[Chu N.S.H.,Tai C.-L., “MoXi:Real-Time Ink Dispersion in Absorbent Paper”,ACM
Transactions on Graphics, vol.24 (3), pp.504-511,2005] in one real-time painting system of design
It simulates in the effect for having absorptive paper inking diffusion.Meanwhile Xu etc. is in document [Xu S., Tang M., LAU F., et
al.,“Virtual Hairy Brush for Painterly Rendering”,Graphical Models,vol. 66
(5), proposed in pp.263-302,2004] it is a kind of novel for Chinese calligraphy and " the electronics brush " of drawing, only with four kinds
The attribute definition essential characteristic of true brush.Lu etc. document [Lu J., Barnes C., DiVerdi S., et al.,
“RealBrush: Painting with Examples of Physical Media”,ACM Transactions on
Graphics, vol.32 (4), pp.117,2013] painting system of an interactive data-driven is proposed in, it can profit
New stroke is synthesized with the scan image of real media, avoids the calculating of complicated physical analogy.It is soft for digitlization drawing
Part, such as Adobe brush packages, ArtRage, and Corel Painter, user is just as using true brush one
Sample, operates mouse or digital pen is painted.However, for the user of no related drawing experience, if not to them
Carry out the training on operation of such virtual unit, then easily and accurately to operate this kind equipment be complicated and difficult.On the other hand
It is the model based on image:Compared with physical model, this class model avoids large-scale calculation amount and complicated manipulation.
In terms of simulating west drawing, Herzmann etc. document [Hertzmann A., Jacobs C.E., Oliver N., et al.,
“Image analogies”,In:Proceedings of the 28th Annual Conference on Computer
Graphics and Interactive Techniques, New York, USA, pp.327-340,2001] in use " image
Analogy " technical finesse photograph image, image of the generation with artistic effect, but in their experimental result, China is painted
For picture, due to drawing different image-regions using different styles, these regions cannot be distinguished in algorithm, so obtaining not
Ideal stylization result.In terms of oriental painting is simulated, Xie etc. document [Xie N., Laga H., Saito S.,
“IR2s:interactive real photo to Sumi-e”,In:Proceedings of the 8th
International Symposium on Non-Photorealistic Animation and Rendering,
Annecy, France, pp.63-71,2010] in devise one based on the interactive system painted of grass, true photo is turned
The ink for being changed to Japan draws drawing.Dong etc. is in document [Dong L., Lu S.and Jin X., " Real-time Image-
based Chinese Ink Painting Rendering”,Multimedia Tools &Applications,vol. 69
(3), pp.605-620,2014] in converted the image by texture mapping and Future Opportunities of Texture Synthesis with Chinese ink style
Image.However, the model of existing simulation oriental painting style mainly handles whole image rather than forms the pen of image
It draws, is difficult to show the rich and changeful art feature of Chinese painting in this way.
Invention content
For it is above-mentioned the technical issues of, overcome the shortcomings of the prior art, providing a kind of has the function of that stroke optimizes
State's flowers ink and wash style stroke generation method, is capable of providing the guidance that series of algorithms draws roughly the user on photo
Lines are converted into the stroke with certain Chinese ink painting's style, realize migrating to the effect of photograph image for Chinese ink style
Fruit.
This method includes the following steps,
An image comprising ramage is obtained as image object;
A delineation operation is obtained on the flowers ink and wash drawing sample to prestore, the delineation operation includes at least one
A stroke sample;
The elementary contour that user delineates on described image object is obtained, the elementary contour forms stroke to be generated
Preliminary elementary path;
It is corrected by the outline strokes in the stroke sample to drawing a circle to approve out, obtains accurate stroke sample and make
For candidate stroke sample;Using the candidate stroke sample as reference, form sample group is generated;It is determined using opposite searching algorithm
In the stroke sample most the candidate stroke sample is obtained close to the profile of stroke edge;
Using the candidate stroke sample as reference, form sample group is generated by way of mirror image and anti-path;Its
In, each form sample group includes at least four form samples, and four form samples are included as the described of reference
Candidate stroke sample, the mirror image stroke sample of the candidate stroke sample, the candidate stroke sample anti-path stroke and
The anti-path stroke of candidate's stroke sample mirror image stroke;
The preliminary elementary path is corrected, obtains accurate elementary path;
It is selected in the form sample group with the most matched form sample of the accurate elementary path as final stroke
Sample;
The style and features of the final stroke sample are mapped on the accurate elementary path, generation has China Water
The output image of black painting style lattice.
As a further improvement, described correct the preliminary elementary path, the step of obtaining accurate elementary path, includes,
Using the smooth preliminary elementary path of non-homogeneous B spline curve algorithm, the accurate basic road is obtained
Diameter.
As a further improvement, the selection in the form sample group is most matched with the accurate elementary path
Form sample as final stroke sample, including,
The elementary path is divided into several path sections, by energy theorem, is chosen in the form sample group
With final stroke sample of the most matched form sample of the path sections as the path sections.
As a further improvement, it is described by energy theorem, it is chosen and the path sections in the form sample group
The step of final stroke sample of the most matched form sample as the path sections, includes,
The energy theorem is in l2One energy term of definition space, for describing the stroke wheel in the final stroke sample
Wide displacement item and the total difference of the displacement item of corresponding accurate elementary path (path sections), and make described total
Body difference minimizes, so as to automatically select the final stroke sample;
Wherein, the displacement item is used to describe the outline strokes in the final stroke sample and the accurate basic road
Displacement on diameter between the relative position vector at any point and stroke direction vector.
As a further improvement, the style and features by the final stroke sample are mapped to the accurate basic road
Step on diameter includes,
Adjust the Aspect Ratio of the final stroke sample so that the final stroke sample and the corresponding path
Partial Aspect Ratio is consistent.
As a further improvement, the style and features by the final stroke sample are mapped to the accurate basic road
Step on diameter further includes,
By the texture-mapping algorithm based on pixel, rasterisation filling region is realized and with from described final with scan line
In the pixel filling selected in stroke to path sections corresponding with the final stroke.
As a further improvement, including:
With pixel described in following constraint:
a、pSAdjacent pixel have distance pFThe nearest color value of neighborhood;
b、pSWith pFPosition with respect to its respective bone path is nearest;
c、pSWith pPThe average color of the pixel of surrounding is closest;
Wherein, pSIt is the best pixel selected in ink stroke region;pFFor any pixel in filling region;pPFor
Pixel in input picture;And weigh constraints above condition, E by 3 energy termsb(pS) constraints a is corresponded to, p is describedSWith pF
Between neighborhood territory pixel color data error summation;
Ep(pS) constraints b is corresponded to, p is describedSWith pFDegree of closeness between corresponding skeleton path respectively;
Ea(pS) constraints c is corresponded to, p is describedSWith pPRespectively using some R as the average color of pixel in the circle of radius
Difference;
Specifically meet the following formula:
Wherein, λ (p) represents the color value of p,It is pSNeighborhood territory pixel, andIt is pFNeighborhood territory pixel,Bone
Distance p on frame pathFNearest point is identicalUnder value,
Be correspondence on the skeleton path in the final stroke sample a bit, rSAnd rPIt is described final respectively
The half of stroke specimen width, N represent all pixels sum in the circle of specified radius R,Represent circle inherence pSNeighbouring picture
Element, andIt represents in photograph image, the p in specified circlePNeighbouring pixel.
As a further improvement, it is characterized in that,
The texture-mapping algorithm based on pixel, using in l1The energy being made of 3 energy terms is defined in space
Three energy terms simultaneously are minimized to obtain best pixel by equation, this step meets the following formula:
Wherein, α1, α2And α3Represent balance weight parameter.
Description of the drawings
It, below will be to attached drawing needed in embodiment in order to illustrate more clearly of technical scheme of the present invention
It is briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, for ability
For the those of ordinary skill of domain, without creative efforts, it can also be obtained according to these attached drawings other attached
Figure.
Fig. 1 is the ink image and the ink image comparison figure of existing draw tool generation that the present invention generates, wherein
(a) it is the original image without ink image procossing, (b) is the ink image of existing draw tool generation, and (C) is this hair
Open-birth into ink image.
Fig. 2 is the overall flow figure of the method for the present invention.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art obtained without making creative work it is all its
His embodiment, shall fall within the protection scope of the present invention.
Referring to Fig. 2, Fig. 2 is first embodiment of the invention, a kind of Chinese flower ink and wash with stroke optimization
Style stroke generation method method, includes the following steps,
S10 obtains an image comprising ramage as image object;
A delineation operation is obtained on the ink and wash drawing sample for the flowers that prestore, the delineation operation includes at least one
A stroke sample;
The picture material that image object is included, pattern can be animal, plant etc., the specific can be that ox, horse,
Flowers, vegetation;The subject matter of ink and wash sample to prestore can also be animal, plant etc., the subject matter of ink and wash sample and need with
Pattern in image object is consistent, such as the subject matter of ink and wash is flowers, and the subject matter of pattern also needs to be consistent;Change speech
It, it is template that user wants the elementary path sketched the contours that image object is selected, and the base that stroke sample, which is user, to be wanted
The stroke style feature in this path.
S20 obtains the elementary contour of ramage that user delineates on described image object, the elementary contour structure
Into the preliminary elementary path of stroke to be generated;
Here mentioned delineate can be not up to the effect completely the same with pattern elementary contour, can be a kind of thick
Sketching the contours slightly, while the intention of user can also be included wherein, such as the lines that are not present are added in pattern template to preliminary
Elementary path.
S30 by being corrected to the profile of the stroke sample drawn a circle to approve out, obtains accurate stroke sample conduct
Candidate stroke sample;Using the candidate stroke sample as reference, form sample group is generated.
During stroke sample is drawn a circle to approve, because being only the region for having drawn a circle to approve desired stroke in stroke sample, this
It wherein will appear non-stroke region (non-stroke region referred herein is the part for not including stroke lines), such influence
Be the information that stroke sample areas includes it not is that accurate outline strokes information also includes disturbing factor, is unfavorable for pen
The extraction of specific outline strokes in sample is drawn, while to ensure efficiency and experience of the user when choosing stroke sample, this
Kind disturbing factor is unavoidable, therefore the extraction of stroke sample profile is unavoidable in stroke sample.In the present embodiment
In, it determines to obtain the candidate stroke sample most close to the profile of stroke edge in the stroke sample using opposite searching algorithm
This.
In opposite searching algorithm, the outline strokes in stroke sample are by a three curvilinear structures (CS,LS,RS) represent,
Wherein CS(t)∈ISBy CS(t)=(LS(t)+RS(t)) it/2 obtains, and its domain FSIn LSAnd RSBetween by as candidate stroke
The general profile of sample, LSAnd RSIt is the two sides of the general profile;Then by side LSAnd RSIt is fitted to curve LS(t) and
RS(t), and divide its be identical quantity curve segment;It is assumed that the endpoint in each curve segment is as LS(t) and RS(t) on
Characteristic point, will be from LS(t) it is directed toward RS(t) line orientations are defined as the positive direction ω (t) of search, respectively along ω (t) and-ω
(t) direction calculates the directional derivative D of each grey scale pixel value+ωAnd D-ω, each pair of characteristic point is finally reset to party's guide
On the position of number global minimum;Adjust side LSAnd side RSInto most close to the profile of the stroke in stroke sample.
And using the candidate stroke sample as reference, form sample group, mould are generated by way of mirror image and anti-path
Intend the different posture of candidate stroke sample;Wherein, each form sample group includes at least four form samples, four institutes
State the mirror image stroke sample, described that form sample includes the candidate stroke sample as reference, candidate's stroke sample
The anti-path stroke of the anti-path stroke of candidate stroke sample and the candidate stroke sample mirror image stroke.
According to three curvilinear structures, meet formula (1), defined formula (1) is:
Wherein, if n is dry brush number of samples, a time for including 4n element is formed by 4 kinds of situations of each stroke
Selected works close:Then 4 kinds of situations of stroke are followed successively by
S40 corrects the preliminary elementary path, obtains accurate elementary path;
Preliminary elementary path is sketched the contours by user, and this rough sketching the contours can cause the bumps of part in path not
Flat, coarse, in the paint of ink and wash style, the edge of stroke is showed with the posture of relative smooth, in order to
The paint lines of ink painting style lattice are more accurately restored, are put down in the present embodiment using non-homogeneous B spline curve algorithm
The sliding preliminary elementary path, obtains smooth accurate elementary path.
Preliminary elementary path in image object is by a three curvilinear structures (CP,LP,RP) represent, using non-uniform rational
The smooth three curvilinear structures (C of B-spline curve algorithmP,LP,RP)。
S50 is selected with the most matched form sample of the accurate elementary path in the form sample group as final
Stroke sample;
The accurate elementary path is divided into several path sections, by energy theorem, in the form sample group
It chooses and final stroke sample of the most matched form sample of the path sections as the path sections.Candidate stroke sample
Form it is relatively simple, cause to be difficult to be matched with accurate elementary path, a variety of candidate stroke shapes of form sample group generation
State increases the matching probability of path sections and candidate stroke.
It is illustrated with reference to energy theorem, energy theorem is in l2Definition spaceDescriptionWith CPBetween displacement item
The total difference of δ, wherein, the displacement item is used to describe outline strokes and the accurate base in the final stroke sample
Displacement on this path between the relative position vector at any point and stroke direction vector.Then make the total difference most
Smallization, so as to automatically select optimal stroke masterplate.Meet formula (2), defined formula (2) is:
Wherein, displacement item δ is calculated by formula (3), and defined formula (3) is:
Wherein,For any elementary path,ForIt arrivesLine orientations,ForIt is upper arbitrary
A bitRelative position vectorExtremelyMapping,Displacement for closest point.
The style and features of the final stroke sample are mapped on the accurate elementary path by S60, during generation has
The output image of state's ink and wash style.
The corresponding form sample of each path sections has been obtained by energy theorem in above-mentioned part, it then will be each
The corresponding form sample substitution original route part of path sections, generation meet the profile of the selected stroke sample characteristics of user;
Then adjust the Aspect Ratio of the final stroke sample so that the final stroke sample and the corresponding path sections
Aspect Ratio it is consistent;And by the texture-mapping algorithm based on pixel, rasterisation filling region is realized simultaneously with scan line
With in the pixel filling selected out of described final stroke to path sections corresponding with the final stroke.
In the Aspect Ratio for adjusting the final stroke sample so that the final stroke sample and the corresponding road
In the Aspect Ratio process consistent of path portion, final stroke width wP(t) with the photo object on accurate basic road
Diameter CPLength it is related to curvature.The wP(t) it is calculated by formula (4), defined formula (4) is:
Wherein, kw(t) be the final stroke specimen width of bi-directional scaling coefficient, LPAnd κP(t) accurate base is represented respectively
The length and curvature in this path.Coefficient entry kw(t) it is calculated by formula (5), defined formula (5) is:
Wherein, κS(t) the accurate elementary path C of tableS(t) curvature, LSRepresent CS(t) length.
By realizing rasterisation filling region and with from described final with scan line based on the texture-mapping algorithm of pixel
During the pixel filling selected in stroke to path sections corresponding with the final stroke, with following constraint institute
State pixel:
a、pSAdjacent pixel have distance pFThe nearest color value of neighborhood;
b、pSWith pFPosition with respect to its respective bone path is nearest;
c、pSWith pPThe average color of the pixel of surrounding is closest;
Wherein, pSIt is the best pixel selected in ink stroke region;pFFor any pixel in filling region;pPFor
Pixel in input picture;And weigh constraints above condition by 3 energy terms:
Eb(pS) constraints a is corresponded to, p is describedSWith pFBetween neighborhood territory pixel color data error summation;
Ep(pS) constraints b is corresponded to, p is describedSWith pFDegree of closeness between corresponding skeleton path respectively;
Ea(pS) constraints c is corresponded to, p is describedSWith pPRespectively using some R as the average color of pixel in the circle of radius
Difference;
It meets the following formula:
Wherein, λ (p) represents the color value of p,It is pSNeighborhood territory pixel, andIt is pFNeighborhood territory pixel,Bone
Distance p on frame pathFNearest point is identicalUnder value,It is on the skeleton path in the final stroke sample
It corresponds to a bit, rSAnd rPIt is the half of the final stroke specimen width respectively, N represents all pictures in the circle of specified radius R
Plain sum,Represent circle inherence pSNeighbouring pixel, andIt represents in photograph image, the p in specified circlePNeighbouring picture
Element.
The texture-mapping algorithm based on pixel, using in l1The energy being made of 3 energy terms is defined in space
Three energy terms simultaneously are minimized to obtain best pixel by equation, this step meets the following formula:
Wherein, α1, α2And α3Represent balance weight parameter.
S70 after generating the ink and wash style stroke drawing result, selects cosmetic elements implantation to paint according to user view
It draws as a result, generating final drawing result.
Painting element referred herein can be scholar's autograph.
Second embodiment of the invention, which provides, has the function of the Chinese flower ink and wash style stroke generation that stroke optimizes
Equipment includes, and processor, memory and is stored in the memory and is configured as the calculating performed by the processor
Machine program, the processor perform the computer program, such as the Chinese flower ink and wash with stroke optimization
Style stroke generates program;
Illustratively, the computer program can be divided into one or more modules, one or more described mould
Block is stored in the memory, and is performed by the processor, to complete the present embodiment.One or more modules
Can be the series of computation machine program instruction section that can complete specific function, which is used to describe the computer journey
Implementation procedure of the sequence in the Chinese flower ink and wash style stroke generation terminal device with stroke optimization.
The Chinese flower ink and wash style stroke generation equipment for having the function of stroke optimization can be that desktop calculates
The computing devices such as machine, notebook, palm PC and cloud server.
The Chinese flower ink and wash style stroke generation equipment for having the function of stroke optimization may include, but not only limit
In processor, memory, display.It will be understood by those skilled in the art that the schematic diagram is only to have stroke optimization
The example of the Chinese flower ink and wash style stroke generation equipment of function, is not formed to having the function of the China of stroke optimization
Flowers ink and wash style stroke generates the restriction of equipment, can include than illustrating more or fewer components or combining certain
A little components or different components, such as there is the Chinese flower ink and wash style stroke generation equipment of stroke optimization also
It can include input-output equipment, network access equipment, bus etc..
Alleged processor can be central processing unit (Central Processing Unit, CPU), can also be it
His general processor, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic device
Part, discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processing
Device etc., the processor are the control of Chinese flower ink and wash style stroke generation equipment with stroke optimization
Center utilizes the entire Chinese flower ink and wash style stroke with stroke optimization of various interfaces and connection
Generate the various pieces of equipment.
The memory can be used for storing the computer program and/or module, and the processor is by running or performing
The computer program and/or module and calling that are stored in the memory are stored in the data in memory, realize institute
State the various functions of the Chinese flower ink and wash style stroke generation equipment with stroke optimization.The memory can be led
To include storing program area and storage data field, wherein, storing program area can storage program area, needed at least one function
Application program (such as sound-playing function, text conversion function etc.) etc.;Storage data field can store the use according to mobile phone
Data (such as audio data, text message data etc.) created etc..In addition, memory can include high random access
Memory can also include nonvolatile memory, such as hard disk, memory, plug-in type hard disk, intelligent memory card (Smart
Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card), at least one magnetic
Disk storage device, flush memory device or other volatile solid-state parts.
Wherein, the module of Chinese flower ink and wash style stroke generation integration of equipments with stroke optimization
If it is realized in the form of SFU software functional unit and is independent product sale or in use, a calculating can be stored in
In machine read/write memory medium.Based on such understanding, the present invention realizes all or part of stream in above-described embodiment method
Journey can also instruct relevant hardware to complete by computer program, and the computer program can be stored in one
In computer readable storage medium, the computer program is when being executed by processor, it can be achieved that above-mentioned each embodiment of the method
Step.Wherein, the computer program includes computer program code, and the computer program code can be source code shape
Formula, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium can include:It can take
Any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disc, CD, computer with the computer program code
Memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access
Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that computer-readable Jie
The content that matter includes can carry out appropriate increase and decrease, such as at certain according to legislation in jurisdiction and the requirement of patent practice
A little jurisdictions, according to legislation and patent practice, computer-readable medium does not include electric carrier signal and telecommunication signal.
It should be noted that the apparatus embodiments described above are merely exemplary, wherein described be used as separating component
The unit of explanation may or may not be physically separate, and the component shown as unit can be or also may be used
Not to be physical unit, you can be located at a place or can also be distributed in multiple network element.It can be according to reality
Border needs to select some or all of module therein to realize the purpose of this embodiment scheme.In addition, the present invention provides
Device embodiment attached drawing in, the connection relation between module represents there is communication connection between them, specifically can be implemented as
One or more communication bus or signal wire.Those of ordinary skill in the art are without creative efforts, you can
To understand and implement.
The above is the preferred embodiment of the present invention, it is noted that for those skilled in the art
For, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications also regard
For protection scope of the present invention.
Claims (8)
1. one kind has the function of that stroke optimizes Chinese flower ink and wash style stroke generation method, which is characterized in that including following
Step,
An image comprising ramage is obtained as image object;
A delineation operation is obtained on the flowers ink and wash drawing sample to prestore, the delineation operation includes at least a stroke
Sample;
The elementary contour that user delineates on described image object is obtained, the elementary contour forms the preliminary base of stroke to be generated
This path;
It is corrected by the outline strokes in the stroke sample to drawing a circle to approve out, obtains accurate stroke sample as candidate
Stroke sample;Using the candidate stroke sample as reference, form sample group is generated;The stroke is determined using opposite searching algorithm
In sample most the candidate stroke sample is obtained close to the profile of stroke edge;
Using the candidate stroke sample as reference, form sample group is generated by way of mirror image and anti-path;Wherein, it is each
The form sample group includes at least four form samples, and four form samples include the candidate stroke as reference
Sample, the mirror image stroke sample of the candidate stroke sample, the anti-path stroke of the candidate stroke sample and the candidate
The anti-path stroke of stroke sample mirror image stroke;
The preliminary elementary path is corrected, obtains accurate elementary path;
It is selected in the form sample group with the most matched form sample of the accurate elementary path as final stroke sample;
The style and features of the final stroke sample are mapped on the accurate elementary path, generation has the Chinese ink painting style
The output image of lattice.
2. according to the method described in claim 1, it is characterized in that, the correction preliminary elementary path, obtains accurate base
The step of this path, includes,
Using the smooth preliminary elementary path of non-homogeneous B spline curve algorithm, the accurate elementary path is obtained.
3. according to the method described in claim 1, it is characterized in that, the selection in the form sample group with it is described accurate
The most matched form sample of elementary path as final stroke sample, including,
The elementary path is divided into several path sections, by energy theorem, selection and institute in the form sample group
State final stroke sample of the most matched form sample of path sections as the path sections.
4. according to the method described in claim 3, it is characterized in that, described by energy theorem, in the form sample group
It chooses and includes with the step of final stroke sample of the most matched form sample of the path sections as the path sections,
The energy theorem is in l2One energy term of definition space, for describing the position of the outline strokes in the final stroke sample
The total difference of the displacement item of transposition and corresponding accurate elementary path (path sections), and make the total difference most
Smallization, so as to automatically select the final stroke sample;
Wherein, the outline strokes that the displacement item is used to describe in the final stroke sample are taken up an official post with the accurate elementary path
Anticipate any relative position vector and stroke direction vector between displacement.
5. according to the method described in claim 4, it is characterized in that, the style and features by the final stroke sample map
Step on to the accurate elementary path includes,
Adjust the Aspect Ratio of the final stroke sample so that the final stroke sample and the corresponding path sections
Aspect Ratio is consistent.
6. according to the method described in claim 1, it is characterized in that, the style and features by the final stroke sample map
Step on to the accurate elementary path further includes,
By the texture-mapping algorithm based on pixel, rasterisation filling region is realized and with out of described final stroke with scan line
In the pixel filling selected to path sections corresponding with the final stroke.
7. according to the method described in claim 6, it is characterised in that it includes:
With pixel described in following constraint:
a、pSAdjacent pixel have distance pFThe nearest color value of neighborhood;
b、pSWith pFPosition with respect to its respective bone path is nearest;
c、pSWith pPThe average color of the pixel of surrounding is closest;
Wherein, pSIt is the best pixel selected in ink stroke region;pFFor any pixel in filling region;pPFor input
Pixel in image;And weigh constraints above condition, E by 3 energy termsb(pS) constraints a is corresponded to, p is describedSWith pFBetween
The summation of the color data error of neighborhood territory pixel;
Ep(pS) constraints b is corresponded to, p is describedSWith pFDegree of closeness between corresponding skeleton path respectively;
Ea(pS) constraints c is corresponded to, p is describedSWith pPRespectively using some R as the difference of the average color of pixel in the circle of radius
It is different;
Specifically meet the following formula:
Wherein, λ (p) represents the color value of p,It is pSNeighborhood territory pixel, andIt is pFNeighborhood territory pixel,Skeleton road
Distance p on diameterFNearest point is identicalUnder value,It is the correspondence one on the skeleton path in the final stroke sample
Point, rSAnd rPIt is the half of the final stroke specimen width respectively, N represents all pixels sum in the circle of specified radius R,Represent circle inherence pSNeighbouring pixel, andIt represents in photograph image, the p in specified circlePNeighbouring pixel.
8. according to the method described in claim 6, it is characterized in that,
The texture-mapping algorithm based on pixel, using in l1The energy equation that definition is made of 3 energy terms in space is simultaneously
Three energy terms are minimized to obtain best pixel, this step meets the following formula:
Wherein, α1, α2And α3Represent balance weight parameter.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711340014.8A CN108171650B (en) | 2017-12-14 | 2017-12-14 | Chinese flower water-ink painting style stroke generation method with stroke optimization function |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711340014.8A CN108171650B (en) | 2017-12-14 | 2017-12-14 | Chinese flower water-ink painting style stroke generation method with stroke optimization function |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108171650A true CN108171650A (en) | 2018-06-15 |
CN108171650B CN108171650B (en) | 2021-08-24 |
Family
ID=62525316
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711340014.8A Active CN108171650B (en) | 2017-12-14 | 2017-12-14 | Chinese flower water-ink painting style stroke generation method with stroke optimization function |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108171650B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108846386A (en) * | 2018-07-10 | 2018-11-20 | 深圳市前海手绘科技文化有限公司 | A kind of hand drawing pattern intelligent recognition and correcting method |
CN109191539A (en) * | 2018-07-20 | 2019-01-11 | 广东数相智能科技有限公司 | Oil painting generation method, device and computer readable storage medium based on image |
CN109523603A (en) * | 2018-10-24 | 2019-03-26 | 广东智媒云图科技股份有限公司 | A kind of drawing method based on texturing methods or types of texture strokes style, device, terminal device and storage medium |
CN110610532A (en) * | 2019-08-12 | 2019-12-24 | 安徽石轩文化科技有限公司 | Method for making animation special effects of ink and wash fluidity elements |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040251067A1 (en) * | 2000-01-10 | 2004-12-16 | Government Of The U.S.A As Represented By The Adm. Of The U.S. Environmental Protection Agency | Hydraulic hybrid vehicle with integrated hydraulic drive module and four-wheel-drive, and method of operation thereof |
CN104239855A (en) * | 2014-09-03 | 2014-12-24 | 南京大学 | Image style transfer synthesis method based on stroke synthesis |
CN106407915A (en) * | 2016-08-31 | 2017-02-15 | 广州精点计算机科技有限公司 | SVM (support vector machine)-based face recognition method and device |
-
2017
- 2017-12-14 CN CN201711340014.8A patent/CN108171650B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040251067A1 (en) * | 2000-01-10 | 2004-12-16 | Government Of The U.S.A As Represented By The Adm. Of The U.S. Environmental Protection Agency | Hydraulic hybrid vehicle with integrated hydraulic drive module and four-wheel-drive, and method of operation thereof |
CN104239855A (en) * | 2014-09-03 | 2014-12-24 | 南京大学 | Image style transfer synthesis method based on stroke synthesis |
CN106407915A (en) * | 2016-08-31 | 2017-02-15 | 广州精点计算机科技有限公司 | SVM (support vector machine)-based face recognition method and device |
Non-Patent Citations (1)
Title |
---|
LIJIE YANG等: "Sketch-based stroke generation in Chinese flower painting", 《SCIENCE CHINA INFORMATION SCIENCES》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108846386A (en) * | 2018-07-10 | 2018-11-20 | 深圳市前海手绘科技文化有限公司 | A kind of hand drawing pattern intelligent recognition and correcting method |
CN108846386B (en) * | 2018-07-10 | 2022-06-24 | 深圳市前海手绘科技文化有限公司 | Intelligent identification and correction method for hand-drawn pattern |
CN109191539A (en) * | 2018-07-20 | 2019-01-11 | 广东数相智能科技有限公司 | Oil painting generation method, device and computer readable storage medium based on image |
CN109523603A (en) * | 2018-10-24 | 2019-03-26 | 广东智媒云图科技股份有限公司 | A kind of drawing method based on texturing methods or types of texture strokes style, device, terminal device and storage medium |
CN109523603B (en) * | 2018-10-24 | 2022-12-02 | 广东智媒云图科技股份有限公司 | Drawing method and device based on chap style, terminal equipment and storage medium |
CN110610532A (en) * | 2019-08-12 | 2019-12-24 | 安徽石轩文化科技有限公司 | Method for making animation special effects of ink and wash fluidity elements |
CN110610532B (en) * | 2019-08-12 | 2023-08-01 | 安徽石轩文化科技有限公司 | Method for making animation special effects of ink and wash fluidity elements |
Also Published As
Publication number | Publication date |
---|---|
CN108171650B (en) | 2021-08-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11288499B2 (en) | Interactive method for generating strokes with Chinese ink painting style and device thereof | |
CN108171650A (en) | One kind has the function of that stroke optimizes Chinese flower ink and wash style stroke generation method | |
Pirk et al. | Plastic trees: interactive self-adapting botanical tree models | |
Foster et al. | Integrating 3D modeling, photogrammetry and design | |
AU2018201319B2 (en) | Flow-based ornamental element packing | |
CN108876868B (en) | Computerized generation of decorative designs by placing instances of simple shapes according to direction guidance | |
Marston et al. | Improving the representation of major landforms in analytical relief shading | |
CN107452058B (en) | Simulation model range-dividing simplification method generation and system based on feature preservation | |
US20140267223A1 (en) | Metabrushes for digital painting | |
Igno-Rosario et al. | Interactive system for painting artworks by regions using a robot | |
Bergen et al. | Automatic and interactive evolution of vector graphics images with genetic algorithms | |
CN104978708B (en) | Interactive colored woodcut digital synthesis method out of print | |
Yang et al. | Easy drawing: Generation of artistic chinese flower painting by stroke-based stylization | |
CN108171766A (en) | A kind of image generating method that there are outline strokes and correct | |
Schofield | Non-photorealistic rendering: a critical examination and proposed system. | |
Du | Application of CAD aided intelligent technology in landscape design | |
Yang et al. | Brushwork master: Chinese ink painting synthesis for animating brushwork process | |
Jenny et al. | Challenges in adapting example-based texture synthesis for panoramic map creation: a case study | |
CN108171767A (en) | A kind of image generating method that there is curve and correct | |
CN108038819A (en) | A kind of stroke generation method based on interactive mode | |
CN107481184B (en) | Low polygon style diagram generation interactive system | |
Atoyan et al. | New Technologies in 3D Mapping | |
Liu et al. | Animating characters in Chinese painting using two-dimensional skeleton-based deformation | |
KR101295063B1 (en) | Realistic and Real-Time Modeling System and Method thereof | |
Kennelly | Cross-hatched shadow line maps |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |