• Stars
    star
    110
  • Rank 314,940 (Top 7 %)
  • Language
    Python
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

make images look like a cartoon image

Cartooner

This tool converts your photo into a cartoon-like image

Samples

input

output

install

pip install cartooner

how to use

from cartooner import cartoonize
import cv2
import os
import time

input_file = ... # input image file name
output_file = ... # output image file name
image = cv2.imread(input_file)
output = cartoonize(image)

cv2.imwrite(output_file, output)

Dependences

  • numpy
  • scipy
  • opencv-python
pip install -r requirement.txt

How it works

This cartoonizer uses K-means algorithm to cluster the histogram of image. The value K is auto selected by the method in this paper.