I have a dream.. that one day a robot can paint.
Painting is surprisingly difficult. It involves a huge number of cognitive processes such as shape recognition and color matching. I've been interested in robots that can paint for some time.
I've decided to focus on one area of painting - contrasting edges. The end reproduction is essentially one color (black ink on white canvas). This simplifies the problem, but not the ability to be creative and expressive.
Processing is essentially divided into several steps:
- Reduce texture in the image using a bilateral filter.
- Divide the color channels and perform laplacian edge detection on each channel, the recombine.
- Build a list of edge circles - a point in the center of a line with diameter equal to the width of the line.
- Build a list of lines by connecting these circles.
The analysis step is fairly robust and uses a basic heuristic to create lines, taking into account:
- The current direction of the last line segment, and the potential point.
- The number of low intensity (i.e. non-edge) pixels between the end of the line and the potential point.
- The distance between the end of the line and the potential point.
Once that is done, the final result should be generated by a robotic arm. For simulation purposes, I've created a water colour based painting algorithm that uses a subtractive colour model.
A masterpiece is born! Thanks Mr Robot.
I respectfully thank the authors of the source images I used for these examples.