DSP PROCESSOR BASED HIGH SECURITY IMAGE ATHENTICATION SYSTEM
Project Proposal Submitted for
Funding to
BY
Mayuri Jain
Vivek Jain
([Link] Students)
DEPARTMENT
OF
ELECTRONICS &
COMMUNICATION
ENGINEERING
Techno India NJR
Institute of
Technology(RTU
affiliated),
Plot-SPLT,
Bhamashah(RIICO)
Industrial area,
Kaladwas
Udaipur-313001(Rajasthan)
Form A
Form No ....
(for official use only)
1. Title of the Project: DSP Processor Based High Security Image Authentication System
2. Discipline/ Subject Area: Engineering/Electronics & Communication Engineering/ Digital
Video Processing.
3. Region (Regional Office area of jurisdiction: - Udaipur
4. Designation & Address of the Person, in whose name, Demand Draft/Bankers
Cheque of grant is to be sent. (Head of Institution/Director/Registrar/ Controller/
Principal/Dean) :
Dean , Techno India NJR Institute of Technology, Udaipur
5. Name & Class/Year of the Students (indicate clearly the semester in case of semester system)
Rahul Menaria, [Link], IV Year, ECE, Techno NJR, Udaipur
Toshal Pandya, [Link], IVYear, ECE, Techno NJR, Udaipur
6. Address of the Students
Institutional Address Correspondence Address:
Rahul Menaria Mayuri Jain, D/O Shri Jaswant Singh Jain
Student, [Link] IV Year, ECE
Techno India NJR Institute of 1-Pa-8, Gayatri Nagar,
Technology(RTU affiliated)
Plot-SPLT, Bhamashah(RIICO) Industrial area, Sector No.-5, Hiran Magri, Udaipur-313002
Kaladwas
Udaipur-313001(Rajasthan)
Mobile No: 9929474074 [Link]: mayurijn8@[Link]
Institutional Address Correspondence Address:
Vivek Jain Vivek Jain,
Student, PhD, I Year, ECE
College of Technology & Eemngineering 16 J Shivaji Nagar
Maharana Pratap University of Agriculture & Udaipur ,Rajasthan
Technology
Udaipur-313001 [Link]: eng_vivekjain@[Link]
7. a) Name & Designation of the Supervisor/Guide : Mrs. Isha Purbia, Assistant Professor
Department of Electronics & Communication Engineering, Techno India NJR,Udaipur
b) Institutional & Correspondence Address of the Guide with Telephone No. E-mail ID &
Fax, Mobile No.
Institutional Address Correspondence Address:
Mrs. Isha Purbia Mrs. Isha Purbia
Assistant Professor Assistant Professor
College of Technology & Engineering Deptt. of Electronics & Communication
Engineering, Techno India NJR,Udaipur
Maharana Pratap University of Agriculture & Udaipur-313001
Technology, Udaipur-313001
[Link]: isha_suwalk3@[Link] [Link]. :9636495453
Name & Signature of the Students Signature of Guide of the Project
1. (Mrs. Isha Purbia)
2. Vivek Jain
Title of the Project: DSP Processor Based High Precision Image Capturing System
Project Summary:
In the following project we are capturing a real time image which has some inherent
Additive white Gaussian noise produced in it due to various environmental effects such
as fog, rain droplets, sand dunes etc. This image is blurred due to environmental
interference. This interference is removed by equalizer. Equalizers are basically FIR
Filters. FIR Filter is Linear Time invariant system in which the response of the system is
dependent upon the coefficients of the filter. This type of technique is known as linear
equalizer, but the drawback of this LTI system is that its coefficients are constant for all
the environmental conditions. But what we want is that the value of the coefficients
should change according to the atmospheric conditions. The solution to this problem is
adaptive equalizer; in this system the filters adapt themselves according to the
atmospheric conditions. In this we are considering three environmental conditions i.e.
rain, fog, sand dunes, accordingly the filter will adapt three different sets of coefficients
for three different environmental conditions. By taking discrete cosine transformation of
the image with the help of TMS320C671, the image is passed through the adaptive filter
to remove the distortion or the noise content through it. Then the image is reconstructed
by the inverse discrete cosine transformation. Now the new image which is reconstructed
is free of noise.
Technical details of the Projects
Origin of the proposal:
When we capture an image of the number plate from the running vehicle, we get a
blurred image and we are unable to read the number of the number plate of the concerned
vehicle. Therefore we require a technique to either faithfully capture or recover the image
of the object of our concern.
Definition of the Problem:
In the current scenario, it is very difficult to recognize the details about the running
vehicles under adverse natural conditions like in fog, rain, sandy storms and low visibility
weather conditions. Here, we are willing to implement a system which can act as a boon
in this field and immune from all these limitations. For this we wish to take an assistance
of DSP processor for hard ware burning of the system ready for implementation after
field testing.
Objective:
To remove the additive white Gaussian Noise from the real time captured image.
Work Plan:
The real time captured image is first converted into pixel matrix by Discrete Cosine
Transform, then we convolute these pixel values with the coefficients of the adaptive
filter (adaptive FIR Filter), in this way we remove the noise from the image and recover it
by taking inverse cosine transformation. All these operations will be carried on the DSP
Processor TMS320C6713 DSK.
Methodology and System Flow Chart:
All these operations are performed by writing the C codes and generate the .out file and
this .out file is burned on DSP Processor TMS320C6416 DSK.
FLOW CHART
Study of the literature (Discrete Cosine Transform, FIR filters,
adaptive & linear equalizers& affect of noise on the image)
Theoretical calculations for the coefficients of the filter according
to the environmental conditions (rain, fog & sand dunes)
Preparation of the operational platform to capture the real time
image from the camera and passing it through the adaptive
equalizer to remove the additive white Gaussian noise.
Taking Discrete Cosine Transformation of the image using DSP
Processor Board TMS320C6713 DSK.
Pass the image through the adaptive filter to remove the
distortion produced due to AWGN.
Captured image is reconstructed by the inverse discrete
cosine transformation.
Image captured by the camera is free of distortion produced due
to AWGN.
Organization of work element:
Video acquired Video is converted to frames and Frame Image is compared
Discrete Cosine transform is and identified and then
Using camera done. Inverse Discrete Transform
Coding in CCS Simulator & Implementation on DSK 6416 DSP Processor by burning .out file
Image Authenticated using processor
Experimental setup
Time schedule:
Work plan Weeks
literature survey 4
Learning of DSP Processor TMS320C6713 DSK 4
Study of FIR Filters 2
Coding 4
Implementation on Hardware 4
Testing & report 2
Total 20
College facility:
[Link] Equipment Quantity Cost
1 Personal 1 RS 25000
computer
2 On DSP 2 RS 50000
Processor
TMS320C6713
3 DSO 1 RS 19000
4 Function 1 Rs 6500
generator
Minor Equipment:
[Link] Equipment Quantity Cost
1 Minor 1 Rs 8700
Equipment
2 Report writing 2 Rs1000
3 Contingency & - Rs2000
other costs
4 LCD Screen 1 Rs 3000
Total Rs.14700
Utilization of the outcome of project:
This project helpful in removing the Additive white Gaussian noise from Real time capturing
image and increase the quality of the image. It will be a system which can act as a boon in the
field of image processing applications and make the system immune from all the limitations like
fog, rain, sandy storms and low visibility weather condition for running vehicles.
IMPLEMENTATION
Code for linear convolution
Linear Convolution Involves the following operations.
[Link]
[Link]
[Link]
4. Shifting
These operations can be represented by a Mathematical Expression as follows:
x[ ]= Input signal Samples
h[ ]= Impulse response co-efficient.
y[ ]= Convolution output.
n = No. of Input samples
h = No. of Impulse response co-efficient.
C program for Linear convolution.
#include<stdio.h>
main()
int m=4; /*Lenght of i/p samples sequence*/
int n=4;
/*Lenght of impulse response Co-efficients */
int i=0,j;
int x[10]={1,2,3,4,0,0,0,0};
/*Input Signal Samples*/
int h[10]={1,2,3,4,0,0,0,0};
/*Impulse Response Co-efficients*/
/*At the end of input sequences pad M and N no. of zeros*/
int y[10];
for(i=0;i<m+n-1;i++)
{y[i]=0;
for(j=0;j<=i;j++)
y[i]+=x[j]*h[i-j];
for(i=0;i<m+n-1;i++)
printf("%d\n",y[i]);
INPUT: OUTPUT:
x[n] = {1, 2, 3, 4}
h[k] = {1, 2, 3, 4} y[i] = { 1, 4, 10, 20, 25, 24, 16,38}
Code for DFT
#include <math.h>
#define PTS 64 //# of points for FFT
#define PI 3.14159265358979
typedef struct {float real,imag;} COMPLEX;
void FFT(COMPLEX *Y, int n); //FFT prototype
float iobuffer[PTS]; //as input and output buffer
float x1[PTS]; //intermediate buffer
short i; //general purpose index variable
short buffercount = 0; //number of new samples in
iobuffer
short flag = 0; //set to 1 by ISR when iobuffer
full
COMPLEX w[PTS]; //twiddle constants stored in w
COMPLEX samples[PTS]; //primary working buffer
main()
{
for (i = 0 ; i<PTS ; i++) // set up twiddle constants in w
{
w[i].real = cos(2*PI*i/(PTS*2.0)); //Re component of twiddle
constants
w[i].imag =-sin(2*PI*i/(PTS*2.0)); //Im component of twiddle
constants
}
for (i = 0 ; i < PTS ; i++) //swap buffers
{
iobuffer[i] = sin(2*PI*10*i/64.0);/*10- > freq,
64 -> sampling freq*/
samples[i].real=0.0;
samples[i].imag=0.0;
}
for (i = 0 ; i < PTS ; i++) //swap buffers
{
samples[i].real=iobuffer[i]; //buffer with new data
}
for (i = 0 ; i < PTS ; i++)
samples[i].imag = 0.0; //imag components = 0
FFT(samples,PTS); //call function FFT.c
for (i = 0 ; i < PTS ; i++) //compute magnitude
{
x1[i] = sqrt(samples[i].real*samples[i].real
+ samples[i].imag*samples[i].imag);
}
} //end of main
Code for IDFT
#define PTS 64 //# of points for FFT
typedef struct {float real,imag;} COMPLEX;
extern COMPLEX w[PTS]; //twiddle constants stored in w
void FFT(COMPLEX *Y, int N) //input sample array, # of points
{
COMPLEX temp1,temp2; //temporary storage variables
int i,j,k; //loop counter variables
int upper_leg, lower_leg; //index of upper/lower butterfly leg
int leg_diff; //difference between upper/lower leg
int num_stages = 0; //number of FFT stages (iterations)
int index, step; //index/step through twiddle
constant
i = 1; //log(base2) of N points= # of stages
do
{
num_stages +=1;
i = i*2;
}while (i!=N);
leg_diff = N/2; //difference between upper&lower legs
step = (PTS*2)/N; //step between values in twiddle.h
for (i = 0;i < num_stages; i++) //for N-point FFT
{
index = 0;
for (j = 0; j < leg_diff; j++)
{
for (upper_leg = j; upper_leg < N; upper_leg += (2*leg_diff))
{
lower_leg = upper_leg+leg_diff;
[Link] = (Y[upper_leg]).real + (Y[lower_leg]).real;
[Link] = (Y[upper_leg]).imag + (Y[lower_leg]).imag;
[Link] = (Y[upper_leg]).real - (Y[lower_leg]).real;
[Link] = (Y[upper_leg]).imag - (Y[lower_leg]).imag;
(Y[lower_leg]).real = [Link]*(w[index]).real
-[Link]*(w[index]).imag;
(Y[lower_leg]).imag = [Link]*(w[index]).imag
+[Link]*(w[index]).real;
(Y[upper_leg]).real = [Link];
(Y[upper_leg]).imag = [Link];
}
index += step;
}
leg_diff = leg_diff/2;
step *= 2;
}
j = 0;
for (i = 1; i < (N-1); i++) //bit reversal for
resequencing data
{
k = N/2;
while (k <= j)
{
j = j - k;
k = k/2;
}
j = j + k;
if (i<j)
{
[Link] = (Y[j]).real;
[Link] = (Y[j]).imag;
(Y[j]).real = (Y[i]).real;
(Y[j]).imag = (Y[i]).imag;
(Y[i]).real = [Link];
(Y[i]).imag = [Link];
}
}
return;
}
Code For Adaptive FIR Filter
#include "xyzcfg.h"
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#define beta 1E-12 //rate of convergence
#define N 30
short int adaptive_filter(short int ,short int );
float delay[N];
float w[N];
//union{unsigned int uint; short channel[2];} AIC23_data;
DSK6713_AIC23_Config config = {\
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */ \
0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume */\
0x00d8, /* 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */ \
0x00d8, /* 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */ \
0x0011, /* 4 DSK6713_AIC23_ANAPATH Analog audio path control */ \
0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */ \
0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */ \
0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */ \
0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */ \
0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */ \
};
/*
* main() - Main code routine, initializes BSL and generates tone
*/
void main()
{
DSK6713_AIC23_CodecHandle hCodec;
int l_input, r_input;
int l_output, r_output;
/* Initialize the board support library, must be called first */
DSK6713_init();
/* Start the codec */
hCodec = DSK6713_AIC23_openCodec(0, &config);
DSK6713_AIC23_setFreq(hCodec, 1);
while(1)
{
/* Read a sample to the left channel */
while (!DSK6713_AIC23_read(hCodec,&l_input));
/* Read a sample to the right channel */
while (!DSK6713_AIC23_read(hCodec, &r_input));
l_output=(short int)adaptive_filter(l_input,r_input);
r_output=l_output;
/* Send a sample to the left channel */
while (!DSK6713_AIC23_write(hCodec, l_output));
/* Send a sample to the right channel */
while (!DSK6713_AIC23_write(hCodec, r_output));
}
/* Close the codec */
DSK6713_AIC23_closeCodec(hCodec);
}
short int adaptive_filter(short l_input1,short r_input1) //ISR
{
short i,output,T;
float yn=0, E=0, dplusn=0, desired=0, noise=0;
for (T = 0; T < 30; T++)
{
w[T] = 0; //init buffer for weights
delay[T] = 0; //init buffer for delay samples
}
desired = l_input1;
noise = r_input1;
dplusn = desired + noise; //desired+noise
delay[0] = noise; //noise as input to adapt FIR
for (i = 0; i < N; i++) //to calculate out of adapt FIR
yn += (w[i] * delay[i]); //output of adaptive filter
E = (desired + noise) - yn; //"error" signal=(d+n)-yn
for (i = N-1; i >= 0; i--) //to update weights and delays
{
w[i] = w[i] + beta*E*delay[i]; //update weights
delay[i] = delay[i-1]; //update delay samples
}
output=((short)E); //error signal as overall output
//output=((short)dplusn);//output (desired+noise)
//overall output result
return(output);