In digitized Prokudin-Gorskii glass plate images, each image is provided as three gray scale images representing the R, G and B channel infomation. The three images are not perfectly aligned since they are not taken at the same time. The goal in this project is to design an algorithm that automatically restore a color image with as few visual artifacts as possible.
When the input image is small (), we can directly align the r,g channels with the b channel image by searching within a user-defined offset range. The offsets that provide the least error according to the metric is proposed to generate the final color image. The details of my implementation are:
Here are the test results of this algorithm:
|
|
|
|
And more results from some other downloaded images from the same collection:
|
|
|
|
We can tell that this method works fine on small images.
When the input image is very large, the previous methods will be extremely time-consuming due to the large search range. Instead, we can hierachically downsample the image by a factor of 2 each time so that the image pyramid is generated. We can start to align the images from the coarsest scale and use the obtained offsets as an initial guess for the next scale alignment. Within each scale, the single-scale method mentioned above is utilized to find the best offsets. The details of my implementations are:
Here are the test results of this algorithm:
|
|
|
|
|
|
|
|
We can tell from the results above that this method works fine for most of the images. But for image 2 and 5, there are evident inalignments. The major cause is that the pixel values within these two images are quite similar and SSD on the raw pixel values may not give the least value when it is perfectly aligned. Some better features that stays invariant as the tone of the image changes should be explored. Please refer to Bells & Whistles for better strategies.
And more results from some other downloaded images from the same collection:
|
|
|
When the input image is very large, the previous failed to align the images perfectly. In order to use a more reliable feature than the raw pixel values, I want to extract the gradient infomation from each channel and try to align the gradient images. The details are:
Here are some test results and the comparison with the previous method:
|
|
|
|
|
|
|
|
|
|
For the purpose of automatic cropping, we want to identify the color/black boundaries and then remove them accordingly. I used Sobel filters again to extract the gradient information. Then I search for the evident boundaries within each direction separately. The details are:
Here are some test results and the comparison without and with the automatic clipping:
|
|
|
|
|
|
In order to obtain a proper contrasting, we should first find the range of brightness in the original image and then try to map the pixels to a new range that fills the entire domain. The details are:
Here are some test results and the comparison without and with the automatic contrasting:
|
|
|
|
|
|
| Operations | On Small Images(s) | On Large Images(s) |
|---|---|---|
| colorization(raw pixel) | ||
| colorization(gradient) | ||
| colorization(gradient)+Cropping | ||
| colorization(gradient)+Cropping+Contrast |