The algorithm I used for image mosaicing is as follows:
To attempt to alleviate the issue of major intensity differences between input images, I experimented with histogram equalization. I ran my histEq function from the previous assignment on each individual image before the mosaicing process. This didn't produce the results I was hoping for, so I also tried to separately run the histEq function on the final image. This also produced undesirable results, as it magnified the intensity differences, making the seams very visible. As a result, I left this out of my final mosaicing, but some test images can be seen in the Results & Images section below.
In order to alleviate sharp transitions between images, I implemented feathering. I did this by computing the distance from a pixel to the edge and if it was less than the feather distance (and not black), I weighted the current pixel value and the new pixel value and added them to get the new value for each pixel. I experimented some with the size of the feathering, and decided on a feather size of 100. The results of this can also be seen below.
In order to include all parts of the input images into the final mosaiced image, I needed to compute the size of the new image. I did this by mapping each of the images into the same plane as the target image. To accomplish this, I applied the transformation to the corners of each image. Then I used these to find the minimum and maximum values in both the x and y directions, and calculated an offset to transform them to positive values.
Since we weren't given all the transformations between images, I needed to find all the missing transformations in order to support any image as the target image. I did this by looping through all combinations of the images, and if a correspondence between them did not exist, I computed the path between them, and applied the appropriate transformation matrices.
The command line input to run the mosaic
program is below (followed by an example):
> ./mosaic parameter_filename
> ./mosaic params_mts0.txt
Below are the source images given.
![]() |
![]() |
![]() |
![]() |
Below are the results of mosaicing the above images together. (Click on the image to see the full size version)
![]() |
![]() |
![]() |
![]() |
Image mosaicing works best for planar and panoramic images. Planar images allow the camera to shift linearly, so that no new objects are revealed. These mosaics treat the world as planar or 2-dimensional. Panoramic allows for rotations around the focal point. So the camera has a fixed center point, but it can rotate around this point. These mosaics allow for a wider view.
Planar ImagesTo test mosaicing for planar images, I took the image below, and cut it into two separate, overlapping images (also shown below). Then I used gimp to view the images and manually find correspondences between them. I decided to use 10 correspondences, and I think it produced very good results.
![]() | |
![]() |
![]() |
Below are the results of mosaicing the above images together.
![]() |
In addition to testing planar images, I took four overlapping photos of the mountains, rotating the camera about a fixed point (as fixed as I could). I decided to use 10 correspondences between each set of adjacent images. So images 0 and 1, 1 and 2, and 2 and 3 each have 10 corresponding points between them. Below are the original images used in the mosaicing.
![]() |
![]() |
![]() |
![]() |
Below are the results of this mosaicing from each of the different viewpoints. (Click on the image to see the full size version)
![]() |
![]() |
![]() |
![]() |
Below are some examples of the mosaic using the provided images, with different numbers of control points. The first set of images use 6 control points, and the second set of images use 4 control points. As you can see from the results, the mosaics using 6 correspondence points still produce reasonably good results. Where as the mosaics with 4 control points are extremely distorted.
6 Control Points![]() |
![]() |
![]() |
![]() |
Below are some examples of the mosaiced image using different numbers of pixels for the feathering of the edges. From the images, it is clear that a larger number of pixels used for feathering results in smoother transitions between the images. As you can see, the edges of the images are very clear in the mountains with the lower number of pixels being used. But as that number increases, the edges are less apparent, and only really noticeable in the sky.
![]() |
![]() |
![]() |
![]() |
I played around with contrast adjustments using my histogram equalization from the previous assignment. I tried the mosaicing with no equalization, running histogram equalization on each of the original images, and running it on the output mosaic image. I found that the image without the histogram equalization produced the best results because the histogram equalization seemed to highlight the areas that don't match up rather then blending them together. Below are images showing my results.
![]() |
![]() |
![]() |
How many control points does it take to get a "good" transformation between images?
In order to get a "good" transformation between images, the system of equations needs to be over constrained. Since there are 8 unknowns in the linear system, there needs to be at least 4 control points. I played around with the numbers and found that 6 control points leads to a reasonable transformation between images.
How does the algorithm behave at the theoretical minimum of the number of control points?
The theoretical minimum number of control points was discussed above to be 4 (to get 8 equations for the 8 unknown parameters). As can be seen in the images above, the mosaic is extremely distorted using only 4 control points. Therefore, increasing the number of control points above the theoretical minimum produces much better mosaicing results.
From your experiments how does the accuracy of the control points affect the results?
Below are a set of images showing what happens to the mosaic when there is error in the control points. The images on the left contain approximately 12 control points between images and the images on the right contain 6 control points between images. The top row contains minimal error, the middle row contains an error of 10 pixels, and the bottom row contains an error of 20 pixels. Since a set of corresponding points consists of a list of points for each image, I decided to add error to only one set of these points to insure that the new points aren't close to different corresponding points. I adjusted half the points in one set of the corresponding points by adding 10 (or 20) to both the x and y components. As can be seen from these results, the error doesn't affect the set of images with 12 control points as much as it does the images with 6 control points. So even a small change in accuracy of the control points begins to distort the image with a small number of control points. Therefore, I would conclude that the results obtained by adjusting the accuracy of control points depends on the number of control points. A higher number of control points is less sensitive to error in those control points, while a lower number of control points is more sensitive to the accuracy of the correspondences.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |