(IJCSIS) International Journal of Computer Science and Information Security,Vol. 08, No. 04, 2010
Kekre’s Algorithm to generate Walsh Transform from Hadamardmatrix [17] is illustrated for N=16.However the algorithm isgeneral and can be used for any N = 2
k
where k is an integer.
Step 1:
Arrange the ‘N’ numbers in a row and then split the row at ‘N/2’,the other part is written below the upper row but in reverse orderas follows:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1515 14 13 12 11 10 9 8Step 2:
We get two rows, each of this row is again split in ‘N/4’ and otherpart is written in reverse order below the upper rows as shownbelow.
0 1 2 315 14 13 127 6 5 48 9 10 11
This step is repeated until we get a single column which gives theordering of the Hadamard rows according to sequency as givenbelow:
0,15,7,8,3,12,4,11,1,14,6,9,2,13,5,10
Step 3:
According to this sequence the Hadamard rows are arranged to getWalsh transform matrix. Now a product of Walsh matrix and theimage matrix is calculated. This matrix contains Walsh transformof all the columns of the given image.Since Walsh matrix has the entries either +1 or -1 there is nomultiplication involved in computing this matrix. Since onlyadditions are involved computational complexity is very low.
III.
FEATURE
VECTOR
GENERATION
The proposed algorithm makes novel use of Walsh transform todesign the sectors to generate the feature vectors for the purposeof search and retrieval of database images. The complex Walshtransform is conceived by multiplying all sal functions by j =
√
-1and combining them with real cal functions of the same sequency.Thus it is possible to calculate the angle by taking tan
-1
of sal/cal.However the values of tan are periodic with the period of
п
radians hence it can resolve these values in only two sectors. Toget the angle in the range of 0-360 degrees we divide these pointsin four sectors as explained below. These four sectors are furtherdivided into 8, 12 and 16 sectors. We have proposed two differentapproaches for feature vector generation namely density andmean value of all the vectors in each sector with sum of absolutedifference and Euclidean distance [7-9] [11-14] as similaritymeasures. Performance of both these approaches are comparedusing both similarity measures. Each Walsh sector is representedby single percentage value of sal-cal distribution in particularsector w.r.t. all sectors for feature vector generation using formulashown in (1) and two extra components of zero-cal and highest-salare added to the feature vector.(Total number of sal in particular sector)----------------------------------------------------- X 100 (1)(Total number of sal in all sectors)Thus for 4, 8, 12 & 16 Walsh sectors 4, 8, 12 and 16 featurecomponents along with extra components of zero-cal and highest-sal for each color planes i.e. R, G and B are generated. Thus allfeature vectors are of dimension 18, 30, 42 and 54 components. Inthe second approach mean of all sal and cal of each sector andwith extra components of zero-cal and highest-sal is calculatedand equation (2) is used for feature component representing eachsector for all three color planes i.e. R. G and B with single valuethus forming the feature vector of dimension 18, 30, 42 and 54 for4, 8, 12 and 16 complex Walsh transform sectors.
A.
Four Walsh Transform Sectors:
To get the angle in the range of 0-360 degrees, the steps as givenin Table 1 are followed to separate these points into fourquadrants of the complex plane. The Walsh transform of the colorimage is calculated in all three R, G and B planes. The complexrows representing sal components of the image and the real rowsrepresenting cal components are checked for positive andnegative signs. The sal and cal Walsh values are assigned to eachquadrant. as follows:T
ABLE
I.
F
OUR
W
ALSH
S
ECTOR FORMATION
Sign of SalSign of CalQuadrant Assigned+ +
I (0 – 90 Degrees)
+ -
II ( 90 – 180 Degrees)
- -
III( 180- 270 Degrees)
- +
IV(270–360 Degrees)The equation (1) is used to generate individual components togenerate the feature vector of dimension 12 considering three R,G and B Planes in the sal and cal density distribution approach.However, it is observed that the density variation in 4 quadrantsis very small for all the images. Thus the feature vectors havepoor discretionary power and hence higher number of sectors suchas 8, 12 and 16 were tried. In the case of second approach of feature vector generation i.e. individual sector mean has betterdiscretionary power in all sectors and equation (2) is used togenerate the individual sector components.
__________________________________
√
(mean of sal vector)
2
+ (mean of cal vector)
2
(2)
Sum of absolute difference measure is used to check thecloseness of the query image from the database image and
342http://sites.google.com/site/ijcsis/ISSN 1947-5500