BIO EN/CS 6640 Introduction to Image Processing - Homework 2
Zach Gildersleeve
February 19, 2007
Single Point of Deformation
script used: mosaic.m
image used: SubImage1.png, SubImage2.png, SubImage3.png, SubImage4.png
The script mosaic.m describes a very quick and dirty image mosaicing utility based on the Fast Fourier Transform. The provided images are split from a larger image, that is, there is no distortion between the images that would have been introduced if the images were originated seperatly. The script uses a sub image of the first image to convolve with and identify the areas of best fit. As the area of overlap is known for these images, it is possible to use that information to identify a valid sub image, in this case the lower right corner of the initial image. This sub image is convolved with its parent image and the other images in the dataset. The minimum value of the convolved image is the location of best fit, and each image is translated to fit the identified best points together. This result is shown below. As expected, the mininum values for each of the four images are all zero, meaning that there was no distortion or misalignment.
Four images, showing the identified minimum values (points of best fit) |
Four images translated to match minimum point |
Other Images
script used: mosaicLeaf.m
image used: leaf1.png, leaf2.png,leaf4.png, leaf5.png
The same script applied to my own set of images also correctly tiles them. This image was selected because it has details in contrast of similar size and shape, but the method is still able to correctly locate and place the images.
Four images, showing the identified minimum values (points of best fit) |
Four images translated to match minimum point |
Further Work
script used: mosaicRobust.m
image used: f1.png, f2.png, f3.png, f4.png, f5.png, f6.png, f7.png, f8.png, f9.png
I extended the above algorithm to allow for multiple image files, and to allow for any image to be used as the initial image - the base for the sub image. To accomplish this, we assume that if an image does not overlap with at least one corner of a second image, that it cannot overlap the image at all. This ignores if the second image is entirely contained in the first image, which essentailly would be no change. The seperate images are loaded into a MatLab 3-dimensional matrix. The script loops over each of the four corners of the first image, using each corner to establish the coordinates of the sub image. This loop progresses until a minimum value under a threshold is found, then the next image is processed. If no overlap is found, the image is ignored. The below image shows this script successfully stitching an image together from nine smaller images. The center image was used as the initial image, which allows for all images to be found. The image is assembled sequentially, so by running the script it is possible to watch the image put together.