Paint by Numbers, Coloring Book Sim — Milestone

By Keira Swei, Vivan Sinha, Robert Ni, and Kyle Cheng (Team 20)

Links: Webpage Video Slideshow

Progress Summary

We have split our project into four sections:

  1. Kuwahara filter: We created a function to take in an unprocessed image and perform Kuwahara filtering on the image. This removes fine details that may detract from the overall paint-by-numbers style we are going for. The image we output will then be passed through K means clustering.
  2. K means clustering: We implemented K means clustering on input images. This allows us to determine our k colors for color-by-numbers, by taking the clusters of the image (k groups of data in which are most similar to one another) and averaging the colors across the cluster.
  3. Region Clustering: We used flood fill (starting at a pixel that isn’t in an existing region and then for all unprocessed neighbors that are the same color: add it to that region and to a queue to flood a region recursively). Then we found regions that are under a certain number of pixels and combined them with whichever group it is most connected to (based on the number of adjacent pixels).
  4. UI: We take the regions and allow users to click into them. We put a black border around each region to show separation, which can be toggled later to view the painting more clearly. When a region is selected, we display the number of the color of the region, and let users paint it in with a brush size of their choice. We apply a clipping mask to the input to make sure that you can’t draw outside the lines.

Preliminary Results

We have a working Kuwahara filter function, K means clustering function, and user interface. An example of filtering and clustering is shown below:

We start with any given image:

ren_original

Then we apply Kuwahara filtering (here, the window size is 8):

ren_kuwahara

Lastly, we apply K means clustering (here, the number of colors is 5):

ren_kmeans

We can then input this into our user interface (refer to video for a demo of the UI).

Reflections and Next Steps

Kuwahara filter: K means clustering: UI: Overall: