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

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.

主站蜘蛛池模板: 云和县| 扎鲁特旗| 绥德县| 许昌市| 龙川县| 驻马店市| 怀化市| 惠州市| 石渠县| 泾阳县| 信丰县| 罗城| 西乌珠穆沁旗| 长乐市| 旅游| 卓资县| 乐亭县| 桃园市| 班戈县| 温宿县| 肃南| 赤峰市| 勃利县| 邢台县| 安多县| 盐边县| 桂林市| 崇义县| 屯门区| 应城市| 锡林郭勒盟| 晋城| 兴文县| 泗阳县| 波密县| 巨鹿县| 遂平县| 西城区| 兰考县| 乌拉特后旗| 易门县|