function [I1,I2]=test(cen,level)
% cen = center of circle [x,y]
%level = level of noise 0.01-0.2 for 1% to 20%
n=32; % size of image n*n
r=4; %radius of circle
[X,Y]=meshgrid(1:n,1:n);

%object
I1=zeros(n); I2=zeros(n);
id1=((X-cen(1)).^2+(Y-cen(2)).^2 <= r^2); %circle
id2=(X<=cen(1)+r)&(X>=cen(1)-r)&(Y<=cen(2)+r)&(Y>=cen(2)-r); %square

I1(id1)=0.7; I2(id2)=0.7; %maximum intensity is 0.7

%noise
%level=0;
I1=I1+level*randn(n); I1(I1>1)=1; I1(I1<0)=0; %circle
I2=I2+level*randn(n); I2(I2>1)=1; I2(I2<0)=0; %square

%subplot(1,2,1); imshow(I1); subplot(1,2,2); imshow(I2);

