Back To Home Page  
 
CURRENTLY VIEWING

IMAGE PROCESSING
These are some image processing algorithms implemented using OpenGL or MATLAB

Image Processing
      + Photo Stitching
      + SVD Image Compression
      + 2D Morphing

Photo Stitching

This is a script written in MATLAB to stitch several overlapping images together. The user manually marks corresponding pairs of points between adjacent images first. The script is then executed to calculate the forward homographies, final mosaic size and then the backward homographies. Finally, the destination scan algorithm is used to produce the final image. Alpha blending was also implemented to remove visible seams that might arise at the edges of the original images.

I took four images of the Fullerton Hotel in Singapore to prepare for the photo stitching exercise:

2D morphing from cat to dog (and back)

2D morphing from cat to dog (and back)

2D morphing from cat to dog (and back)

2D morphing from cat to dog (and back)
The original overlapping images to be stitched up

I then marked out 16 pairs of corresponding points for each pair of adjacent images, although theorectically 4 pairs will be sufficient. A sample of the corresponding points for a pair of adjacent images are as such:

2D morphing from cat to dog (and back)

2D morphing from cat to dog (and back)
The 16 corresponding points for images 1 and 2

Once all the markings have been done, I executed the MATLAB script and the final mosaic is obtained. Alpha blending is applied to remove visible seams that might exist after the images are placed together.

2D morphing from cat to dog (and back)
Final mosaic formed from stitching the four overlapping images

Back To Top Back To Top


SVD Image Compression

This is a simple MATLAB script which uses Singular Value Decomposition (SVD) to compress images. SVD can be used to provide the best lower-rank approximation to a matrix M, and thus be used for image compression. The idea is to use only the first k singular values/vectors of M so they form a lower-ranked matrix which is a good approximation to the original matrix M. This is usually fine because the lower singular values/vectors are small and can be sacrificed to reduce amount of data needed for representation. For a m x n matrix, we can actually store only (m+n+1 n)*k numbers which can be much smaller than the original mn numbers.

As can be seen below, the SVD compression brings about little visible loss in quality when suitable values of k are chosen..

2D morphing from cat to dog (and back)
Compression with k = 20 produces small file but has visible artifacts

2D morphing from cat to dog (and back)
Compression with k = 100 produces a compressed file without much visible artifacts

It is possible to choose k such that the "compressed image" ends up with a larger file size, which defeats the purpose of this technique. This implies that k must be chosen with k with care.

Back To Top Back To Top


2D Morphing

This is an OpenGL program written to create 2D image morphing. Image morphing is usually used to create special effects in movies so that we can see a smooth change from one image to another.

The algorithm is a feature-based image morphing algorithm as described by Beier and Neely at SIGGRAPH 1992. The official website of the paper is available online. Please visit the website to find out more about it.

In this example, an image of a cat is morphed to a dog (and back) smoothly.

2D morphing from cat to dog (and back)
2D morphing from cat to dog (and back)

Users are required to define pairs of tracking regions manually. The blue highlighted lines below show a pair of such tracking lines.

Users are required to define pairs of tracking regions manually
Users are required to define pairs of tracking regions manually

Note: User Interface and program template created by Dr Anthony Fang.

Back To Top Back To Top

 
CG:SKEELOGY
ABOUT ME (view full)

[ SKEEL LEE ]
- Character TD
- Game Physics Programmer

(+65) 96162157
skeel@skeelogy.com
Resume is now available! Drop me a mail to request.
I am interested in character rigging, deformation and Physics simulations.
I also do R&D on the
above topics to find practical solutions to challenging problems.
MY OTHER SITES
    + Skeelogy
       (Design Portfolio)
    + CG:S's Blog
    + CG:S's YouTube
NEWS FEED
Site best viewed with
IE 6.0+ and 1024x768+.