% THIS DOES CONTAIN ERRORS
[ii,jj] = ndgrid(-10:10,-10:10);
ii
jj
I = ii.^2 + jj.^2
I = I/100;
imshow(I)
shg
I = ii.^2;
I = I/100;
imshow(I)
shg
I = jj.^2;
I = I/100;
imshow(I)
shg
I = 1/2*(-ii+jj).^2;
I = I/100;
imshow(I)
shg
iptsetpref('ImshowInitialMagnification','fit') % run at begining so imshow will magnify automatically
imshow(I)
shg
I = uint8(I*255);
I = double(I)/255;
imshow(I)
shg
dIdi = imfilter(I,[-1 0 1]');\
dIdi = imfilter(I,[-1 0 1]');
dIdj = imfilter(I,[-1 0 1]);
imshow(dIdi)
shg
dIdi = imfilter(I,[-1 0 1]','replicate');
dIdj = imfilter(I, [-1 0 1],'replicate');
imshow(dIdi)
shg
imshow(dIdi+0.5)
shg
makeEdgeImage(dIdi,dIdj)
shg
dIdidi = imfilter(dIdi,[-1 0 1]','replicate');
dIdidj = imfilter(dIdi,[-1 0 1],'replicate');
dIdjdi = imfilter(dIdj,[-1 0 1]','replicate');
dIdjdj = imfilter(dIdj,[-1 0 1],'replicate');
imshow(dIdidi)
shg
imshow(dIdidi*109)
imshow(dIdidi*10)
shg
imshow(dIdidi*20)
shg
imshow(dIdjdj*20)
shg
imshow(dIdidj*20)
imshow(dIdidj*20+0.5)
shg
imshow(dIdjdi*20)
shg
dIdjdi
ls
imshow(dIdidi)
shg
imshow(dIdidi*29)
imshow(dIdidi*20)
shg
I = 1/2*(-ii+jj).^2;
I = i/2*(ii.^2-2*ii.*jj+jj.^2);
I = I/100;
I = uint8(I*255);
I = double(I)/255;
imshow(I)
I = 1/2*(ii.^2-2*ii.*jj+jj.^2);
I = I/100;
I = double(uint8(I*255))/255; % Quantize
imshow(I)
shg
I = ii.^2 + jj.^2;
I = I/100;
I = double(uint8(I*255))/255; % Quantize
dIdi = imfilter(I,[-1 0 1]','replicate');
dIdj = imfilter(I, [-1 0 1],'replicate');
dIdidi = imfilter(dIdi,[-1 0 1]','replicate');
dIdjdi = imfilter(dIdj,[-1 0 1]','replicate');
dIdidj = imfilter(dIdi,[-1 0 1],'replicate');
dIdjdj = imfilter(dIdj,[-1 0 1],'replicate');
imshow(dIdidi)
shg
imshow(dIdidi*10)
shg
imshow(dIdjdj*10)
shg
imshow(dIdidj*10)
shg
imshow(dIdidj*10+0.5)
shg
imshow(dIdidj*10)
shg
imshow(dIdidj)
shg
imshow(dIdidj*10)
shg