CS 7321 Winter 1998
Images & Splicing
Index
How I solved it
-
Read in the two images to be spliced:Normalized them (by dividing by 255).
-
Then I obtained three separate images: R, G, B for both input images: Left
& Right.
-
Genereated the Gaussian and Laplacian Pyramids for each:
-
Ran Reduce.m recursively on each image --> Gaussian Pyramid for: left image
and right image (one color at a time).
-
Used Expand.m to subtract an Expanded version of each pyramid layer from
the (prev) layer which was that size originally.
-
Note: Reduce() consists of Gaussian-low-pass filtering, and subsampling
odd columns and rows,
-
Expand() consists
of supersampling the small version to the next higher power(2) size, followed
by filtering by the same Gaussian filter, and then a gain adjustment
of 4x.
-
Spliced the Laplacian Images into an Output Pyramid:
-
Allocated Output image (Out) and its Laplacian pyramid.
-
For each level of the pyramid:
-
pixels left of the center column get copied from the Left image,
-
pixels to the right of the center column get copied from the Right image
-
pixels in the center column are ave. of the two intensities of Left and
Right at that position
-
Expanded and accumulated the Laplacian pyramid of Out, resulting in a spliced
image for each color channel.
-
Combined color channels (R,G,B) of Out to result in a single image matrix
(W, H, 3channels).
to TOP
Assumptions and Weaknesses
I made the following assumptions
-
Images are square, and have dimensions of (1+2^N).
-
Left and right were the same size, and that images aren't 24 bit.
-
Images overlap, and splicing will occur in the horizontal middle of the
images.
I think the major weakness of my solutions is:
-
Program isn't very useful in current form: Sizes must be correct, and images
must be overlapping.
-
Program could be improved if some form of correlation algorithm was used
to shift/scale/rotate the neighboring & overlapping images so that
splicing would be most effective.
-
Program is missing the ability to splice images of arbitrary shape, or
images that are obviously non-overlapping.
-
Program doesn't pad the edges of the images, so filtering can resultin
flawed edges - ringing.
-
Technique itself work best for grayscale images, and combining separately
processed RGB channels results in apparent edges along the splicing border,
even though intensities there do not constitute an actual edge.
Results
 |
 |
Figure 1:Left and Right input images. These are taken
from two different points along the Atlantic City Boardwalk, under different
weather conditions.
 |
Figure 2: Final image which is the result of splicing
the two input images together, and then cropping the output.
 |
 |
Figure 3: (A) Regular output of applying the splicing
algorithm to the two images - this is before cropping. (B) Another output
image - this one is the result of spatially shifting one of the input images.
Notice that there are two oddly similar buildings just left of the center
of the Boardwalk.
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
Fig 4: (Left) Gaussian Pramid of Left input image.
(Right) Laplacian Pyramid of Left input image. Note: The last four
rows of the pictured pyramids are being scaled for display purposes.
 |
 |
Fig 5: Extra images I spliced together...
Source Code
-
splice.m : This is the script showing how
I generated the above images.
-
Reduce.m : Function that blurs and subsamples an
image.
-
Expand.m : Function that interpolates and blurs,
then increases intensity of an image.
-
GenPyramids.m : Uses Reduce and Expand to generate
Gaussian and Laplacian Pyramids of an image. *Note: This is a good example
of using Matlab's cells capability.