A method of determining a regular grid pattern from a surface coded
pattern that comprises the regular grid pattern interleaved with a
further data carrying pattern wherein the surface coded pattern is
subject to perspective distortion, the method comprising: extracting a
set of straight line hypotheses from the coded surface pattern;
clustering the straight line hypotheses by orientation; for each cluster,
extracting a set of line pencil hypotheses; generating a set of regular
grid hypotheses from pairs of the line pencil hypotheses; and determining
the best regular grid hypothesis.