load roses imagesc(xrose) imagesc(xfrisbee) xf = 2*double(xfrisbee)/255 - 1; xf = sum(xf,3); xr = 2*double(xrose)/255 -1; xr = sum(xr,3); imagesc(xf); colormap gray imagesc(xr); colormap gray w = xr(:) / norm(xr(:)); w' * xr(:) w' * xf(:) thr = (w' * xr(:) + w' * xf(:))/2 x=xr+1*randn(size(xr)); imagesc(x); (w' * x(:)) - thr x=xf+1*randn(size(xr)); imagesc(x); (w' * x(:)) - thr