function Combined= kproc(inp,blksize,filtsize,fact1,fact2)

[r,c]=size(inp);
Res = zeros(r+blksize,c);
R1 = proces(inp,blksize,filtsize,fact1,fact2);

[a,b] = size(R1);
Res(1:a,1:b) = R1;

Combined = zeros(blksize+1,1);

block = 1;
while (block - 1)*blksize + 1 < r,
    j = (block - 1)*blksize + 1;
    new_entry = zeros(blksize+1,c);
    count1 = 0;
    for i = 1:c,	    
	if Res(j,i) == 1
	count1 = count1 + 1;
	    new_entry(1,count1) = block;
	    new_entry(2,count1) = i;
	end
    end

    for k = 1:blksize-1,
	count = 0;
	for i = 1:c,	    
	    if Res(j+k,i) == 1
		count = count + 1;
		new_entry(k+2,count) = i;
	    end
	end	
    end

    Combined = [Combined,new_entry(:,1:count1)];
    block = block +1;
end

[n,m] = size(Combined);
Combined = Combined(:,2:m);


