CN101540055B - Cartoon stylization method facing online real-time application - Google Patents

Cartoon stylization method facing online real-time application Download PDF

Info

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
array
sigma
bidirectional
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
Application number
CN2009100976408A
Other languages
Chinese (zh)
Other versions
CN101540055A (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.)
INSIGMA GROUP CO Ltd
Zhejiang University ZJU
Original Assignee
INSIGMA GROUP CO Ltd
Zhejiang University ZJU
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 INSIGMA GROUP CO Ltd, Zhejiang University ZJU filed Critical INSIGMA GROUP CO Ltd
Priority to CN2009100976408A priority Critical patent/CN101540055B/en
Publication of CN101540055A publication Critical patent/CN101540055A/en
Application granted granted Critical
Publication of CN101540055B publication Critical patent/CN101540055B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了一种面向在线实时应用的卡通风格化方法。该方法的步骤如下:利用迭代双向滤波对图像进行边缘锐化处理; 在迭代双向滤波的处理结果上,使用高斯-拉普拉斯方法的实时化实现进行边缘检测,以获得素描效果;在迭代双向滤波的处理结果上进行量化,以获得油画效果;将边缘检测和量化的结果进行结合,以获得卡通化效果。本发明与传统方法相比,能获得更快的速度和更好的视觉效果,在视频聊天、游戏等实时性要求很高的应用场合对人脸和景物都获得了良好的效果,并且扩展了视频卡通风格化的应用领域。

Figure 200910097640

The invention discloses a cartoon stylization method oriented to online real-time application. The steps of the method are as follows: use iterative bidirectional filtering to sharpen the image; on the processing result of iterative bidirectional filtering, use the real-time implementation of the Gaussian-Laplace method to perform edge detection to obtain a sketch effect; Quantize the processing results of bidirectional filtering to obtain oil painting effects; combine the results of edge detection and quantization to obtain cartoon effects. Compared with the traditional method, the present invention can obtain faster speed and better visual effects, and obtain good effects on human faces and scenes in applications such as video chatting and games with high real-time requirements, and expand the The field of application of video cartoon stylization.

Figure 200910097640

Description

Cartoon stylization method towards online real-time application
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:
r 0 = &Sigma; | x - x 0 | < = s f ( x , x 0 ) &CenterDot; I ( p 0 ) &Sigma; | x - x 0 | < = s f ( x , x 0 ) - - - ( 1 )
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:
g ( t , &sigma; ) = 1 &sigma; 2 &pi; e - t 2 2 &sigma; 2 - - - ( 3 )
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:
| x - x 0 | &le; s | I ( p ) - I ( p 0 ) | &le; 255 - - - ( 4 )
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:
D ( x , y , &sigma; d ) = ( 1 - k &CenterDot; x 2 + y 2 &sigma; d 2 ) e x 2 + y 2 2 &CenterDot; &sigma; d 2 - - - ( 5 )
Wherein k to make the mask coefficient and approach 0, promptly k satisfies:
&Sigma; x = - N - 1 2 N - 1 2 &Sigma; y = - N - 1 2 N - 1 2 ( 1 - k &CenterDot; x 2 + y 2 &sigma; d 2 ) e x 2 + y 2 2 &CenterDot; &sigma; d 2 = 0 - - - ( 6 )
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:
T = ( N + 1 2 + ( N + 1 2 - 1 ) + . . . + 1 ) = ( N + 1 ) ( N + 3 ) 8 - - - ( 7 )
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:
0 &le; i &le; ( N + 1 ) ( N + 3 ) 8 0 &le; j &le; 255 - - - ( 9 )
3. the conventional quantization method has been carried out the lifting on the speed.Quantizing equation is defined as:
Figure G2009100976408D00036
Q wherein ClosestBe to approach p most 0The quantification edge of gray-scale value, Δ q is a quantization width,
Figure G2009100976408D00037
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:
r 0 = &Sigma; | x - x 0 | < = s f ( x , x 0 ) &CenterDot; I ( p 0 ) &Sigma; | x - x 0 | < = s f ( x , x 0 ) - - - ( 1 )
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:
( t , &sigma; ) 1 &sigma; 2 &pi; e - t 2 2 &sigma; 2 - - - ( 3 )
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:
| x - x 0 | &le; s | I ( p ) - I ( p 0 ) | &le; 255 - - - ( 4 )
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,
Figure FSB00000400108400015
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.
CN2009100976408A 2009-04-13 2009-04-13 Cartoon stylization method facing online real-time application Expired - Fee Related CN101540055B (en)

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 (9)

* Cited by examiner, † Cited by third party
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
CN111815659B (en) * 2020-06-08 2024-10-22 北京美摄网络科技有限公司 Image processing method, device, electronic equipment and computer readable storage medium

Citations (3)

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

Patent Citations (3)

* Cited by examiner, † Cited by third party
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
Zhang et al. Learning deep CNN denoiser prior for image restoration
Zhang et al. Rolling guidance filter
Matakos et al. Accelerated edge-preserving image restoration without boundary artifacts
CN102968772B (en) A kind of image defogging method capable based on dark channel information
CN105374007B (en) Merge the pencil drawing generation method and device of skeleton stroke and textural characteristics
CN102800063B (en) Image Enhancement and Abstraction Method Based on Anisotropic Filtering
CN104715461B (en) Image de-noising method
CN103116875B (en) Self-adaptation bilateral filtering image de-noising method
CN104166967B (en) Method for improving definition of video image
JP2017091529A (en) Method for upscaling noisy images, and apparatus for upscaling noisy images
CN102254333B (en) Image-based ink painting style image generation method
CN102800054B (en) Image blind deblurring method based on sparsity metric
CN107256539A (en) A kind of image sharpening method based on local contrast
CN105427262A (en) Image de-noising method based on bidirectional enhanced diffusion filtering
CN101877122A (en) Anisotropic diffusion image denoising enhancement method with controllable diffusion degree
CN101261678B (en) A method for normalizing face light on feature image with different size
CN103400359A (en) Real-time color image filtering method based on nonlocal domain transformation
CN103310414B (en) Based on direction wave conversion and the image enchancing method of fuzzy theory
CN101986345B (en) Image deblurring method
CN103208103B (en) A kind of enhancement method of low-illumination image based on GPU
CN102800055B (en) Low-order decomposition method for blind deblurring of images
CN104517266B (en) Mixed self-adapting image de-noising method based on edge detection operator
CN103996179B (en) Fast real-time image enhancement method based on single-scale Retinex
CN103700077A (en) Human visual characteristic-based adaptive image enhancement 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
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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20110504

Termination date: 20200413