Photmosaic is the composition of smaller images into a large image. First the input image is segmented into smaller sections (call them input tiles), and each input tile is compared against all the images in the library (call them mosaic tiles). The closest match is selected and will replace the original tile in the final composite.
The difficulty is in the scoring function. In this project, I am exploring the use of RGB averages, YIQ averages, Haar Wavelets using RGB values, and Haar Wavelets using YIQ values.
The problem with using RGB average of a tile for scoring is that an image with <255,0,0> as average has the same score as <0,255,0> when compared to <0,0,0> if we calculate the "distance" from <0,0,0> to these two colors/points. For example:
| Input Image | Result Image using RGB Average |
|
|
Using YIQ average instead of RGB average creates better results, but the YIQ space doesn't have the same dimension as RGB (r=0..1 g=0..1 b=0..1) where each color channel carries the same weight. The power of YIQ also means exploring the weight of each channel where Y (luminance) should have the highest visual effect.
| Input Image | Result Image using YIQ Average |
|
|
Using color averages (RGB or YIQ) doesn't explore the contours between the input tiles and the mosaic tiles. As can be seen in the following, the primary difference is that when using Wavelets to do image comparison, the edges are somewhat preserved. In contrast, the RGB average does not maintain the edges at all.
| Input Image | Result Image using RGB Average | Result Image using Wavelet in YIQ | Library of Mosaic tiles | |||||||||||||||||||||||||
|
|
|
|
I will not go into the scoring function of using Haar Wavelets on YIQ or RGB space. Also, I will not discuss the implementation details of speed vs. performance. There are a few GUI tools that I added to my program to better demonstrate the effects of wavelet space's "contour detection."
Similarly, I will not go into the discussion of how to make the results better except that the choices on the mosaic library are immensely important. To get really good results, one should not rely on daily images from a photo album. The images from these images have a high tendency to be white on top (where the sky is), and darker in the bottom (where the ground/people are). And furthermore, these images tend to really lack in changing in colors from one picture to the other. Whether in RGB or YIQ space, these images tend to be very similar to one another. But in building a good photomosaic, it is important to have input images ranging from all different colors and with all different types of contours.
| RGB Average | YIQ Average | RGB Wavelet | YIQ Wavelet |
|
|
|
|
| RGB Average | YIQ Average | RGB Wavelet | YIQ Wavelet |
|
|
|
|
| RGB Average | YIQ Average | RGB Wavelet | YIQ Wavelet |
|
|
|
|
| RGB Average | YIQ Average | RGB Wavelet | YIQ Wavelet |
|
|
|
|