Stylus Tracking

vision ece 3DPrint
Last Update: 2020-10-12

This project is a team project for our Computer Vision class. It is a prototype.

Initially, we wanted to reproduce this paper DodecaPen: Accurate 6DoF Tracking of a Passive Stylus. Their results are better than our results. The technique used is also much more complicated.

The dodecahedron is tracked with ArUco markers using OpenCV and plot the estimated position in an image, linking points as lines. A Kalman filter is used on the estimated positions to reduce noise.

We first tried a simple median filter but the Kalman filter offers much better results. The parameters of the filter were not optimized. Visual explanation of Kalman filter

Intrinsic and extrinsic camera calibrations are also done with OpenCV functions. The code is available here. After printing a dodecahedron, you can start the program by running the file (tested on 3 different linux systems).

Our system runs in a GUI inside a docker container, on a laptop, at around 10fps. The code is in python (except OpenCV, which is C++), single threaded and webcam resolution is 720p.

Drawing using Kalman filter
Drawing using median filter

The 3D dodecahedron and markers are generated using OpenSCAD and a script. STL available here.

Specular reflections make it harder for the black ArUco parts to be detected. Better detection is achieved by painting the black parts with mate paint.

The dodecahedron is printed in multiple parts for better precision and easier prototyping.

Specular reflection reduced with mate paint