
oriimg=im2double(oriimg);
figure;
% for cnn
% some other image processing ?

% tf=6 (?), displayTime=1
%diffimg=diffuse(oriimg,6,1);

%oriu = im2double(max(max(oriimg)));
%oril = im2double(min(min(oriimg)));
%oriimg = (oriimg-oril)/(oriu-oril)*2-1;
%subimg=oriimg-diffimg;
%absimg=abs(subimg);
%scaleimg=5*absimg;  % this morning: absimg.*absimg

% tf=100-150 (?)

%better alg. ??

fallimg=falling(oriimg,50,1);
diffimg=diffuse(oriimg,5,1);
subimg=oriimg-diffimg;

% wanna try use oriimg here ??
maskimg= subimg .* fallimg;
maskimg2=maskimg*2;

% maskimg2 isn't as good as finalimg
%eCnnmask2=edge(maskimg2,'canny');
%figure;imshow(eCnnmask2);title('maskimg2-alg2');

finalimg=maskimg2+0.5*diffimg;
eCnn2=edge(finalimg,'canny');
figure;imshow(eCnn2);title('finalimg-alg2');


