function [I,K] = generate_letter_samples(ni,nk,sigI,sigK)

%Generates a sequence of iamges representing letters I and K
%The images are contaminated by Gaussian white noise
%ni - number of instances of letter I
%nk - number of instances of letter K

%Author: Zoran Nenadic DSc, June 18, 2010
%UC Irvine


load LI.mat
load LK.mat

%find the maximum of I and K
MI = max(max(LI));
MK = max(max(LK));

Noise_I = sigI * randn([size(LI),ni]);
I = zeros([size(LI),ni]);

Noise_K = sigK * randn([size(LK),nk]);
K = zeros([size(LK),nk]);

disp(['generating ' num2str(ni) ' noisy samples of letter I'])
for i = 1:ni
    I(:,:,i) = LI + Noise_I(:,:,i);
end

disp(['generating ' num2str(nk) ' noisy samples of letter K'])
for i = 1:nk
    K(:,:,i) = LK + Noise_K(:,:,i);
end

end

