Chris Cameron - 15-862 Project 1 Results

Method

Alignment

Quality of an alignment was measured by the correlation of the images. In order to avoid comparing the noisy edges of the images, only the center 80% of images were used in calculating their correlation (this is in addition to limiting attention to parts of the image that have not been shifted to the other side of the image).

Search is performed using an image pyramid. The smallest image size compared is 128x128. At each stage in the pyramid, a 5x5 set of offsets is compared.

Cropping

The following operation is performed on each pair of channels.

For each row, the correlation between channels' rows is computed. Since the edges of the image contain some junk (which we are trying to identify) and this junk will introduce noise, the correlation calculation only uses the center of the row. By default, 95% of the row is used in this calculation. The result is a plot of correlations of rows as follows (the example images are actually the rows of 00398v.jpg).

Note that if we used the whole row as opposed to just 95% of it in the calculation of correlation we would have the noisier (and almost useless) plot that is shown here.

This plot is then median filtered. The width of the filter used is 2.5% of the image size. This removes jaggy noise from the signal, resulting in a plot as seen below.

The plot is then thresholded. Areas with correlation less than 0.45 are considered to be useless. The leftmost and rightmost useless regions of the image are then tossed out.

The resulting image vertical range is the intersection of the useful areas of all pairs of channels.

The horitonal range is computed by using the same procedure on the columns of the image.

Testing

To process the image in.jpg and save it out as out.jpg, from the directory of the supplied code, type in MATLAB process('in.jpg','out.jpg');.

Results

00149v.jpg

Best alignment Rshift was [9 2], Gshift was [4 2]

00163v.jpg

Best alignment Rshift was [-4 1], Gshift was [-3 1]

00398v.jpg

Best alignment Rshift was [11 4], Gshift was [5 3]

01167v.jpg

Best alignment Rshift was [12 -2], Gshift was [5 0]

00153v.jpg

Best alignment Rshift was [14 5], Gshift was [7 3]

00194v.jpg

Best alignment Rshift was [7 4], Gshift was [4 2]

01656v.jpg

Best alignment Rshift was [12 -1], Gshift was [2 0]

00952v.jpg

Best alignment Rshift was [8 -4], Gshift was [2 -2]

01043u.tif

Best alignment Rshift was [11 17], Gshift was [-16 10]

The full-size image may be seen here. When cropping this image, the threshold was set to 0.20 instead of the default of 0.45. Using the default values, the output is this (only marginally different).

01657u.tif

Best alignment Rshift was [117 11], Gshift was [55 8]

The full-size image may be seen here.

00458u.tif

Best alignment Rshift was [87 32], Gshift was [43 7]

The full-size image may be seen here. When cropping this image, the threshold was set to 0.65 instead of the default of 0.45. Using the default values, the output is this (only marginally different).

01047u.tif

Best alignment Rshift was [71 33], Gshift was [24 20]

The full-size image may be seen here. When cropping this image, the threshold was set to 0.40 instead of the default of 0.45. Using the default values, the output is this (somewhat significantly different).