摘要
非真实感绘制是计算机图像学的一类,在动画、艺术等领域有着广泛的应用,而漫画作为一种具有特殊代表性的艺术表现形式受越来越多人欢迎。
漫画的建图、描线、上色等操作都需要人来进行操作,消耗人力和物力。本论文以实现图像的漫画效果为目的,通过使用matlab对图像进行处理,简要阐述了开发背景与环境,在保证图像核心结构不改变的情况下进行以下几个操作:
1根据需求,选择双边滤波器对图像进行滤波,达到去除噪声,提高图像质量方便特征提取的目的。
2分别对RGB颜色空间和Lab颜色空间进行比较,选择更合适的进行量化处理,,减少图像中的颜色。
3根据边缘完整性和速度的需求,选择DOG算子进行边缘检测,对边缘强度进行加强、开闭运算等操作,最后使图像具有漫画效果,实现非真实感绘制,与现有的其他相似方法进行比较,总结该方法达到了漫画效果。
关键词: 非真实感绘制 双边滤波 颜色量化 边缘检测
Ⅰ
ABSTRACT
Non-photorealistic rendering is one types of computer iconography,it is widely used in the field of animation, art and other fields. Cartoon, as a special representative of an artistic form, is welcomed by more and more people.
Due to the demands of Cartoon,which human beings is needed to work on build pictures, Drawing Lines, color, this is the waste of the manpower and the physical resource. Aiming at make the photo to be cartoon, this paper briefly describes the development background and environment of the way to deal with photos by matlab. Perform the following operations while ensuring the image without changing the core structure of the case:
1. Based on needs, a bilateral filter to select the image is filtered, in order to remove noise and improve image quality for the purpose of convenience feature extraction.
2. By comparing withe RGB color space and Lab color space, choose the better one to achieve color quantization,and reduce the colors in the image.
3. According to the needs of marginal integrity and speed, Dog operator is used to do edge detection, then make the edge stronger and use imopen and imclose. Finally to make the image seems to be cartoon, and realize of non-photorealistic rendering. Compare with other existing similar methods, we can sum up that this paper achieve making the photo to be cartoon.
Keywords: Non-photorealistic rendering, Bilateral filter, Color quantization, edge detection.
Ⅱ
目录
目录
摘要 ....................................................................................................................................................... Ⅰ ABSTRACT .............................................................................................................................................. Ⅱ 目录 ......................................................................................................................................................... 1 第一章 绪论 ........................................................................................................................................... 3 1.1研究背景 ....................................................................................................................................... 3 1.2国内外研究状况 ........................................................................................................................... 4 1.3研究意义 ....................................................................................................................................... 6 第二章 漫画效果图像处理 ................................................................................................................... 7 2.1漫画效果分析 ............................................................................................................................... 7 2.2漫画效果流程图 ......................................................................................................................... 7 第三章 双边滤波 ................................................................................................................................... 8 3.1工具介绍 ....................................................................................................................................... 9 3.1.1Matlab简介 ............................................................................................................................ 9 3.1.2Matlab优点 ............................................................................................................................ 9 3.2滤波器简介及选择 ..................................................................................................................... 10 3.3双边滤波原理 ............................................................................................................................. 11 3.4实现双边滤波 ............................................................................................................................. 13 3.5小结 ............................................................................................................................................. 13 第四章 颜色量化 ................................................................................................................................. 15 4.1量化选择 ..................................................................................................................................... 15 4.2实现量化 ..................................................................................................................................... 17 4.3小结 ............................................................................................................................................. 17 第五章 边缘检测 ................................................................................................................................. 19 5.1领域运算 ..................................................................................................................................... 19 5.2算子的比较选择 ......................................................................................................................... 20 5.3边缘检测 ..................................................................................................................................... 21
1
5.4阈值处理 ..................................................................................................................................... 21 5.5开运算和闭运算 ......................................................................................................................... 23 5.6图像合成 ..................................................................................................................................... 23 5.7小结 ............................................................................................................................................. 24 第六章 实验结果及对比 ..................................................................................................................... 25 6.1水彩画比较 ................................................................................................................................. 26 6.2与转描机技术比较 ..................................................................................................................... 26 6.3与openCV卡通化比较 .............................................................................................................. 27 6.4与真实绘制的漫画对比 ............................................................................................................. 27 第七章 总结与展望 ............................................................................................................................. 29 参考文献 ............................................................................................................................................... 30 致谢 ....................................................................................................................................................... 32
2
第一章 绪论
1.1研究背景
自从计算机图形学出现开始,真实感绘制便是人们研究的一部分。真实感绘制希望通过计算机产生和现实生活中相同的图像。而相对应的,脱离现实的非真实感绘制也越来越受到关注。两者共同发展,形成各种的属性和特点,对于不同场合,都可以发挥其特有的专长[1]。
表1 真实感与非真实感绘制的对比
非真实感绘制是计算机图形学中的一个研究热点,通过使用计算机生成不具有照片的真实感,而是具有手绘风格的图形技术便是非真实感绘制研究的内容。可以方便的做出出富有艺术表现力的图像,近年越来越受到各方面的关注。它主要模拟画种有钢笔画、水彩画等等。研究非真实感绘制可以帮助我们在近来的漫画动画制作渲染过程中获得更多效果的体验,根据需求选择不同的绘制方法。随着技术不断的成熟,非真实感绘制可以运用到各个方面,如基础的图像美化、动画制作、景区风景宣传、商业娱乐欣赏等等。所以它的价值将会越来越高。
漫画\一词是由英文中的\音译而来。也就是卡通,各国各地都有各自特殊的风格,随着时代的发展,漫画的风格也不断发生着改变。一般通过归纳,夸张,变形的手法来塑造各种形象。正好符合真实感绘制的特点,利用非真实感绘制相关技术完成图像具有漫画效果的绘制。19世纪末,美国漫画开始起步,一些周日报纸的副刊经常登载连环画,
3