• Sonuç bulunamadı

Appendix III

N/A
N/A
Protected

Academic year: 2021

Share "Appendix III"

Copied!
1
0
0

Yükleniyor.... (view fulltext now)

Tam metin

(1)

Appendix III

Averaging function:

[x1 y1]=size(image);

x2=x1/a ; y2=y1/b;

for ii=1:x2 for jj=1:y2 som=0;

for i1=1+a*(ii-1):a*ii for j1=1+b*(jj-1):b*jj

som=som + image(i1,j1);

end;

end;

averaged_photo(ii,jj)=som/(a*b) ; end;

end;

vector=reshape(averaged_photo,[],1);

%averaged_mat_imag=[averaged_mat_imag vector];

Images reading and preprocessing

clear clc

person_number = 50;

ph_per_person = 1;

alpha=5; % downsampling factor

a=2; b=2; % a and b are the averaging parameters

vertical_images=1; horizontal_images=1; % parameter for segmentation v*h images

verhor=vertical_images * horizontal_images ; save('verhor');

save('horizontal_images');

save('vertical_images');

cd('D:\Neural Networks\Program\fullprogram\Training 1');

III-1

(2)

averaged_mat_imag=[];

for l=1:person_number for k=1:ph_per_person

aaa=strcat([num2str(k),' (',num2str(l),').jpg']) ; image=imread(aaa); % image=rgb2gray(image);

[x y]=size(image);

if mod(x,alpha)~=1 x=x-rem(x,alpha);

end

if mod(y,alpha)~=0 y=y-rem(y,alpha);

end x=x/alpha;

y=y/alpha;

for xs=1:x for ys=1:y

im(xs,ys)=image(2*xs,2*ys);

end;

end;

image=im;

averaging; % application of function [x y]=size(averaged_photo);

x11=floor(x/vertical_images);

y11=floor(y/horizontal_images);

for i=1:vertical_images %segmentation loop for j=1:horizontal_images %segmentation loop

i1=1 + x11*(i-1):x11*i;

j1=1+y11*(j-1):y11*j ;

imagenew = image(i1,j1); %display(i1) %display(j1)

mat_total{i,j,l,k}=imagenew; %imshow(imagenew) vector_image=reshape(imagenew,[],1);

vector_total{i,j,l,k}=vector_image;

end;

end;

end end

III-2

(3)

cd ('D:\Neural Networks\Program\fullprogram\Training 1');

for i=1:vertical_images for j=1:horizontal_images for k=1:ph_per_person for l=1:person_number if l==1, input=[]; end

input=[input vector_total{i,j,l,k}];

end

if k==1, input1=[]; end

input1=[input1 input];

end

aa=strcat(['inputmat',num2str(i),num2str(j)]);

save(aa,'input1');

end end

images vectorazing

clc close

load('horizontal_images');

load('vertical_images');

neural_input=[];

for i=1:vertical_images for j=1:horizontal_images

aa=strcat(['inputmat',num2str(i),num2str(j),'.mat']);

load(aa);

neural_input=[neural_input input1];

end;

end;

save('neural_input');

target=[];

tar=eye(50);

load('verhor');

for i=1:1*verhor target=[target tar];

end;

save('target');

III-3

Referanslar

Benzer Belgeler

Otoların parka çekilmesi için bu husu- sun ehemmiyeti az ise de; tahdit edilmiş sahalar dahi- linde manevra icrasının kolaylığı; her araba için lü- zumlu dönüş

computer engineering department for their courses '. 'which formed the basis for

[r]

A- The teacher puts students into pairs and gives a copy of the student A worksheet to one student in each pair and a copy of the student B worksheet to his/her partner?. The

A.1 Characteristics of Aluminum Cable Steel Reinforced Conductors (ACSR)... A.2 Characteristics of All-Aluminum

Create Or Replace Function Empid Return

ORDBMS Object Relational Database Management System OSQL Object Structured Query Language. RDBMS Relational Database Management System SQL Structured

This extra experiment was carried out using dental radiography images that were not in the initial database. The dental radiography images were captured using a 12 Megapixel