For my final project I chose to explore
techniques to automatically colorize black and white images. There
exists a huge archive of Black and White photography taken ever since
the camera was invented. It would be interesting to see how some of
these images might look in color. However for a particular B&W
picture, though there are certainly "incorrect" colorizations, there
might exist multiple "correct" colorizations. To reduce the ambiguity,
a similar color image is provided to act as a reference for the
colorization procedure. The approach followed were the methods
implemented in the following two papers, with a few modifications of my
own
1. Colorization by Example, - R.Irony, D.Cohen-Or, and D.Lischinski,
Eurographics symposium on Rendering (2005)
2. Colorization using Optimization, - Anat Levin, D.Lischinski, Yair
Weiss, SIGGRAPH (2004)
Overview
Classification
Each reference feature vector
is associated with a label as computed in the segmentation stage. Now
the feature vectors corresponding to the input image are classified
using a K-nearest neighbours algorithm. However the resulting
segmentation of the input image might have a lot of pixels which have
been misclassified. We would like to apply something like a median
filter to smooth out the noisy misclassifications, however the labels
do not have any ordering, hence we need to approach it differently. We
proceed by computing a confidence value of the classification of each
pixel in each label

Where
N(p,l) denotes the pixels in the neighbourhood of p with a label l. W
denotes the weighting, which is calculated as :

Where
D(q, Mq) is the euclidean distance between q and it's best match Mq. To
obtain the new segmentation we replace each pixel label with the label
with the highest confidence value. Shown below are the rough
segmentation, the new segmentation and the confidence map for the above
input image:
Color
Tranfer
Once the input image has been
segmented and the confidence map computed, we transfer color between
the reference image and the input image. Color is transferred only
between regions having a confidence (as computed previously) above a
certain threshold. This results in an image with certain regions marked
with color ( or scribbles) .
Colorization using Optimization
To
propagate color throughout the image, the approach described by Levin
et al was used. The basic assumption of this method is that
neighbouring pixels with similar luminance values should have similar
colors. We seek to minimize the difference between the color assigned
to a pixel and the weighted average of it's neighbours. The weights
being determined by the similarity of their luminance. The objective
function used is :
Where the ws are the weight
computed based on the similarity of the luminance of pixels p and q,
and C(p) is the color (UV values) of the pixel. The result after
optimization is shown below:

Issues
I ran into a few issues in my
implementation of the project. The main problems were :
- Misclassification of regions: I
found that the main reason behind some of the bad results were some
regions being misclassified. This was possibly a limitation of the
feature set used and also a result of the fact that I am using a very
simple KNN classifier. Perhaps with a more discriminating feature space
this problem could be overcome
- Time of
computation: My implementation of the KNN classifier took very
long to run. Perhaps speedups like using the approx. Nearest neighbour
algorithm would help improve the run time of the algorithm
Examples
Future Work
We could use data-driven
methods to improve the colorization technique, and to automate the
process of selecting a similar reference image. This could be done in a
manner similar to that in IM2GPS (Hays/Efros) by finding similar images
using a large image database such as flickr. Also exploring different
feature sets that would improve matching between regions would improve
the colorization.