CN103093417B - Generate method and the device of watercolor style image - Google Patents
Generate method and the device of watercolor style image Download PDFInfo
- Publication number
- CN103093417B CN103093417B CN201310037570.3A CN201310037570A CN103093417B CN 103093417 B CN103093417 B CN 103093417B CN 201310037570 A CN201310037570 A CN 201310037570A CN 103093417 B CN103093417 B CN 103093417B
- Authority
- CN
- China
- Prior art keywords
- image
- blurred picture
- watercolor style
- alpha
- inverse
- 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.)
- Expired - Fee Related
Links
Landscapes
- Image Processing (AREA)
Abstract
The present invention relates to a kind of method generating watercolor style image, comprising: obtain original image; Fuzzy Processing is carried out to described original image, generates blurred picture; Rim detection is carried out to described blurred picture, generates edge image; Inverse process is carried out to described edge image, generates inverse image; Carry out Alpha to described blurred picture with described inverse image to mix, generate watercolor style image.In addition, a kind of device generating watercolor style image is also comprised.Method and the device of above-mentioned generation watercolor style image can improve processing speed, and the watercolor style image generated shows and enriches agile color effect and transparent free and natural visual experience.
Description
Technical field
The present invention relates to image processing field, particularly relate to a kind of method and the device that generate watercolor style image.
Background technology
In daily life, people in order to make photo have certain artistic style, usually can carry out post-processed by comparison film after taking pictures, and by the stylization of the photo of shooting, generate the picture with artistic effect, such as, generate the picture with watercolor style.
The method of current generation watercolor style image has two kinds, and a kind of is play up generation method (IBR) based on the image procossing of true picture, and another kind plays up generation method (NPR) based on the feeling of unreality of model.
Feeling of unreality based on model play up generation method need to scene modeling and and people could generate alternately, and need to possess certain drawing techniques and just can create a gratifying picture, so various scene and the demand of automatic business processing cannot be met, not there is ubiquity automatic generation in watercolor.
Image procossing based on true picture is played up generation method and is met various scene demand, generally carry out complicated design by image editing softwares such as Photoshop to true picture to generate at present, the method needs just can complete at PC end, and need certain computing machine and art activities, design consuming time, the demand automatically generated cannot be met.
Summary of the invention
Based on this, be necessary to provide a kind of method that can improve the generation watercolor style image of processing speed.
Generate a method for watercolor style image, comprising:
Obtain original image;
Fuzzy Processing is carried out to described original image, generates blurred picture;
Rim detection is carried out to described blurred picture, generates edge image;
Inverse process is carried out to described edge image, generates inverse image;
Carry out Alpha to described blurred picture with described inverse image to mix, generate watercolor style image.
Wherein in an embodiment, described the step that Alpha mixes is carried out to described blurred picture and described inverse image before also comprise:
Improve the brightness of described blurred picture.
Wherein in an embodiment, describedly the step that Alpha mixes carried out to described blurred picture and described inverse image be:
According to formula:
Generate watercolor style image; Wherein, i, j are the pixel coordinate of pixel in image, C
i,jfor the watercolor style image generated, α is mixed transparent degree, B
i,jfor described blurred picture, F
i,jfor described inverse image.
Wherein in an embodiment, also comprise after the step of described generation watercolor style image:
By Gaussian mean filtering, noise reduction process is carried out to described watercolor style image.
Wherein in an embodiment, describedly to the step that described blurred picture carries out rim detection be:
According to Prewitt operator, rim detection is carried out to described blurred picture.
In addition, there is a need to provide a kind of device that can improve the generation watercolor style image of processing speed.
Generate a device for watercolor style image, comprising:
Original image acquisition module, for obtaining original image;
Blurred picture generation module, for carrying out Fuzzy Processing to described original image, generates blurred picture;
Edge image generation module, for carrying out rim detection to described blurred picture, generates edge image;
Inverse Computer image genration module, for carrying out inverse process to described edge image, generates inverse image;
Image blend module, mixes for carrying out Alpha to described blurred picture with described inverse image, generates watercolor style image.
Wherein in an embodiment, described image blend module also can be used for the brightness improving described blurred picture.
Wherein in an embodiment, described image blend module can be used for according to formula:
Generate watercolor style image; Wherein, i, j are the pixel coordinate of pixel in image, C
i,jfor the watercolor style image generated, α is mixed transparent degree, B
i,jfor described blurred picture, F
i,jfor described inverse image.
Wherein in an embodiment, described device also comprises image noise reduction module, for carrying out noise reduction process by gaussian filtering to described watercolor style image.
Wherein in an embodiment, described edge image generation module is also for carrying out rim detection according to Prewitt operator to described blurred picture.
The method of above-mentioned generation watercolor style image and device, only done the operations such as Fuzzy Processing, rim detection, inverse process and image blend to image, aforesaid operations is linear calculating, and therefore calculated amount is less, thus improves processing speed.
Simultaneously, the photo that one width can be taken at PC end or mobile intelligent terminal by the present invention generates a width watercolor style image fast automaticly, efficiently solve Problems existing in conventional art, and its can also also can be fast automatic in the relatively poor intelligent terminal of hardware environment process.Watercolor style final effect shows and enriches agile color effect and transparent free and natural visual experience.
Accompanying drawing explanation
Fig. 1 is the process flow diagram generating the method for watercolor style image in an embodiment;
Fig. 2 is the design sketch of original image in an embodiment;
Fig. 3 is the design sketch of watercolor style image in an embodiment;
Fig. 4 is the structural representation generating the device of watercolor style image in an embodiment;
Fig. 5 is the structural representation of the device generating watercolor style image in another embodiment.
Embodiment
In one embodiment, as shown in Figure 1, a kind of method generating watercolor style image, comprising:
Step S102, obtains original image.
Namely original image needs the image of the artistic special efficacy of it being added to watercolor style.In one embodiment, can monitor the event of taking pictures of intelligent terminal, when capturing the event of taking pictures of intelligent terminal, automatic acquisition takes pictures the photo that obtains as original image.
Step S104, carries out Fuzzy Processing to original image, generates blurred picture.
Fuzzy Processing is carried out to original image, namely by image blurring wave filter, filtering is carried out to original image.
In one embodiment, Gaussian Blur can be carried out to original image and generate blurred picture.
In the present embodiment, by using separable Gaussian filter to carry out threshold decision to original image and carrying out filtering to original image after convolution.
Separable Gaussian filter is:
Wherein, G (r) is the weighting coefficient values in filter template, and σ is Gaussian Distribution Parameters.In the present embodiment, it is Gaussian filter radius that σ can be preferably 1.00 ~ 1.67, r, and r can be preferably 3 ~ 8.
Use separable Gaussian filter to carry out threshold decision to original image and original image can be made to convert the form of picture to the effect that original image carries out filtering after convolution, also colored color lump effect fuzzy after making its generation be similar to color cluster, and the blur effect due to colored color lump makes color have the effect of the flowing of water, and this algorithm can make color lump automatically leave a blank, form colored empty saturating sensation.
Step S106, carries out rim detection to blurred picture, generates edge image.
Namely rim detection obtains brightness in image and changes obvious pixel, changes obvious pixel generate edge image according to this brightness.
In one embodiment, rim detection can be carried out according to Prewitt operator to blurred picture.
Prewitt operator is a kind of edge detection operator of first differential, and it carries out in image space utilization orientation template and image, and neighborhood convolution come, and usually adopts horizontal direction template detection horizontal edge and adopts vertical direction template detection vertical edge.Feel at color lump and the sideline between leaving a blank to build watercolor, therefore Prewitt operator here adopts 8 direction templates to carry out rim detection to blurred picture, wherein:
0 ° of direction template can be:
45 ° of direction templates can be:
90 ° of direction templates can be:
135 ° of direction templates can be:
180 ° of direction templates can be:
225 ° of direction templates can be:
270 ° of direction templates can be:
315 ° of direction templates can be:
Step S108, edge image carries out inverse process, generates inverse image.
Inverse process is by the pixel value negate of pixel in edge image, and the pixel value namely deducting pixel with 255 obtains the gray-scale value of the pixel after inverse process.
Step S110, carries out Alpha to blurred picture and inverse image and mixes, and generates watercolor style image.
In one embodiment, carry out to blurred picture and inverse image the step that Alpha mixes can be specially according to formula:
Generate watercolor style image; Wherein, i, j are the pixel coordinate of pixel in image, C
i,jfor the watercolor style image generated, α is mixed transparent degree, B
i,jfor blurred picture, F
i,jfor inverse image.
In one embodiment, the step that Alpha mixes is carried out to blurred picture and inverse image before also can improve the brightness of blurred picture.Preferably, the brightness of blurred picture can be improved 5 to 15.
In one embodiment, also by gaussian filtering, noise reduction process is carried out to watercolor style image after generating the step of watercolor style image.
In the present embodiment, a, b component of Gaussian template to the Lab space of watercolor style image can be used to carry out gaussian filtering, and filter radius can be preferably 3 to 6.
After carrying out noise reduction process to watercolor style image, that can remove in colored color lump is variegated, makes color lump more bright-coloured, thus forms agile, the transparent free and natural watercolor effect of rich color.
In one embodiment, also can obtain the GPU (GraphicProcessingUnit of OpenGL, Direct3D or OpenGLES (a kind of graphics process interface), graph processing chips) interface function, perform above-mentioned steps S104, step S106, step S108 and step S110 by interface function.
The Graphics Processing Unit of GPU and video card.Because GPU has more computing unit relative to CPU (CentralProcessingUnit, CPU (central processing unit)), therefore in parallel computation, there is speed advantage, thus improve processing speed.
As shown in Figures 2 and 3, Fig. 2 is the design sketch of original image, and Fig. 3 is the watercolor style image design sketch obtained through above-mentioned steps.As seen from Figure 3, the image of generation has typical watercolor artistic effect.
In one embodiment, as shown in Figure 4, a kind of device generating watercolor style image comprises: original image acquisition module 102, blurred picture generation module 104, edge image generation module 106, inverse Computer image genration module 108 and image blend module 110.Wherein:
Original image acquisition module 102, for obtaining original image.
Namely original image needs the image of the artistic special efficacy of it being added to watercolor style.In one embodiment, can monitor the event of taking pictures of intelligent terminal, when capturing the event of taking pictures of intelligent terminal, automatic acquisition takes pictures the photo that obtains as original image.
Blurred picture generation module 104, for carrying out Fuzzy Processing to original image, generates blurred picture.
Fuzzy Processing is carried out to original image, namely by image blurring wave filter, filtering is carried out to original image.
In one embodiment, blurred picture generation module 104 can be used for carrying out Gaussian Blur generation blurred picture to original image.
In the present embodiment, blurred picture generation module 104 can be used for by using separable Gaussian filter to carry out threshold decision to original image and carrying out filtering to original image after convolution.
Separable Gaussian filter is:
Wherein, G (r) is the weighting coefficient values in filter template, and σ is Gaussian Distribution Parameters.In the present embodiment, it is Gaussian filter radius that σ can be preferably 1.00 ~ 1.67, r, and r can be preferably 3 ~ 8.
Use separable Gaussian filter to carry out threshold decision to original image and original image can be made to convert the form of picture to the effect that original image carries out filtering after convolution, also colored color lump effect fuzzy after making its generation be similar to color cluster, and the blur effect due to colored color lump makes color have the effect of the flowing of water, and this algorithm can make color lump automatically leave a blank, form colored empty saturating sensation.
Edge image generation module 106, for carrying out rim detection to blurred picture, generates edge image.
Namely rim detection obtains brightness in image and changes obvious pixel, changes obvious pixel generate edge image according to this brightness.
In one embodiment, edge image generation module 106 can be used for carrying out rim detection according to Prewitt operator to blurred picture.
Prewitt operator is a kind of edge detection operator of first differential, and it carries out in image space utilization orientation template and image, and neighborhood convolution come, and usually adopts horizontal direction template detection horizontal edge and adopts vertical direction template detection vertical edge.Feel at color lump and the sideline between leaving a blank to build watercolor, therefore Prewitt operator here adopts 8 direction templates to carry out rim detection to blurred picture, wherein:
0 ° of direction template can be:
45 ° of direction templates can be:
90 ° of direction templates can be:
135 ° of direction templates can be:
180 ° of direction templates can be:
225 ° of direction templates can be:
270 ° of direction templates can be:
315 ° of direction templates can be:
Inverse Computer image genration module 108, carries out inverse process for edge image, generates inverse image.
Inverse process is by the pixel value negate of pixel in edge image, and the pixel value namely deducting pixel with 255 obtains the gray-scale value of the pixel after inverse process.
Image blend module 110, mixes for carrying out Alpha to blurred picture and inverse image, generates watercolor style image.
In one embodiment, image blend module 110 can be used for according to formula:
Generate watercolor style image; Wherein, i, j are the pixel coordinate of pixel in image, C
i,jfor the watercolor style image generated, α is mixed transparent degree, B
i,jfor blurred picture, F
i,jfor inverse image.
In one embodiment, image blend module 110 is also used in the brightness of carrying out improving before Alpha mixes blurred picture to blurred picture and inverse image.Preferably, the brightness of blurred picture can be improved 5 to 15.
In one embodiment, as shown in Figure 5, the device generating watercolor style image also comprises image noise reduction module 112, for carrying out noise reduction process by gaussian filtering to watercolor style image.
In the present embodiment, image noise reduction module 112 can be used for using a, b component of Gaussian template to the Lab space of watercolor style image to carry out gaussian filtering, and filter radius can be preferably 3 to 6.
After carrying out noise reduction process to watercolor style image, that can remove in colored color lump is variegated, makes color lump more bright-coloured, thus forms agile, the transparent free and natural watercolor effect of rich color.
In one embodiment, the device generating pencil drawing style image also can comprise GPU interface function acquisition module (not indicating in figure), for obtaining GPU (GraphicProcessingUnit, the graph processing chips) interface function of OpenGL, Direct3D or OpenGLES (a kind of graphics process interface).Blurred picture generation module 104, edge image acquisition module 106, inverse Computer image genration module 108 and image blend module 110 can be used for performing above-mentioned function by this interface function.
The Graphics Processing Unit of GPU and video card.Because GPU has more computing unit relative to CPU (CentralProcessingUnit, CPU (central processing unit)), therefore in parallel computation, there is speed advantage, thus improve processing speed.
As shown in Figures 2 and 3, Fig. 2 is the design sketch of original image, and Fig. 3 is the watercolor style image design sketch obtained through above-mentioned steps.As seen from Figure 3, the image of generation has typical watercolor artistic effect.
The method of above-mentioned generation watercolor style image and device, only done the operations such as Fuzzy Processing, rim detection, inverse process and image blend to image, aforesaid operations is linear calculating, and therefore calculated amount is less, thus improves processing speed.
Simultaneously, the photo that one width can be taken at PC end or mobile intelligent terminal by the present invention generates a width watercolor style image fast automaticly, efficiently solve Problems existing in conventional art, and its can also also can be fast automatic in the relatively poor intelligent terminal of hardware environment process.Watercolor style final effect shows and enriches agile color effect and transparent free and natural visual experience.
The above embodiment only have expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but therefore can not be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.
Claims (8)
1. generate a method for watercolor style image, comprising:
Obtain original image;
Fuzzy Processing is carried out to described original image, generates blurred picture;
Rim detection is carried out to described blurred picture, generates edge image;
Inverse process is carried out to described edge image, generates inverse image;
Carry out Alpha to described blurred picture with described inverse image to mix, generate watercolor style image, be specially: according to formula:
Generate watercolor style image; Wherein, i, j are the pixel coordinate of pixel in image, C
i,jfor the watercolor style image generated, α is mixed transparent degree, B
i,jfor described blurred picture, F
i,jfor described inverse image.
2. the method for generation watercolor style image according to claim 1, is characterized in that, described the step that Alpha mixes is carried out to described blurred picture and described inverse image before also comprise:
Improve the brightness of described blurred picture.
3. the method for generation watercolor style image according to claim 1, is characterized in that, also comprises after the step of described generation watercolor style image:
By gaussian filtering, noise reduction process is carried out to described watercolor style image.
4. the method for generation watercolor style image according to claim 1, is characterized in that, describedly to the step that described blurred picture carries out rim detection is:
According to Prewitt operator, rim detection is carried out to described blurred picture.
5. generate a device for watercolor style image, it is characterized in that, comprising:
Original image acquisition module, for obtaining original image;
Blurred picture generation module, for carrying out Fuzzy Processing to described original image, generates blurred picture;
Edge image generation module, for carrying out rim detection to described blurred picture, generates edge image;
Inverse Computer image genration module, for carrying out inverse process to described edge image, generates inverse image;
Image blend module, mixes for carrying out Alpha to described blurred picture with described inverse image, generates watercolor style image, is specially: according to formula:
Generate watercolor style image; Wherein, i, j are the pixel coordinate of pixel in image, C
i,jfor the watercolor style image generated, α is mixed transparent degree, B
i,jfor described blurred picture, F
i,jfor described inverse image.
6. the device of generation watercolor style image according to claim 5, is characterized in that, described image blend module also can be used for the brightness improving described blurred picture.
7. the device of generation watercolor style image according to claim 5, is characterized in that, described device also comprises image noise reduction module, for carrying out noise reduction process by gaussian filtering to described watercolor style image.
8. the device of generation watercolor style image according to claim 5, is characterized in that, described edge image generation module is also for carrying out rim detection according to Prewitt operator to described blurred picture.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310037570.3A CN103093417B (en) | 2013-01-30 | 2013-01-30 | Generate method and the device of watercolor style image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310037570.3A CN103093417B (en) | 2013-01-30 | 2013-01-30 | Generate method and the device of watercolor style image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103093417A CN103093417A (en) | 2013-05-08 |
CN103093417B true CN103093417B (en) | 2016-01-06 |
Family
ID=48205953
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310037570.3A Expired - Fee Related CN103093417B (en) | 2013-01-30 | 2013-01-30 | Generate method and the device of watercolor style image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103093417B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103729829A (en) * | 2013-12-13 | 2014-04-16 | 深圳市云宙多媒体技术有限公司 | Rendering method and device for color image line drawing |
CN105096360A (en) * | 2015-08-27 | 2015-11-25 | 深圳市云宙多媒体技术有限公司 | Image non-photorealistic highlight water color rendering method and apparatus |
CN105227865B (en) * | 2015-10-29 | 2019-04-26 | 努比亚技术有限公司 | A kind of image processing method and terminal |
CN108573506B (en) * | 2017-03-13 | 2021-12-17 | 北京贝塔科技股份有限公司 | Image processing method and system |
CN109741248B (en) * | 2018-12-29 | 2023-06-13 | 深圳美图创新科技有限公司 | Watercolour style drawing method and device |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8296668B1 (en) * | 2008-08-15 | 2012-10-23 | Adobe Systems Incorporated | Paper texture for watercolor painting effects in a graphics editing program |
-
2013
- 2013-01-30 CN CN201310037570.3A patent/CN103093417B/en not_active Expired - Fee Related
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8296668B1 (en) * | 2008-08-15 | 2012-10-23 | Adobe Systems Incorporated | Paper texture for watercolor painting effects in a graphics editing program |
Also Published As
Publication number | Publication date |
---|---|
CN103093417A (en) | 2013-05-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103093437B (en) | Generate the method and device of pencil drawing style image | |
CN103093417B (en) | Generate method and the device of watercolor style image | |
CN102663766B (en) | Non-photorealistic based art illustration effect drawing method | |
CN105374007B (en) | Merge the pencil drawing generation method and device of skeleton stroke and textural characteristics | |
CN103116898B (en) | Generate method and the device of ink and wash style image | |
CN102332170B (en) | Method and system for generating computer sketch images | |
CN104063888B (en) | A kind of wave spectrum artistic style method for drafting based on feeling of unreality | |
CN103021002B (en) | Colored sketch image generating method | |
CN102404594B (en) | 2D-to-3D conversion method based on image edge information | |
CN106952222A (en) | A kind of interactive image weakening method and device | |
CN103745430B (en) | Rapid beautifying method of digital image | |
CN103035019B (en) | Image processing method and device | |
CN104282002A (en) | Quick digital image beautifying method | |
CN102663788A (en) | Pen light-colored artistic effect drawing method based on unreality feeling | |
CN103208104B (en) | A kind of image de-noising method based on nonlocal theory | |
CN103914862A (en) | Pencil sketch simulating method based on edge tangent stream | |
CN103826032A (en) | Depth map post-processing method | |
CN104200505A (en) | Cartoon-type animation generation method for human face video image | |
CN104657941A (en) | Image edge self-adaptive enhancing method and device | |
CN103455974A (en) | Image sketching style processing method | |
CN103400340A (en) | Method for converting picture into cartoon | |
CN107845127A (en) | A kind of human face cartoon animation image design method | |
CN104715454A (en) | Anti-aliasing graph overlapping algorithm | |
CN106204418A (en) | Image warping method based on matrix inversion operation in a kind of virtual reality mobile terminal | |
CN111524204B (en) | Portrait hair cartoon texture generation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160106 Termination date: 20190130 |