Overview
This project takes digitized Prokudin-Gorskii glass plate images and produces their respective color images.
The glass plates contain images from three color channels, RGB, which are extracted and aligned with image
processing techniques. More specifically, the R and G components are aligned to the B component.
Coarsest Image
The alignment process starts at the coarsest (smallest) scale. The image is downsampled until its
shortest side is rescaled to be as close to 100 pixels as possible. Then, displacements within +/-8% of the
image width and length are iterated through and tested. The displacement that matches closest
with the B part (more in the "Image Matching Evaluation Metric" section) is then returned. One of
these searches reflects the single-scale implementation.
Coarse-to-Fine Image Pyramid
Because single-scale exhaustive search would be too expensive for large (e.g. .tif) images, the procedure
starts with the coarsest image and works its way up the "image pyramid." The images and optimal
displacements are scaled up by a factor of 2, and for larger images, only displacements within +/-1 pixel
of the optimal displacement are evaluated. This strategy significant reduces the number of displacements
tested and, therefore, alignment speed.
Image Matching Evaluation Metric
Two image matching evaluation metrics are used:
Since the SSIM metric is more advanced, it performs better for images like emir.tif, but at the cost of running ~4x slower.
Canny Edge Detection
This automatic cropping idea starts with detecting all edges in the color image using a canny edge
detector.
Create Cropping Mask
Next, only edges in the outer 10% of the image are kept and evaluated as potential borders. Iterating from
the innermost to outermost potential borders, a border is chosen if it is "straight enough" -- the
qualification is making up at least a certain threshold proportion of the full straight line. The final
borders can be visualized by a mask.
Crop Image
The original image is cropped with the determined borders.