im = imread('d:\comp vision\images\travis.jpg');
im = rgb2gray(im);

% im = imresize(im,0.5);
% imshow(im)
% 
% freqcomp(im, 200, 0);


%freqcomp(im, 1000, .01);



%avfilt = averagefilter(size(im),21,21);      % average filter
%gafilter = fspecial('gaussian', size(im), 2);  % gaussian filter

newim = filter2(fspecial('gaussian', size(im), 8), im);


imagesc(newim),colormap(gray)

hori = [-1  0  1];
vert = [-1; 0; 1];

newimhori = filter2([-1  0  1], newim);
newimvert = filter2([-1; 0; 1], newim);



[BW, thresh] = EDGE(newim,'canny',[0.0500    0.1250]);
%thresh
%imagesc(BW),colormap(gray)
%0.0438    0.1094
imwritesc(BW, 'edge8.png');
%imwritesc(newimhori, 'newimhori8.png');
%imwritesc(newimvert, 'newimvert8.png');