Project 1: Image Alignment with Pyramids
Vibhu Ramani
September 17th, 2012
Steps:
- Given an image split it into its RGB formats.
- Based on the image size I compute the image pyramid needed. I keep reducing till it reaches a size of 64 in some dimension.
- Start from the smallest image in the pyramid try aligning the 2 images within a reasonable range [-2,2] using ssd scoring.
- While computing the score I only disregard the 10% of the image on each side
- As you move up in the pyramid the shift doubles and then requires retweaking in a reasonable range [-2,2]. This way when you reach back to the biggest image you only need to check this small range.
- If using a edge detector, the edges should be determined at each pyramid level and not at the biggest level and then tried to be scaled. This leads to antialiasing which caused issues.
- Once the alignment for the 3 layers is found set the images and using a croping function try to find the best possible window for the image.
Extra Credit
Auto cropping Consider each layer of the RGB format, I discreatized pixels that were only greater and less than a certain threshold (10,240) to 1 and the rest to zero. To this image I took horizontal and vertical sums,
For the sum in each direction looking at the histogram I felt that it was necessary for a line to be inside the image if atleast 1/3 of the pixels had positive values. The first line to have such could be considered as the boundary.
But this led to some errors as there were cases if a border had a line above the threshold it would spoil the boundary conditions.
To fix this I ran a sliding window sum and picked the first point where atleast 50% of the points were above the threshold. This improved the border detection a lot.
Ref http://users.iit.demokritos.gr/~bgat/CBDAR_BORDERS.pdf
Ref Sliding Average function
Using Edges For the images that had good solid straight lines and edges edge detection helped a lot and improved the time to compute the ssd. The images that consisted of a lot of texture surfaces had issues with allignment using edges.
Image format
Original RGB Image | Image aligned using RGB value and cropped |
Original RGB Image With edges | Image aligned using Edges and cropped |
Positive Results Using RGB Values
Positive Results Using to Edge Detector.
Negative Results
Unique cases

But if we changed this order the image gets aligned properly.