CN108171650B - Chinese flower water-ink painting style stroke generation method with stroke optimization function - Google Patents

Chinese flower water-ink painting style stroke generation method with stroke optimization function Download PDF

Info

Publication number
CN108171650B
CN108171650B CN201711340014.8A CN201711340014A CN108171650B CN 108171650 B CN108171650 B CN 108171650B CN 201711340014 A CN201711340014 A CN 201711340014A CN 108171650 B CN108171650 B CN 108171650B
Authority
CN
China
Prior art keywords
stroke
sample
path
final
morphology
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711340014.8A
Other languages
Chinese (zh)
Other versions
CN108171650A (en
Inventor
杨丽洁
徐添辰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huaqiao University
Original Assignee
Huaqiao University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huaqiao University filed Critical Huaqiao University
Priority to CN201711340014.8A priority Critical patent/CN108171650B/en
Publication of CN108171650A publication Critical patent/CN108171650A/en
Application granted granted Critical
Publication of CN108171650B publication Critical patent/CN108171650B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)

Abstract

The invention discloses a Chinese flower ink-wash painting style stroke generating method with a stroke optimizing function, which comprises the following steps of obtaining an image containing flower patterns as an image object; obtaining a delineation operation on a pre-stored flower wash painting drawing sample, wherein the delineation operation at least comprises a stroke sample; acquiring a basic outline sketched on an image object by a user, wherein the basic outline forms a preliminary basic path of a stroke to be generated; correcting the preliminary basic path to obtain an accurate basic path; selecting a morphology sample which is most matched with the accurate basic path from the morphology sample group as a final stroke sample; and mapping the style characteristics of the final stroke sample to an accurate basic path to generate an output image with the style of Chinese ink and wash painting.

Description

Chinese flower water-ink painting style stroke generation method with stroke optimization function
Technical Field
The invention relates to a style migration technology for computer graphics non-photorealistic drawing, in particular to a Chinese flower ink-wash painting style stroke generation method with stroke optimization function.
Background
The Chinese calligraphy ink-wash painting is different from other painting types (such as western oil painting and water color painting), and a few pens are used for describing specific scene objects or scenes so as to express the creation intention and artistic personality of a painter. The writing ink-water painting attracts more and more people to learn and create the ink-water painting with the unique artistry, including painting enthusiasts without the painting technology base. Moreover, most of the current graphic business software (such as Adobe Illustrator, Adobe Photoshop, CorelDRAW, etc.) supports the generation tool of Chinese artistic style. However, generating high quality pictorial representations typically requires expert knowledge and skill, and existing painting tools require complex and accurate input in terms of painting skill, while tools that generate paintings using style migration (e.g., fig. 1(b)) migrate only a certain painting style entirely to a given object, taking into account very little local stroke morphology and color.
The flower wash painting is one of the main categories of Chinese wash painting, and represents the important artistic characteristics of the oriental painting. In other words, the unique artistic charm and value of the ink-wash painting are formed by the typical pen and ink method in the flower painting: the pen is curved or straight, rigid or soft, wide or narrow, or pale or thick; its ink color can be changed into different dry and wet colors by mixing and diffusing between water and ink. Thus, the variety and complexity of strokes and ink colors, as well as the professional skills of the drawing, make the task of generating the drawing challenging.
Generally speaking, non-photorealistic drawing refers to drawing a specific object like hand drawing by constructing different brush models and outputting strokes with artistic styles. In recent years, there have been some excellent works associated with photorealistic rendering worth learning and reference. There are two major efforts:
one aspect is a physics-based model: to provide the user with an intuitive natural feeling, a pen-like device simulates the physical process of drawing by modeling the physical properties of the pen or other medium. Among these, Chu and Tai in the literature [ 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] designed a Real-Time painting system to simulate the effect of Ink spreading on Absorbent Paper. Meanwhile, Xu et al, in documents [ Xu s., Tang m., LAU f., et al, "Virtual hair Brush for painting recovery", graphic Models, vol.66 (5), pp.263-302,2004], propose a novel "electronic Brush" for chinese calligraphy and painting, which defines the basic features of a real Brush with only four attributes. Lu et al in the literature [ Lu j., Barnes c., divldi s., et al, "RealBrush: Painting with edition of Physical Media", ACM Transactions on Graphics, vol.32(4), pp.117,2013] propose an interactive data-driven Painting system which can synthesize new strokes using scanned images of real Media, avoiding the computation of complex Physical simulations. For digital painting software, such as Adobe brush packages, ArtRage, and core Painter, users operate a mouse or digital pen to paint as if they use a real brush. However, it is complicated and difficult for users without relevant drawing experience to easily and accurately operate such a device without training them in their operation of such a virtual device. Another aspect is an image-based model: such models avoid large-scale computational effort and complex manipulations compared to physical models. In simulating western drawings, Herzmann et al, In Hertzmann A., Jacobs C.E., Oliver N., et al, "Image analogies", In: Proceedings of the 28th Annual Conference on Computer Graphics and Interactive technologies, New York, USA, pp.327-340,2001, processed photographic images using an "Image analogy" technique to generate images with artistic effects, but In their experimental results, for Chinese drawings, since different Image regions are drawn using different styles, the algorithm cannot distinguish these regions, and thus an undesirable stylized result is obtained. In simulating eastern paintings, Xie et al have devised a sketch-based interactive system In the literature [ Xie N., Laga H., Saito S., "IR 2s: interactive real photo to Sumi-e", In: Proceedings of the 8th International Symposium on Non-photographic Animation and Rendering, Annecy, France, pp.63-71,2010] to convert real photographs into Japanese ink painting paintings. Dong et al in the documents [ 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] convert images into images having the Chinese Ink and wash style by texture mapping and texture synthesis techniques. However, the existing model for simulating the oriental painting style mainly processes the whole image, not the strokes constituting the image, so that it is difficult to express the rich and varied artistic characteristics of the chinese painting.
Disclosure of Invention
Aiming at the technical problems, the defects in the prior art are overcome, the method for generating the Chinese flower ink-wash painting style strokes with the stroke optimization function is provided, the guidance lines roughly drawn by the user on the photos can be converted into the strokes with a certain Chinese ink-wash painting style by a series of algorithms, and the effect of transferring the Chinese ink-wash painting style to the photo images is realized.
The method comprises the following steps of,
acquiring an image containing a flower pattern as an image object;
obtaining a delineation operation on a pre-stored flower ink painting drawing sample, wherein the delineation operation at least comprises a stroke sample;
acquiring a basic contour sketched on the image object by a user, wherein the basic contour forms a preliminary basic path of a stroke to be generated;
correcting the stroke contour in the circled stroke sample to obtain an accurate stroke sample as a candidate stroke sample; generating a set of configuration samples with the candidate stroke samples as references; determining the outline closest to the stroke edge in the stroke samples by adopting a phase search algorithm to obtain the candidate stroke samples;
generating a morphology sample group by using the candidate stroke sample as a reference in a mirror image and reverse path mode; wherein each said morphology sample set comprises at least four morphology samples including said candidate stroke sample as a reference, a mirror stroke sample of said candidate stroke sample, an inverse path stroke of said candidate stroke sample, and an inverse path stroke of said candidate stroke sample mirror stroke;
correcting the preliminary basic path to obtain an accurate basic path;
selecting a morphology sample which is most matched with the accurate basic path from the morphology sample group as a final stroke sample;
and mapping the style characteristics of the final stroke sample to the accurate basic path to generate an output image with the style of Chinese ink and wash painting.
As a further improvement, the step of correcting the preliminary base path to obtain an accurate base path includes,
and smoothing the preliminary basic path by adopting a non-uniform rational B-spline curve algorithm to obtain the accurate basic path.
As a further refinement, said selecting a morphology sample in said set of morphology samples that best matches said exact base path as a final stroke sample comprises,
and dividing the basic path into a plurality of path parts, and selecting a morphology sample which is most matched with the path part from the morphology sample group as a final stroke sample of the path part through an energy formula.
As a further improvement, the step of selecting the morphology sample that best matches the path portion in the morphology sample group as the final stroke sample of the path portion by the energy formula includes,
the energy formula is in2The space defines an energy item for describing the total difference of the displacement item of the stroke contour in the final stroke sample and the displacement item of the accurate basic path (path part) corresponding to the displacement item, and minimizes the total difference, thereby automatically selecting the final stroke sample;
wherein the displacement term is used for describing the displacement between the stroke direction vector and the relative position vector of the stroke contour in the final stroke sample and any point on the accurate basic path.
As a further refinement, said step of mapping style characteristics of said final stroke sample onto said accurate base path comprises,
adjusting the aspect ratio of the final stroke sample such that the final stroke sample coincides with the aspect ratio of the corresponding path portion.
As a further refinement, said step of mapping style characteristics of said final stroke sample onto said accurate base path further comprises,
and realizing rasterization filling areas by using scanning lines through a pixel-based texture mapping algorithm, and filling the pixels selected from the final stroke into a path part corresponding to the final stroke.
As a further improvement, the method comprises the following steps:
the pixel is constrained with the following conditions:
a、pShas a distance pFThe nearest color value of the neighborhood;
b、pSand pFThe position relative to its respective bone path is nearest;
c、pSand pPThe mean color values of the surrounding pixels are closest;
wherein p isSIs the best pixel selected within the ink stroke area; p is a radical ofFAny pixel in the filling area; p is a radical ofPAre pixels in the input image; and the above constraint, E, is measured by 3 energy termsb(pS) Description p corresponding to constraint aSAnd pFSum of color value differences of neighboring pixels between;
Ep(pS) Description of p corresponding to constraint bSAnd pFProximity to respective skeleton paths;
Ea(pS) Corresponding to constraint c, description pSAnd pPA difference in average color values of pixels within a circle each having a certain R as a radius;
specifically, the following formula is satisfied:
Figure BDA0001508184610000071
wherein λ (p) represents a color value of p,
Figure BDA0001508184610000072
is pSAnd a neighborhood of pixels of
Figure BDA0001508184610000073
Is pFThe neighborhood of the pixels of the image,
Figure BDA0001508184610000074
distance p on skeleton pathFThe closest point, same
Figure BDA0001508184610000075
Under the condition of the lower pressure, the pressure of the air is lower,
Figure BDA0001508184610000076
is the corresponding point on the skeleton path in the final stroke sample, rSAnd rPIs half the width of the final stroke sample, N representsThe total number of all pixels within a circle of a given radius R,
Figure BDA0001508184610000077
denotes the circle inner pSA nearby pixel, and
Figure BDA0001508184610000078
is shown in the photographic image within a specified circle pPNearby pixels.
As a further improvement, it is characterized in that,
the pixel-based texture mapping algorithm utilizes the texture mapping algorithm at1Defining an energy equation consisting of 3 energy terms in space and minimizing three of the energy terms to obtain an optimal pixel, wherein the step satisfies the following formula:
Figure BDA0001508184610000079
wherein alpha is1,α2And alpha3Representing the balance weight parameter.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a comparison diagram of an ink image generated by the present invention and an ink image generated by an existing painting tool, wherein (a) is an original image without ink image processing, (b) is an ink image generated by an existing painting tool, and (C) is an ink image generated by the present invention.
FIG. 2 is an overall flow chart of the method of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 2, fig. 2 is a diagram illustrating a method for generating Chinese flower ink-wash painting style strokes with stroke optimization function according to a first embodiment of the present invention, which includes the following steps,
s10, acquiring an image containing flower pattern as an image object;
obtaining a delineation operation on a pre-stored ink painting drawing sample of the flower, wherein the delineation operation at least comprises a stroke sample;
the image object comprises image content, the pattern of which can be animals, plants and the like, and can be specifically cattle, horses, flowers and plants; the subject of the pre-stored ink-wash painting sample can also be animals, plants and the like, and the subject of the ink-wash painting sample needs to be consistent with the pattern in the image object, for example, the subject of the ink-wash painting is flowers, and the subject of the pattern also needs to be consistent; in other words, the image object is selected as a template of the basic path that the user wants to outline, and the stroke sample is a stroke style feature of the basic path that the user wants.
S20, obtaining the basic outline of the flower pattern sketched on the image object by the user, wherein the basic outline forms the preliminary basic path of the stroke to be generated;
the delineation mentioned here may not achieve the effect of completely conforming to the basic outline of the pattern, may be a rough delineation, and may also include the creative of the user therein, such as adding lines not present in the pattern template to the preliminary basic path.
S30, correcting the outline of the circled stroke sample to obtain an accurate stroke sample as a candidate stroke sample; and generating a configuration sample group by taking the candidate stroke sample as a reference.
In the process of delineating the stroke sample, because only the area of the desired stroke in the stroke sample is delineated, a non-stroke area (the non-stroke area referred to herein is a part excluding the stroke line) may occur, such an effect is that information contained in the stroke sample area is not accurate stroke profile information and also includes an interference factor, which is not favorable for extracting a specific stroke profile in the stroke sample, and meanwhile, in order to ensure the efficiency and experience of the user when selecting the stroke sample, such an interference factor is unavoidable, so that the extraction of the stroke sample profile in the stroke sample is unavoidable. In this embodiment, the candidate stroke sample is obtained by determining the contour closest to the stroke edge in the stroke sample by using a phase search algorithm.
In the opposite search algorithm, the stroke contour in the stroke sample is composed of a three-curve structure (C)S,LS,RS) Is represented by the formula (I) in which CS(t)∈ISFrom CS(t)=(LS(t)+RS(t))/2, and its domain FSAt LSAnd RSRough outline, L, between which is a sample of a candidate strokeSAnd RSAre both sides of the general outline; then the side edge LSAnd RSFitted to curve LS(t) and RS(t) and dividing it into the same number of curve segments; assume the endpoints on each curve segment as LS(t) and RSCharacteristic points on (t), will be from LS(t) pointing to RSThe line direction of (t) is defined as the positive direction omega (t) of search, and the direction derivative D of the gray value of each pixel is calculated along the omega (t) direction and the-omega (t) direction respectivelyAnd DFinally, resetting each pair of feature points to the position of the global minimum of the direction guide number; adjusting side LSAnd a side edge RSTo the contour that most closely follows the stroke within the stroke sample.
Generating a configuration sample group by using the candidate stroke sample as a reference in a mirror image and inverse path mode, and simulating different postures of the candidate stroke sample; wherein each of the morphology sample sets comprises at least four morphology samples, the four morphology samples comprising the candidate stroke sample as a reference, a mirror stroke sample of the candidate stroke sample, an inverse path stroke of the candidate stroke sample, and an inverse path stroke of the candidate stroke sample mirror stroke.
According to the three-curve structure, formula (1) is satisfied, and formula (1) is defined as:
Figure BDA0001508184610000101
wherein n is the number of samples of a plurality of strokes, and a candidate set comprising 4n elements is formed by 4 cases of each stroke:
Figure BDA0001508184610000102
the 4 cases of the stroke are sequentially
Figure BDA0001508184610000103
S40, correcting the preliminary basic path to obtain an accurate basic path;
the rough sketch can cause part of the rough and uneven path to be rough, the edges of the strokes of the painting works in the ink-wash painting style are shown in relatively smooth postures, and in order to accurately restore the lines of the painting works in the ink-wash painting style, the rough basic path is smoothed by adopting a non-uniform rational B-spline algorithm in the embodiment to obtain a smooth accurate basic path.
The preliminary base path in the image object consists of a three-curve structure (C)P,LP,RP) Expressing that the three-curve structure (C) is smoothed by adopting a non-uniform rational B-spline curve algorithmP,LP,RP)。
S50, selecting the morphology sample which is most matched with the accurate basic path in the morphology sample group as a final stroke sample;
and dividing the accurate basic path into a plurality of path parts, and selecting a morphology sample which is most matched with the path part from the morphology sample group as a final stroke sample of the path part through an energy formula. The candidate stroke sample has a single form, so that the candidate stroke sample is difficult to match with an accurate basic path, and the matching probability of the path part and the candidate stroke is increased by the multiple candidate stroke forms generated by the form sample group.
The description is made in conjunction with an energy formula, which is set forth in2Spatial definition
Figure BDA0001508184610000111
Description of the invention
Figure BDA0001508184610000112
And CPThe total difference of the displacement term delta, wherein the displacement term is used for describing the displacement between the stroke direction vector and the relative position vector of the stroke contour in the final stroke sample and any point on the accurate basic path. This overall difference is then minimized, thereby automatically selecting the optimal stroke template. Satisfying formula (2), formula (2) is defined as:
Figure BDA0001508184610000113
wherein, the displacement term δ is calculated by formula (3), and the formula (3) is defined as:
Figure BDA0001508184610000121
wherein the content of the first and second substances,
Figure BDA0001508184610000122
for any of the basic paths, the path is,
Figure BDA0001508184610000123
is composed of
Figure BDA0001508184610000124
To
Figure BDA0001508184610000125
The direction of the lines of (a) is,
Figure BDA0001508184610000126
is composed of
Figure BDA0001508184610000127
At any point on
Figure BDA0001508184610000128
Relative position vector of
Figure BDA00015081846100001212
To
Figure BDA0001508184610000129
The mapping of (a) to (b) is,
Figure BDA00015081846100001210
is the displacement from the closest point.
And S60, mapping the style characteristics of the final stroke sample to the accurate basic path to generate an output image with Chinese ink and wash painting style.
Obtaining a form sample corresponding to each path part in the parts through an energy formula, and then replacing the original path part with the form sample corresponding to each path part to generate a contour which conforms to the characteristics of the stroke sample selected by the user; subsequently adjusting the aspect ratio of the final stroke sample so that the final stroke sample is consistent with the aspect ratio of the corresponding path part; and implementing raster filling of the region with the scan lines and filling into a path portion corresponding to the final stroke with pixels selected from within the final stroke by a pixel-based texture mapping algorithm.
In adjusting the aspect ratio of the final stroke sample such that the final stroke sample coincides with the aspect ratio of the corresponding path portion, a final stroke width wP(t) exact base path C on the photo objectPIs related to the curvature. W isP(t) is calculated from equation (4), defining equation (4) as:
Figure BDA00015081846100001211
wherein k isw(t) is a coefficient to scale the final stroke sample width, LPAnd kappaP(t) indicates the length and curvature of the exact base path, respectively. Coefficient term kw(t) is calculated from equation (5), defining equation (5) as:
Figure BDA0001508184610000131
wherein, κS(t) accurate base Path CS(t) curvature, LSIs represented by CS(t) length.
In implementing rasterized fill regions with scan lines and filling with pixels selected from within the final stroke to a path portion corresponding to the final stroke via a pixel-based texture mapping algorithm, the pixels are constrained under the following conditions:
a、pShas a distance pFThe nearest color value of the neighborhood;
b、pSand pFThe position relative to its respective bone path is nearest;
c、pSand pPThe mean color values of the surrounding pixels are closest;
wherein p isSIs the best pixel selected within the ink stroke area; p is a radical ofFAny pixel in the filling area; p is a radical ofPAre pixels in the input image; and the above constraint is measured by 3 energy terms:
Eb(pS) Description p corresponding to constraint aSAnd pFSum of color value differences of neighboring pixels between;
Ep(pS) Description of p corresponding to constraint bSAnd pFProximity to respective skeleton paths;
Ea(pS) Corresponding to constraint c, description pSAnd pPA difference in average color values of pixels within a circle each having a certain R as a radius;
it satisfies the following formula:
Figure BDA0001508184610000141
wherein λ (p) represents a color value of p,
Figure BDA0001508184610000142
is pSAnd a neighborhood of pixels of
Figure BDA0001508184610000143
Is pFThe neighborhood of the pixels of the image,
Figure BDA0001508184610000144
distance p on skeleton pathFThe closest point, same
Figure BDA0001508184610000145
Under the condition of the lower pressure, the pressure of the air is lower,
Figure BDA0001508184610000146
is the corresponding point on the skeleton path in the final stroke sample, rSAnd rPRespectively, half the width of the final stroke sample, N representing the total number of all pixels within a circle of a specified radius R,
Figure BDA0001508184610000147
denotes the circle inner pSA nearby pixel, and
Figure BDA0001508184610000148
is shown in the photographic image within a specified circle pPNearby pixels.
The pixel-based texture mapping algorithm utilizes the texture mapping algorithm at1Defining an energy equation consisting of 3 energy terms in space and minimizing three of the energy terms to obtain an optimal pixel, wherein the step satisfies the following formula:
Figure BDA0001508184610000149
wherein alpha is1,α2And alpha3Representing the balance weight parameter.
S70, after the painting result of the ink and wash painting style strokes is generated, the decorative elements are selected according to the intention of the user to be implanted into the painting result, and then the final painting result is generated.
The painting element referred to herein may be a character.
The second embodiment of the invention provides equipment for generating Chinese flower ink-wash painting style strokes with stroke optimization function, which comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program, such as the Chinese flower ink-wash painting style stroke generating program with stroke optimization function;
illustratively, the computer program may be partitioned into one or more modules, one or more of which are stored in the memory and executed by the processor to accomplish the present embodiments. One or more modules can be a series of computer program instruction segments capable of achieving specific functions, and the instruction segments are used for describing the execution process of the computer program in Chinese flower ink-wash painting style stroke generation terminal equipment with stroke optimization function.
The Chinese flower wash painting style stroke generating device with the stroke optimizing function can be computing devices such as a desktop computer, a notebook computer, a palm computer and a cloud server.
The Chinese flower ink-wash painting style stroke generating device with the stroke optimizing function can comprise, but is not limited to, a processor, a memory and a display. Those skilled in the art will appreciate that the schematic diagram is merely an example of the chinese floriculture ink-wash style stroke generating device with stroke optimization function, and does not constitute a limitation of the chinese floriculture ink-wash style stroke generating device with stroke optimization function, and may include more or less components than those shown, or combine some components, or different components, for example, the chinese floriculture ink-wash style stroke generating device with stroke optimization function may further include an input-output device, a network access device, a bus, etc.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general processor can be a microprocessor or the processor can also be any conventional processor and the like, the processor is a control center of the Chinese flower ink-wash painting style stroke generating device with the stroke optimizing function, and various interfaces and lines are utilized to connect all parts of the whole Chinese flower ink-wash painting style stroke generating device with the stroke optimizing function.
The memory can be used for storing the computer program and/or the module, and the processor realizes various functions of the Chinese flower ink-painting style stroke generating device with the stroke optimization function by running or executing the computer program and/or the module stored in the memory and calling the data stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program (such as a sound playing function, a text conversion function, etc.) required by at least one function, and the like; the storage data area may store data (such as audio data, text message data, etc.) created according to the use of the cellular phone, etc. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The module integrated with the Chinese flower ink-wash painting style stroke generating device with the stroke optimizing function can be stored in a computer readable storage medium if the module is realized in a software functional unit form and sold or used as an independent product. Based on such understanding, all or part of the flow in the method according to the above embodiments may be implemented by a computer program, which may be stored in a computer readable storage medium and used by a processor to implement the steps of the above embodiments of the method. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate additions and subtractions as required by legislation and patent practice in jurisdictions, for example in certain jurisdictions where computer readable media does not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
It should be noted that the above-described embodiments of the apparatus are merely schematic, where the units described as separate parts may or may not be physically separate, and the parts shown as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
The foregoing is a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations are also regarded as the protection scope of the present invention.

Claims (6)

1. A Chinese flower wash painting style stroke generation method with stroke optimization function is characterized by comprising the following steps,
acquiring an image containing a flower pattern as an image object;
obtaining a delineation operation on a pre-stored flower ink painting drawing sample, wherein the delineation operation at least comprises a stroke sample;
acquiring a basic outline sketched on the image object by a user, wherein the basic outline forms a preliminary basic path of a stroke to be generated;
correcting the stroke contour in the circled stroke sample to obtain an accurate stroke sample as a candidate stroke sample; generating a form sample group by taking the candidate stroke sample as a reference; determining the outline closest to the stroke edge in the stroke samples by adopting a phase search algorithm to obtain the candidate stroke samples;
generating a morphology sample group by using the candidate stroke sample as a reference in a mirror image and reverse path mode; wherein each said morphology sample set comprises at least four morphology samples including said candidate stroke sample as a reference, a mirror stroke sample of said candidate stroke sample, an anti-path stroke of said candidate stroke sample, and an anti-path stroke of said candidate stroke sample mirror stroke;
correcting the preliminary basic path to obtain an accurate basic path;
selecting a morphology sample which is most matched with the accurate basic path from the morphology sample group as a final stroke sample;
mapping style characteristics of the final stroke sample to the accurate basic path to generate an output image with a Chinese ink and wash painting style; wherein the step of mapping style characteristics of the final stroke sample onto the accurate base path comprises:
implementing a rasterized fill area with scan lines and filling into a path portion corresponding to the final stroke with pixels selected from within the final stroke by a pixel-based texture mapping algorithm; in this process, the pixel is constrained with the following conditions:
a、pShas a distance pFThe nearest color value of the neighborhood;
b、pSand pFThe position relative to its respective bone path is nearest;
c、pSand pPThe mean color values of the surrounding pixels are closest;
wherein p isSIs the best pixel selected within the ink stroke area; p is a radical ofFAny pixel in the filling area; p is a radical ofPAre pixels in the input image; and the above constraint is measured by 3 energy terms, Eb(pS) Description p corresponding to constraint aSAnd pFSum of color value differences of neighboring pixels therebetween;
Ep(pS) Description of p corresponding to constraint bSAnd pFProximity to respective skeleton paths;
Ea(pS) Corresponding to constraint c, description pSAnd pPA difference in average color values of pixels within a circle each having a certain R as a radius;
specifically, the following formula is satisfied:
Figure FDA0003128374930000021
wherein λ (p) represents a color value of p,
Figure FDA0003128374930000022
is pSAnd a neighborhood of pixels of
Figure FDA0003128374930000023
Is pFThe neighborhood of the pixels of the image,
Figure FDA0003128374930000024
distance p on skeleton pathFThe closest point, same
Figure FDA0003128374930000025
Under the condition of the lower pressure, the pressure of the air is lower,
Figure FDA0003128374930000031
is the corresponding point on the skeleton path in the final stroke sample, rSAnd rPRespectively, half the width of the final stroke sample, N representing the total number of all pixels within a circle of a specified radius R,
Figure FDA0003128374930000032
denotes the circle inner pSA nearby pixel, and
Figure FDA0003128374930000033
is shown in the photographic image within a specified circle pPNearby pixels.
2. The method according to claim 1, wherein the step of correcting the preliminary base path to obtain an accurate base path comprises,
and smoothing the preliminary basic path by adopting a non-uniform rational B-spline curve algorithm to obtain the accurate basic path.
3. The method of claim 1, wherein said selecting a morphology sample in said set of morphology samples that best matches said exact base path as a final stroke sample comprises,
and dividing the basic path into a plurality of path parts, and selecting a morphology sample which is most matched with the path part in the morphology sample group as a final stroke sample of the path part through an energy formula.
4. The method of claim 3, wherein the step of selecting the morphology sample that best matches the path portion in the morphology sample set as the final stroke sample of the path portion according to the energy formula comprises,
the energy formula is in2Defining an energy item in space, describing the total difference of the displacement item of the stroke contour in the final stroke sample and the displacement item of the accurate basic path corresponding to the displacement item, and minimizing the total difference, thereby automatically selecting the final stroke sample;
wherein the displacement term is used for describing the displacement amount between the stroke direction vector and the relative position vector of the stroke contour in the final stroke sample and any point on the accurate basic path.
5. The method of claim 4, wherein the step of mapping style characteristics of the final stroke sample onto the accurate base path comprises,
adjusting the aspect ratio of the final stroke sample such that the final stroke sample coincides with the aspect ratio of the corresponding path portion.
6. The method of claim 1,
the pixel-based texture mapping algorithm utilizes the texture mapping algorithm at1Defining an energy equation consisting of 3 energy terms in space and minimizing three of the energy terms to obtain an optimal pixel, wherein the step satisfies the following formula:
Figure FDA0003128374930000041
wherein alpha is1,α2And alpha3Representing the balance weight parameter.
CN201711340014.8A 2017-12-14 2017-12-14 Chinese flower water-ink painting style stroke generation method with stroke optimization function Active CN108171650B (en)

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 CN108171650A (en) 2018-06-15
CN108171650B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108846386B (en) * 2018-07-10 2022-06-24 深圳市前海手绘科技文化有限公司 Intelligent identification and correction method for hand-drawn pattern
CN109191539B (en) * 2018-07-20 2023-01-06 广东数相智能科技有限公司 Oil painting generation method and device based on image and computer readable storage medium
CN109523603B (en) * 2018-10-24 2022-12-02 广东智媒云图科技股份有限公司 Drawing method and device based on chap style, terminal equipment and storage medium
CN110610532B (en) * 2019-08-12 2023-08-01 安徽石轩文化科技有限公司 Method for making animation special effects of ink and wash fluidity elements

Citations (3)

* Cited by examiner, † Cited by third party
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
Sketch-based stroke generation in Chinese flower painting;Lijie Yang等;《Science China Information Sciences》;20160731;全文 *

Also Published As

Publication number Publication date
CN108171650A (en) 2018-06-15

Similar Documents

Publication Publication Date Title
US11288499B2 (en) Interactive method for generating strokes with Chinese ink painting style and device thereof
US10748324B2 (en) Generating stylized-stroke images from source images utilizing style-transfer-neural networks with non-photorealistic-rendering
CN108171650B (en) Chinese flower water-ink painting style stroke generation method with stroke optimization function
US10922860B2 (en) Line drawing generation
US8896622B2 (en) Methods and apparatus for marker-based stylistic rendering
KR20200027030A (en) Facial Expression Synthesis Methods and Devices, Electronic Devices, and Storage Media
GB2559446A (en) Generating a three-dimensional model from a scanned object
CN105374007A (en) Generation method and generation device of pencil drawing fusing skeleton strokes and textural features
CN108876868B (en) Computerized generation of decorative designs by placing instances of simple shapes according to direction guidance
JP7488436B2 (en) Automating the Creation of Graphic Designs Using Convolutional Neural Network Style Transfer
CN115812221A (en) Image generation and coloring method and device
CN114037802A (en) Three-dimensional face model reconstruction method and device, storage medium and computer equipment
JP2021120914A (en) Data extension system, data extension method and program
Igno-Rosario et al. Interactive system for painting artworks by regions using a robot
CN108171766B (en) Image generation method with stroke contour correction function
Yang et al. Easy drawing: Generation of artistic chinese flower painting by stroke-based stylization
Uchida et al. Stylized line-drawing of 3D models using CNN with line property encoding
Doyle et al. Automated pebble mosaic stylization of images
CN114299206A (en) Three-dimensional cartoon face generation method and device, electronic equipment and storage medium
Yang et al. Animating Chinese ink painting through generating reproducible brush strokes
Zheng et al. Example-based brushes for coherent stylized renderings
Kasao et al. Algorithmic Painter: a NPR method to generate various styles of painting
CN108038819B (en) Interactive stroke generation method
Shang et al. Automatic portrait image pixelization
CN108171767B (en) Image generation method with curve correction function

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