function [ id ] = getCharId( I, Vectors, colvecs , data_base_size )

%data_base_size = 18;
rows_number = 64;
colums_number = 48;
vector_size = 48*64;

[stam k] = size(Vectors);

DBprojection = zeros(k,data_base_size);
imageProjection = zeros(k,1);
%figure;
%imshow(I);
%I=uint8(I);

id = 0;
 count=1;
    % for each row in original pic
    for i=1:rows_number
        % for each column in original pic
        for j=1:colums_number
            imageColumVec(count,1)=double(I(i,j));
            count=count+1;
        end
    end
%imageColumVec
DBprojection = Vectors' * colvecs;
imageProjection = Vectors' * imageColumVec;

%   k   data_base_size
%[size1 size2] = size(DBprojection)

for n=1:data_base_size
    sum = 0.0;
    for r=1:k
        sum = sum + (DBprojection(r, n) - imageProjection(r, 1))^2;
    end
    distances(n) = sqrt(sum);
end

for s=1:data_base_size
    if (distances(s) == min(distances))
        id = s;
    end
end


disp('Done');