官术网_书友最值得收藏!

  • OpenCV 4 with Python Blueprints
  • Dr. Menua Gevorgyan Arsen Mamikonyan Michael Beyeler
  • 213字
  • 2021-06-24 16:49:59

Cartoonizing an image

Over the past few years, professional cartoonizer software has popped up all over the place. In order to achieve a basic cartoon effect, all we need is a bilateral filter and some edge detection.

The bilateral filter will reduce the color palette or the numbers of colors that are used in the image. This mimics a cartoon drawing, wherein a cartoonist typically has few colors to work with. Then, we can apply edge detection to the resulting image to generate bold silhouettes. The real challenge, however, lies in the computational cost of bilateral filters. We will, therefore, use some tricks to produce an acceptable cartoon effect in real time.

We will adhere to the following procedure to transform an RGB color image into a cartoon:

  1. First, apply a bilateral filter to reduce the color palette of the image.
  2. Then, convert the original color image into grayscale.
  3. After that, apply a median blur to reduce image noise.
  4. Use adaptive thresholding to detect and emphasize the edges in an edge mask.
  5. Finally, combine the color image from step 1 with the edge mask from step 4.

In the upcoming sections, we will learn about the previously mentioned steps in detail. First, we'll learn how to use a bilateral filter for edge-aware smoothing.

主站蜘蛛池模板: 龙南县| 永济市| 阿图什市| 雅安市| 卓尼县| 浠水县| 长沙县| 于都县| 罗源县| 容城县| 银川市| 郸城县| 抚远县| 吉林市| 皋兰县| 垫江县| 确山县| 静安区| 班玛县| 杂多县| 林甸县| 水富县| 姜堰市| 紫阳县| 衡水市| 汉寿县| 手机| 莆田市| 澄迈县| 泽库县| 伊吾县| 吉林市| 海宁市| 松滋市| 芦溪县| 手机| 东乡| 星子县| 卫辉市| 巴彦县| 逊克县|