(IJCSIS) International Journal of Computer Science and Information Security,Vol.
9
, No.
7
, 201
1
using nearest neighbour interpolation and wrap of sourceimage is generated.Face normalization with scaling makes faces in both sourceand target image of same size and helps to align the features of source image according to the target image.
C.
Colour transition
The colour transition method used in image morphingdecides the quality of the intermediate images generated bycontrolling the colour blending rate. And this rate depends onweight used by colour transition method. If the colour blending is done uniformly throughout the morphing process,good morph sequence is generated. Morph sequence hasearlier morphs similar to source and last morphs similar to thetarget image. The middle image in the entire morph sequenceis neither source nor the target image. Hence the quality of morphs depends on the quality of middle images. If it look good then entire sequence looks good.Generally pixel based colour transition like cross dissolve[1] [12], averaging pixels [13] and by merging difference between colour of source and target pixels [12] [13] is done. Inthis paper totally new colour transition methods based onvector quantization are implemented and discussed.Vector Quantization (VQ) techniques employ the processof clustering. Vector Quantization derives a set (codebook) of reference or prototype vectors (code words) from a data set. Inthis manner each element of the data set is represented by onlyone codeword.
Various VQ algorithms differ from one another on the basis of the approach employed for cluster formations.VQ is a technique in which a codebook is generated for each image. A codebook is a representation of the entire imagecontaining a definite pixel pattern [14] which is computedaccording to a specific VQ algorithm. The image is dividedinto fixed sized blocks [14] that form the training vector. Thegeneration of the training vector is the first step to cluster formation. Vector Quantization VQ can be defined as amapping function that maps k-dimensional vector space to afinite set CB = {C1, C2, C3, ..…. , CN}. The set CB is calledcodebook consisting of N number of code vectors and eachcode vector Ci = {ci1, ci2, ci3,……, cik} is of dimension k.The key to VQ is the good codebook. Codebook can begenerated in by clustering algorithms [14]-[16]. Using thiscodebook original image can be reconstructed with someimperceptible colour loss.Two different algorithms to generate codebooks are given below.
1)
Linde – Buzo – Gray algorithm (LBG):
For the purpose of explaining this algorithm, twodimensional vector space as shown in Fig.3 is considered. Inthis figure each point represents two consecutive pixels. In thisalgorithm centroid is computed as the first code vector C1 for the training set. In Fig. 3 two vectors v1 & v2 are generated byadding constant error to the code vector. Euclidean distancesof all the training vectors are computed with vectors v1 & v2and two clusters are formed based on nearest of v1 or v2.Procedure is repeated for these two clusters to generate four new clusters. This procedure is repeated for every new cluster until the required size of codebook is reached [14].
Figure 3. LBG for 2 dimensional cases
2)
Kekre’s Proportionate Error algorithm (KPE):
In this algorithm a proportionate error is added to thecentroid to generate two vectors v1 & v2 [14]. The error ratiois decided by magnitude of coordinates of the centroid. Firstminimum element in centroid is obtained and then centroid isdivided throughout by this minimum and error vector isobtained and instead of constant error now this error vector isadded and subtracted from centroid to form cluster. Rest all procedure is same as that of LBG. In this algorithm whileadding proportionate error a safe guard is introduced so thatneither v1 nor v2 go beyond the training vector space. Thisovercomes the disadvantage of the LBG of inefficientclustering.After the codebooks of desired size are generated for bothinput images are generated, these codebooks are interpolated based on difference between them and then intermediateimage frames as source codebook reaches to target codebook are generated by reconstructing the interpolated codebook.Algorithm for codebook interpolation is given below.
Codebook interpolation algorithm:
1.
For every training vector in the training set of sourceand target images find the closest code vector fromcorresponding codebooks.2.
Save indices of source and target code vector’sobtained in different arrays.3.
For each index in two arrays obtained in step 2 getcode vectors form source codebook and targetcodebook.4.
Compute difference in these code vectors and divideit by number of intermediate frames.5.
In every iteration to generate intermediate images addthis difference vector from step 4 to source codebook.6.
Reconstruct image using this codebook and display itas new intermediate frame.IV.
R
ESULTS
A
ND
D
ISCUSSIONS
77http://sites.google.com/site/ijcsis/ISSN 1947-5500