AI

CH-4 – Wavelets Feature Extraction – Part-7

Important Note: This article is part of the series in which TechReport.us discuss theory of Video Stream Matching.

There are two Algos are discus. One for wavelets coefficient values and second one is according to paper.[6]

4.4.4.1 Algorithm 8

Input:

BMP Image

Output:

Array Of Numerical values define the Wavelets Coefficient values property.

Working:

It takes an Image and converts it into gray scale if it is not already in gray scale. For wavelets it apply wavelets HARR on image and return coefficient values.

Step 0 : Start

Step 1 : Takes input an Image (im).

Step 2 : If (im) in gray scale

If not

then

convert (im) into gray scale.

Step 3 : (im1) = Apply Padding to make it into power of two (im)

Step 4 : (I , J) = Size (im1)

Step 5 : Apply Filter(im1,’gaussian’,[5 5],1.4)

Step 6 : [ cA , cH , cV , cD ] = dwt2(im1,’haar’); // Apply HAAR transformation

Step 7 : t = graythresh(cA); // Apply Threshold on cA

Step 8 : Loop1: for I =rows of (cA)

Step 9 : Loop2: for J = columns of (cA)

Step 10 :

if cA(i,j) < t

cA(i,j) =0;

end

Step 11 : end Loop1

Step 12 : end Loop2

Step 13 : Return (cA)

Step 14 : Stop

4.4.4.2 Algorithm 9

Input:

BMP Image

Output:

Array Of Numerical values define the Wavelets positive and negative values property.

Working:

It takes an Image and converts it into gray scale if it is not already in gray scale. For wavelets it apply wavelets HARR on image and return matrix which is consist on each tiles positive values and negative values.

Step 0 : Start

Step 1 : Takes input an Image (im).

Step 2 : If (im) in gray scale

If not

then

convert (im) into gray scale.

Step 3 : (im1) = Apply Padding to make it into power of two (im)

Step 4 : (I , J) = Size (im1)

Step 5 : Apply Filter(im1,’gaussian’,[5 5],1.4)

Step 6 : [ cA , cH , cV , cD ] = dwt2(im1,’haar’); // Apply HAAR transformation

Step 7 : imadd = cH+cV; // combine horizontal and vertical effects

Step 8 : [r c] = size(imadd);

nc=0;

pc=0;

wp=1;

wn=1;

wh=1;

Step 9 : Loop1: for I =1:16:r // make tiles of image (imadd)

Step 10 : Loop2: for J = 1:16:c

Step 11 :

if imadd(g,k)>0

pc=pc+1;

else

nc=nc+1;

end

wpmat(wh,wp)=pc; // after each tile do this

wnmat(wh,wn)=nc;

wp=wp+1;

wn=wn+1;

pc=0;

nc=0;

Step 12 : end Loop1

wh=wh+1;

wp=1;

wn=1;

Step 13 : end Loop2

Step 14 : out = [ wpmat(:); wnmat(:)];

Step 15 : Return (out)

Step 16 : Stop

Ali Imran
Over the past 20+ years, I have been working as a software engineer, architect, and programmer, creating, designing, and programming various applications. My main focus has always been to achieve business goals and transform business ideas into digital reality. I have successfully solved numerous business problems and increased productivity for small businesses as well as enterprise corporations through the solutions that I created. My strong technical background and ability to work effectively in team environments make me a valuable asset to any organization.
https://ITsAli.com

Leave a Reply