I've recently learned that some smartpens (e.g. Livescribe) have a camera in their front part. They film the paper. You have to use special paper which looks as if somebody made a lot of tiny holes with a needle in that paper. Those holes are not in a regular pattern. They are spaced in such a way that the pen can decide - taking only an image of the part of the paper near the pen tip - where on the paper it is.
I can't get this problem out of my head. It's different from what I have seen so far and I am curious how this can be tackled / solved.
Now suppose we have
- ordinary A4 paper (210 mm × 297 mm),
- the camera can see an area $10 \text{mm} \times 10 \text{mm}$
- the dots on the paper are circles with diameter 0.5 mm
- a distance measuring (or printing) precision (of dots) of 0.1 mm
The filmed area $A$ is defined by its center point $(x,y)$. $$A(x,y) = [x-5\text{mm},x+5\text{mm}] \times[y-5\text{mm},y+5\text{mm}]$$ with $x \in [5,205], y \in[5, 292]$.
(How) can the points be spread on the paper so that each $A(x,y)$ is unique?
If it is not possible, how could the four values (paper size, camera area, circle diameter, precision) be adjusted so that it would work?
Brute-Force solution
A brute-force solution would be to add a grid of 0.1 mm spaced lines (because of the precision) on the paper. Then we could generate all possible distributions of points by simply counting up. However, this would require a lot of checking if a given distribution is valid:
- There are $\frac{205\text{mm}-5\text{mm}}{0.1 \text{mm}} \cdot \frac{292\text{mm}-5\text{mm}}{0.1 \text{mm}} = 5,740,000$ possible centers for the pen tip.
- We would have to compare each of those, resulting in $\frac{5,740,000^2 + 5,740,000}{2} = 16,473,802,870,000 \approx 16 \cdot 10^{12}$ comparisons.
That is too much.
Apart from precision issues, all you need is to distribute the dots in such a way that