An autocorrelation theory of form detection