CN101540055B - Cartoon stylization method facing online real-time application - Google Patents
Cartoon stylization method facing online real-time application Download PDFInfo
- Publication number
- CN101540055B CN101540055B CN2009100976408A CN200910097640A CN101540055B CN 101540055 B CN101540055 B CN 101540055B CN 2009100976408 A CN2009100976408 A CN 2009100976408A CN 200910097640 A CN200910097640 A CN 200910097640A CN 101540055 B CN101540055 B CN 101540055B
- Authority
- CN
- China
- Prior art keywords
- filtering
- cartoon
- effect
- array
- sigma
- 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
- 238000000034 method Methods 0.000 title claims abstract description 25
- 238000001914 filtration Methods 0.000 claims abstract description 28
- 230000002457 bidirectional effect Effects 0.000 claims abstract description 20
- 230000000694 effects Effects 0.000 claims abstract description 15
- 238000013139 quantization Methods 0.000 claims abstract description 6
- 239000003973 paint Substances 0.000 claims abstract description 4
- 238000001514 detection method Methods 0.000 claims description 10
- 238000011002 quantification Methods 0.000 claims description 4
- 239000004576 sand Substances 0.000 claims description 4
- 238000003708 edge detection Methods 0.000 abstract description 6
- 230000000007 visual effect Effects 0.000 abstract description 4
- 230000003068 static effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000009792 diffusion process Methods 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a cartoon stylization method facing online real-time application. The method comprises the following steps of: utilizing iterative bidirectional filtering to carry out edge sharpening processing to an image; on the processing result of iterative bidirectional filtering, using the real time implementation of a Gauss-Laplace method to carry out edge detection so as to obtain sketch effect; carrying out quantization on the processing result of iterative bidirectional filtering so as to obtain oil paint effect; and carrying out combination to the results of edge detection and quantization so as to obtain cartoon effect. Compared with the traditional method, the cartoon stylization method can obtain faster speed and better visual effect, obtain good effect to the face and scenery in application occasions with high real-time requirement, such as video chat, games and the like, and expand the application field of video cartoon stylization.
Description
Technical field
The present invention relates to real-time multimedia treatment technology, particularly relate to a kind of cartoon stylization method towards online real-time application.
Background technology
At present, various stylized special efficacys are applied to Online Video chat occasion, strengthen the image of entertainment effect or change oneself.Such special efficacy has had some realizations in the middle of the USB webcam driver of the MSN of Microsoft Messenger, sieve skill.Is the abstract method for cartoon, animation style of reality one of stylized system, is commonly called cartoon styleization.It has attracted to pay close attention to widely recently.
The application scenario of cartoon style system is divided into two classes, and a class is to handle the cartoon style system of static images, and another kind of is the cartoon style system that handles video.For the cartoon style system of traditional processing static images, they are very low to the requirement of real-time, so they are not suitable for video is handled in real time.And for the cartoon style system of in the past processing video, there are two problems.One is that travelling speed is still slower, is not suitable for the application that real-times such as Online Video chat are had relatively high expectations; Another is because the edge detection results of successive frame differs greatly, and causes visual effect undesirable.
As previously mentioned, because the Online Video chat is had higher requirement to the real-time of cartoon style system, therefore need carry out processing such as edge sharpening, rim detection and quantification at image and improve, thereby obtain faster speed and better visual effect.
Summary of the invention
Carry out problems such as edge sharpening, rim detection and quantification treatment in order to solve image, the object of the present invention is to provide a kind of cartoon stylization method towards online real-time application.
The technical solution used in the present invention is:
(1) utilizing iterative bidirectional filtering that image is carried out edge sharpening handles;
(2) on processing result of iterative bidirectional filtering, use the real time implementation of Gauss-Laplace method to realize carrying out rim detection, to obtain sketch effect;
(3) on processing result of iterative bidirectional filtering, quantize, to obtain oil paint effect;
(4) result with rim detection and color quantizing carries out combination, to obtain cartoon effect.
The beneficial effect that the present invention has is:
At first, improved edge detection algorithm speed is fast, and the visual effect in successive frame surpassed the edge detection method that other use fixed thresholds, such as the Canny operator.Secondly, in cataloged procedure, marginal date is separated with quantized data, thereby improved code efficiency, reduce code check.At last, based on the real-time video stylization, the present invention is suitable for the application of high real-time requirement.
In the process of video stylization, rim detection is the highest part of computation complexity.In this step, process of the present invention has adopted improving one's methods based on Gauss-Laplce.Except edge detection method faster, the present invention adopts the mode of tabling look-up to obtain filter factor and quantized value in prolonging nonlinear diffusion and color quantizing process.This processing mode can be avoided calculating Gauss equation into each pixel, thereby further accelerates the speed of whole stylizing method.
Description of drawings
Accompanying drawing is treatment effect figure of the present invention.
Embodiment
The present invention includes following four big steps, as shown in drawings:
(1) utilizing iterative bidirectional filtering that image is carried out edge sharpening handles;
(2) on processing result of iterative bidirectional filtering, use the real time implementation of Gauss-Laplace method to realize carrying out rim detection, to obtain sketch effect;
(3) on processing result of iterative bidirectional filtering, quantize, to obtain oil paint effect;
(4) result with rim detection and color quantizing carries out combination, to obtain cartoon effect.
Concrete steps are as follows:
In the image the higher fringe region of contrast by sharpening, and lower regional smoothed of contrast; On the one-dimensional space, bidirectional filtering can be represented with following formula:
X wherein
0Be central point p
0Ordinate or horizontal ordinate, x is the ordinate or the horizontal ordinate of point in the filter window around the central point, s is the distance of central point to the filter window edge, I (p
0) be p
0Gray-scale value, r
0Be p
0The filtering result; F (x, x
0) be p
0Bidirectional filter on every side is defined as:
f(x,x
0)=g
s(x-x
0,σ
s)·g
t(I(p)-I(p
0),σ
t)(2)
σ wherein
sAnd σ
tBe the space and the tone ratio of bidirectional filtering;
g
sAnd g
tBe important space and tone weight coefficient, be defined as by Gauss equation:
The one dimension bidirectional filtering is applied on first dimension space; Intermediate result is carried out filtering on second dimension space, can reduce computation complexity greatly like this.
Consider the parameter in formula (1) and (2), the field of definition of input parameter is:
The filter window size is set to 9 * 9; Therefore two-dimensional array of initialization has wherein been preserved all possible corresponding filtering result according to input parameter; The size of array is 4 * 256; Only need obtain in the array when then image being carried out filtering operation | x-x
0| row, the | I (p)-I (p
0) | the data of row.
2. utilize the circulation symmetry characteristic of Gauss-Laplace's equation, made the size of question blank control within the acceptable range;
Discrete Gauss-Laplce's mask is defined as:
Wherein k to make the mask coefficient and approach 0, promptly k satisfies:
Because the circulation symmetry characteristic of Gauss-Laplace's equation, the coefficient array of mask can be represented with table 1; W (i) represents Gauss-Laplce's mask numerical value; The size of this array is:
Therefore the question blank of Gauss-Laplce's mask can be expressed as:
LUT[i][j]=w(i)×j (8)
Wherein i is the position of mask, and j is the gray-scale value that will carry out the point of Gauss-Laplce's mask.The field of definition of i and j can be expressed as:
3. the conventional quantization method has been carried out the lifting on the speed.Quantizing equation is defined as:
Q wherein
ClosestBe to approach p most
0The quantification edge of gray-scale value, Δ q is a quantization width,
It is the parameter of the sharp-pointed degree in control edge;
Similar with bidirectional filtering, quantizing the unique parameter of equation is I (p
0); Field of definition is:
0≤I(p
0)≤255(11)
Therefore one-dimension array of initialization is preserved all possible quantized result; The size of this array is 256; By simply obtaining I (p in the array
0) individual value obtains a p immediately
0Quantized value.
4. 2 and 3 result is carried out combination: rim detection is the position that has the edge, and then the value of capture vegetarian refreshments is 0; Otherwise the value of capture vegetarian refreshments is color quantizing result's a value.
Claims (2)
1. cartoon stylization method towards online real-time application is characterized in that:
(1) utilizing iterative bidirectional filtering that image is carried out edge sharpening handles;
(2) on processing result of iterative bidirectional filtering, use the real time implementation of Gauss's one Laplace method to realize carrying out rim detection, to obtain sketch effect;
(3) on processing result of iterative bidirectional filtering, quantize, to obtain oil paint effect;
(4) result with rim detection and color quantizing carries out combination, to obtain cartoon effect;
The fringe region that contrast is high in the image in the described step (1) is by sharpening, and low regional smoothed of contrast; On the one-dimensional space, bidirectional filtering is represented with following formula:
Wherein: x
0Be central point p
0Ordinate or horizontal ordinate, x is the ordinate or the horizontal ordinate of point in the filter window around the central point, s is the distance of central point to the filter window edge, I (p
0) be p
0Gray-scale value, r
0Be p
0The filtering result; F (x, x
0) be p
0Bidirectional filter on every side is defined as:
f(x,x
0)=g
s(x-x
0,σ
s)·g
t(I(p)-I(p
0),σ
t) (2)
Wherein: σ
sAnd σ
tBe the space and the tone ratio of bidirectional filtering;
g
sAnd g
tBe important space and tone weight coefficient, be defined as by Gauss equation:
The one dimension bidirectional filtering is applied on first dimension space; Intermediate result is carried out filtering on second dimension space, can reduce computation complexity greatly like this;
Consider the parameter in formula (1) and (2), the field of definition of input parameter is:
The filter window size is set to 9 * 9; Therefore two-dimensional array of initialization has wherein been preserved all possible corresponding filtering result according to input parameter; The size of array is 4 * 256; Only need obtain in the array when then image being carried out filtering operation | x-x
0| row, the | I (p)-I (p
0) | the data of row.
2. a kind of cartoon stylization method towards online real-time application according to claim 1 is characterized in that: the quantization method in the described step (3) has carried out the lifting on the speed; Quantizing equation is defined as:
Q wherein
ClosestBe to approach p most
0The quantification edge of gray-scale value, Δ q is a quantization width,
It is the parameter of the sharp-pointed degree in control edge;
Similar with bidirectional filtering, quantizing the unique parameter of equation is I (p
0); Field of definition is:
0≤I(p
0)≤255
Therefore one-dimension array of initialization is preserved all possible quantized result; The size of this array is 256; By simply obtaining I (p in the array
0) individual value obtains a p immediately
0Quantized value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100976408A CN101540055B (en) | 2009-04-13 | 2009-04-13 | Cartoon stylization method facing online real-time application |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100976408A CN101540055B (en) | 2009-04-13 | 2009-04-13 | Cartoon stylization method facing online real-time application |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101540055A CN101540055A (en) | 2009-09-23 |
CN101540055B true CN101540055B (en) | 2011-05-04 |
Family
ID=41123228
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009100976408A Expired - Fee Related CN101540055B (en) | 2009-04-13 | 2009-04-13 | Cartoon stylization method facing online real-time application |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101540055B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102074025B (en) * | 2009-11-23 | 2013-01-23 | 中国移动通信集团公司 | Image stylized drawing method and device |
CN101853517B (en) * | 2010-05-26 | 2011-11-16 | 西安交通大学 | Real image oil painting automatic generation method based on stroke limit and texture |
CN102289831B (en) * | 2011-09-27 | 2013-07-31 | 深圳万兴信息科技股份有限公司 | Method and system for generating color pencil drawings |
CN102592295B (en) * | 2011-12-21 | 2015-08-19 | 深圳万兴信息科技股份有限公司 | A kind of method and apparatus of image procossing |
CN103366390B (en) * | 2012-03-29 | 2016-04-06 | 展讯通信(上海)有限公司 | terminal and image processing method and device |
CN105227865B (en) * | 2015-10-29 | 2019-04-26 | 努比亚技术有限公司 | A kind of image processing method and terminal |
CN107749045A (en) * | 2017-09-21 | 2018-03-02 | 北京麒麟合盛网络技术有限公司 | The sketch processing method and sketch filter of a kind of image |
CN110636331B (en) * | 2019-09-26 | 2022-08-09 | 北京百度网讯科技有限公司 | Method and apparatus for processing video |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1316723A (en) * | 1999-09-24 | 2001-10-10 | 任天堂株式会社 | Method and device for providing cartoon outline in three-D video image system |
CN1672175A (en) * | 2002-07-23 | 2005-09-21 | 株式会社日立医药 | Image processing device |
CN1892696A (en) * | 2005-07-08 | 2007-01-10 | 深圳迈瑞生物医疗电子股份有限公司 | Supersonic image edge-sharpening and speck-inhibiting method |
-
2009
- 2009-04-13 CN CN2009100976408A patent/CN101540055B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1316723A (en) * | 1999-09-24 | 2001-10-10 | 任天堂株式会社 | Method and device for providing cartoon outline in three-D video image system |
CN1672175A (en) * | 2002-07-23 | 2005-09-21 | 株式会社日立医药 | Image processing device |
CN1892696A (en) * | 2005-07-08 | 2007-01-10 | 深圳迈瑞生物医疗电子股份有限公司 | Supersonic image edge-sharpening and speck-inhibiting method |
Also Published As
Publication number | Publication date |
---|---|
CN101540055A (en) | 2009-09-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101540055B (en) | Cartoon stylization method facing online real-time application | |
CN101452575B (en) | Image self-adapting enhancement method based on neural net | |
Zhang et al. | Rolling guidance filter | |
CN106530237A (en) | Image enhancement method | |
CN102314673B (en) | Self-adapting image enhancement method | |
EP2806395B1 (en) | Color enhancement method and device | |
CN108921800A (en) | Non-local mean denoising method based on form adaptive search window | |
CN104285239B (en) | Image processing apparatus, image processing method and printed medium | |
CN103093433B (en) | Natural image denoising method based on regionalism and dictionary learning | |
CN103020918B (en) | Shape-adaptive neighborhood mean value based non-local mean value denoising method | |
CN102254333B (en) | Image-based method for generating ink painting style image | |
US9262810B1 (en) | Image denoising using a library of functions | |
CN104574293A (en) | Multiscale Retinex image sharpening algorithm based on bounded operation | |
CN105046658A (en) | Low-illumination image processing method and device | |
CN104182947A (en) | Low-illumination image enhancement method and system | |
CN104166967A (en) | Method for improving definition of video image | |
CN102800054B (en) | Image blind deblurring method based on sparsity metric | |
CN104021523A (en) | Novel method for image super-resolution amplification based on edge classification | |
CN109003287A (en) | Image partition method based on improved adaptive GA-IAGA | |
CN102800055B (en) | Low-order decomposition method for blind deblurring of images | |
CN108095756A (en) | A kind of super-resolution plane wave ultrasonic imaging method based on SOFI | |
CN102226917A (en) | Image enhancement method based on nonsubsampled contourlet diffusion | |
CN102637294A (en) | Image enhancement method based on non-down-sampling Contourlet transform and improved total variation | |
CN101655973A (en) | Image enhancing method based on visual characteristics of human eyes | |
CN102750679B (en) | Blind deblurring method for image quality evaluation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C41 | Transfer of patent application or patent right or utility model | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20091218 Address after: 38, Da Da Lu, Xihu District, Zhejiang, Hangzhou Province, China: 310027 Applicant after: Zhejiang University Co-applicant after: INSIGMA GROUP CO., LTD. Address before: 38, Da Da Lu, Xihu District, Zhejiang, Hangzhou Province, China: 310027 Applicant before: Zhejiang University |
|
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20110504 Termination date: 20200413 |
|
CF01 | Termination of patent right due to non-payment of annual fee |