Future Work
The areas of improvement are attributed to each of the three components. The camera on the pen needs to be more specialized, which means that it should be smaller and with a more compact lens that is designed to work up close with the object it is taking a picture of. This would drastically reduce the blurring I was getting around the edges. Special light can be attached beside the camera so the lighting does not depend so much on the environment that the user is in.
The pattern and paper can be improved by using a laser printer to print the pattern, which eventually could be sold to the user. With a higher resolution printer there is also possibility to hide pattern in other areas on the page using special ink that blends into the paper, but can be seen by the camera. For example, customized printer can print the pattern using special reflective ink that is eliminated to the camera by an infrared light.
The software needs further optimization for speed and perspective. Speed improvements can be accomplished by pipelining operations such as application of a kernel (smoothing, Sobel operator, etc) to the image. The edge detection can be improved by using scale-adaptive algorithm, which would improve the results where parts of the image are blurred due to the camera lens being too close to the paper (J.H. Elder). If improvements are done to the paper such that the software is able to see and detect more integers from the pattern, then better perspective could be calculated by using the eight point algorithm (to find fundamental matrix) and rectification. Another idea is to provide user with a graph paper, which has more lines that are closer spaced together. This will most likely fit the necessary 8 points inside a single photograph.