Skip to content

PeterDSteinberg/kmeans_coloring_book

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<title>Kmeans coloring book</title>
View on GitHub

Kmeans coloring book

Coloring book type of drawing from pictures.

Download this project as a .zip file
Download this project as a tar.gz file

The screenshots below show 2 sets of input images and output sketchs from kmeans. The hatched triangle is a user selected training region to reduce the effect of extraneous data in images (excess background, washed out areas because of lighting, etc....).

Original airplane photo credit: 7-themes.com

Kmeans to Make Coloring Book Pages


$ git clone https://github.com/PeterDSteinberg/kmeans_coloring_book
$ cd kmeans_coloring_book
$ # move your input photos to ./raw_images relative to pwd at this point
$ python -i kmeans_coloring_book.py # starts the interactive plotter / classifier shown below:

Make a coloring book out of any image(s) you have in ./raw_images directory.

Adjust the number of colors (k in kmeans).

I found this script useful qualitatively for exploring the behavior of k-means when the training data (image color vectors) have unequal numbers of observations of each class.

It is interesting to watch the effect of overfitting (making a coloring book picture that is too intricate)

Support or Contact

peterdsteinberg [at] g[no space]mail [dot] com

About

Make a black and white sketch from a photo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published