function [output]=focus(input,pos,width)

%This function applies the focus filter
%Where the focus area's centre and width can be specified

[rows,cols]=size(input);
output=zeros([rows,cols]);
input=double(input);
ymin=pos-0.5*width;
ymax=pos+0.5*width;

for i=1:1:rows
    if (i<ymin)||(i>ymax)
        output(i,1:1:cols)=(input(i,1:1:cols)-60);
    else if (i==ymin)||(i==ymax)
        output(i,1:1:cols)=0;    
    else
        output(i,1:1:cols)=input(i,1:1:cols);
    end;
end;
output=uint8(output);
end;