function A = k4(inp,blksize,skip,type)
% this function finds the separation between bands, based upon max-min 
% filtering.
% parameters:
% inp : input image
% res : result image inwhich the separation pixels are 1
% blksize : the bloksize in which the image is divided up and in which
% 	separation rows are found
% type = 1 lane separators; type = not 1 : middle of lanes

perc=0.75 % autocorrelation percentage for filterwidth
fact1=0.03;
fact2=0.0;
filtsize=(corper(inp',perc)-1)/2

R = kproc3(inp,blksize,filtsize,fact1,fact2,type);

[nr,nc] = size(R);

for i = 1:nc;
    i	
    if (R(1,i) == 1)
	A = [A,R(:,i)];
    else
	s = find_match(R(:,i),A,blksize,skip);
	if (s == -1)
	    A = new_lane(R(:,i),A,blksize);
	else
	    A = expank(R(:,i),A,s,blksize);
	end
    toc 
    end
end

[rg,cg]=size(inp);
res=lane2im(A,rg,cg);
toc
combo1(inp,res);
toc
axis normal;
text(0,-50,['row: ',num2str(blksize),' column: ',num2str(filtsize),' fact1: ',num2str(fact1),' fact2: ',num2str(fact2),' skip: ',num2str(skip)]);
%colormap(cool);
toc




