function part = partition(image)
% compute a partition of the image,
% currently using 2 gradients and the average intensity


%F = features(image);

%part = ...
%   8*8*quantize(F(:,:,3),8) + ...
%   8*quantize(F(:,:,4),8) + ...
%   quantize(F(:,:,7),8);

F = [-1 1];
fimage = replicateConv(image, fspecial('gaussian', 5, 1.5));
avg = replicateconv(image, [1 1;1 1]/4);
dx = replicateconv(fimage, F);
dy = replicateconv(fimage, F');
dxq = quantize(smoothstep(5, dx/256+0.5), 10);
dyq = quantize(smoothstep(5, dy/256+0.5), 10);
avgq = quantize(avg, 4);
part = 10*4*dxq + 4*dyq + avgq;
