Lurker News

Comments (108) 21 threads

Earlier comments
sj4nz#
Fantastic. I love that this is brand-independent, like buying a mechanical keyboard.
tomp1 reply#
Very cool!

Could be useful for robotics / VR as well. One-camera hand tracking anyone?
Question: could you use gyro+accel to track pressure as well? Or at least "taps"?
Another question: how much does it cost? in particular, the pressure sensor...

jcparkyn1 reply#
1: You could absolutely use gyro/accel for detecting taps, but for proper pressure sensitivity (i.e., changing pressure in the middle of a stroke), there's not much you can do except have a pressure sensor. It's theoretically possible with a sufficiently accurate pose estimate and a springy pen tip, but not feasible at the level of accuracy I got.

2: I paid about $20 AUD for the pressure sensor, but they can be had for quite a bit cheaper (~$5 USD) in the US (https://www.arrow.com/en/products/hsfpar003a/alps-electric). Only problem is they're quite specialized, so not many places sell them. The custom PCB was another $10AUD, and the Arduino was about $20. There's a full parts list at https://github.com/Jcparkyn/dpoint/blob/main/setup-guide.md.

tomp1 reply#
another question: how do you estimate _depth_ - i.e. the dimension _away_ from the camera?

I'm guessing it's the size of the ArUco markers, combined with accelerometer for smoother tracking - but that seems quite imprecise?

jcparkyn#
That's done by the PnP solver, but yes it's essentially looking at the size of the aruco markers on the screen. This is implicit in the equation the PnP solver is trying to solve: "find the pose (position and orientation) that results in the minimum re-projection error for all the marker corners". Re-projection error is the difference between the observed 2D location of each marker corner, and the theoretical 2D location for a given pose (using standard camera projection equations).

You're right that this is the least precise dimension for PnP, but it turns out to be good enough if the corner positions are decently accurate. Using sub-pixel refinement for the corner locations helps a lot (this is built into OpenCV — it looks at the brightness values for multiple pixels around the corner to get an estimate more accurate than one pixel). Having corner positions further apart in 3D space helps as well, which is part of the reason I used two "rings" of markers.
In my case I was getting somewhere in the ballpark of 1-2mm of depth error at ~3cm away from the camera, so ~0.5% relative error. Smoothing from the accelerometer stops this from being noticeable most of the time, but it will sometimes crop up in bad conditions (e.g. if one of the markers is being missed on some frames due to lighting problems).

extraduder_ire2 replies#
Outside tracking with a camera is not something I would have thought of. Seems cool.

Reminds me of how sad I am nobody's done a good job of cheaply cloning the lighthouse tech that valve/htc use.

jcparkyn1 reply#
I should point out that I'm not the first person to use camera tracking for this [1], but to my knowledge there hasn't previously been a serious attempt to combine it with inertial or pressure sensors (which are both necessary for competing with graphics tablets) or make it open-source.

[1] http://media.ee.ntu.edu.tw/research/DodecaPen/

two_handfuls1 reply#
Isn’t camera tracking + inertial sensors exactly how the Oculus Rift headset & controller tracking worked?
jcparkyn#
Yes (or something like that, I don't know all the details), but they use infra-red light which requires a dedicated camera. I think they might also require more than one camera (although it is possible to do monocular IR tracking).
mtsr1 reply#
AFAIK you can actually get the sensors used for tracking at somewhat OK prices. But iirc the sensors actually do some part of the position calculations and as such aren’t simple enough to be really cheap.
r2_pilot#
Yep, they're actually just tiny solar panels! I got several trying to figure out how to use the lighthouse system. Not enough hours in the day and at the time there wasn't enough compute in a small package cheap enough for me.
ipsum21 reply#
Very cool! It has the added benefit of being able to manipulate objects in 3d. How does it compare to graphic tablets in terms of accuracy?
jcparkyn3 replies#
Currently it's not quite at the level of graphics tablets, but it's not too far off, and I think there's quite a bit of potential to improve it using similar techniques [1].

In terms of absolute accuracy, I measured an average error of 0.89mm (for the position of the tip) across the entire area of an A4 page with the camera in one place. In practice you have more precision than that though, because most of the errors are constant biases (not random noise).
For example, here's one of the tests [2] I did for the thesis, which compares the recorded stroke to what I actually wrote (scanned from carbon paper). After aligning the two captures (as a global 2D position offset, everything else is retained), the average distance from the recorded stroke to the scan was 0.158mm.
[1] This paper (which I linked in another comment) uses some more advanced techniques for pose estimation which could definitely be applied here (but it's closed-source, and I didn't have time to re-implement it from scratch): http://media.ee.ntu.edu.tw/research/DodecaPen/
[2] https://github.com/Jcparkyn/dpoint/files/13329235/main-sketc...

moritonal#
Brings back joyful memories of me begging random Professors from around the world over email for the source code of their papers.
abdullahkhalids#
Nice. It seems there is a systematic error towards the edges of the paper, which can easily be fixed in software.

Though it would be nice to do more tests. For example, there is some error when drawing sharp corners. It would be instructive to see how that changes as you change the angle, etc. And how that changes based on location on the paper.

orbital-decay#
One thing with using graphic tablets for handwriting and drawing in practice is you really want your stylus to be thin, lightweight (15-20g), and have either neutral center of gravity or balanced towards the tip slightly. Also preferably battery-free (non-Wacom tablets were forced to use batteries due to patents, not anymore).

Until it's solved, the better practical use for this is probably a controller for VR or 3D software.

Load more comments