File | Date | Author | Commit |
---|---|---|---|
.hgtags | 2013-09-21 |
![]() |
[d8a345] Added tag NoteTakerPen-1.1 for changeset 7eb3a3... |
Note2SVG.py | 2013-09-24 |
![]() |
[f7603e] Rather than greying out ends unconditionally, d... |
Peg_NoteTaker.py | 2013-09-22 |
![]() |
[bc2c94] Option to prevent reattaching kernel drivers. |
README.md | 2013-09-23 |
![]() |
[b2c18a] Add USB ID to README. |
PegaTech's NoteTaker is a digital pen which consists of two devices.
One pen with a real ballpoint (and some additional infrared device)
and a receiver, that can be connected to your PC via USB.
You can use the pen like a regular pen with regular paper -- the
receiver will in addition record the strokes you make.
See Pegasus Technologies web site
The tools allow you to retrieve the Notes stored on the receiver and
to erase the memory. You can also retrieve notes live. The notes can
be saved in raw format (sets of coordinates with pen-up events inserted)
or be converted to SVG.
The software consists of two python files.
Peg_NoteTaker.py
is the lowlevel driver that knows how to talk toPeg_NoteTaker.py
implements the protocol documented atNote2SVG.py
converts a list of notes and paths (as produced byPeg_NoteTaker.py
-- other drivers could be implemented) and producesIn order to use this software, you need
There's currently no man page.
However, both files have a reasonable help functions.
Call Peg_NoteTaker.py -h
and Note2SVG.py -h
to see usage information.
To understand the values in brackets in the help function: The first value is the
default value; the second one is a suggestion if you want to make the effect of
this more pronounced (but it's not the maximum, you can do more if you really
want).
SVG has been chosen, as it's a simple, standardized and well-supported format
for vector graphics. It's an obvious choice for handwriting. As it stores
a path, it's indeed scalable, resulting in smooth lines even at high
magnification.
If you just connect the recorded points with straight lines, the result does
not look very nice. Use Note2SVG.py -B -s
to check the result.
The reason is that the pen has a somewhat limited precision
and more importantly, does only record a limited number of points per second.
So in order for the SVG path to resemble your writing better, some optimizations
are done. The most important one is using Bezier Curves rather than straight
lines.
Here's a list of steps that are taken by Note2SVG.py after acquiring the data
from the device or a saved file through the driver:
-T
and -R
)-c
controls this (by default this is disabled).-d
option. The default is small enough that you will-C
, the default only disconnects points really far apart.-s 1
we-S 1
would move them all the way to fall on the Bezier curve and-D
-p
.-B
.-x
and -x 0.1
means that the ends-g
(automatically set in live mode), those last-y
varies the thickness and opacity a bitYou can visualize the postprocessing optimizations done here. With option -v
,
all retained points are drawn with darkred circles; the dropped points from steps
3 and 7 are drawn in yellow. When points have been moved in step 5 and 6, the
original points are drawn in lightblue. Connections that have been made in
step 2 are drawn with a blue line. Disconnected paths (step 4) are connected
with a red line.
With option -V
, in addition the control points for the Bezier curves (step 9)
are drawn as green circles.
Note2SVG.py
will report something like this:
Save note 4 to Note-20130921_175608-004.svg
2116 pts: (1 sing, drop 53 dup + 59 smooth, 642 moved in lowpass)
10 paths: (0 conn, 1 disconn)
The numbers reported here refer to the number of (retained) points in a note,
the number of points that are singular (not connected), the number of points
dropped in steps 3 and 7 and the points moved in step 5. Finally the number
of paths in a note is reported as well as the number of connections that
has been made (step 2) and disconnections (step 4).
A note on the units for the options -c
, -d
, -C
: My device reports
coordinates as 16bit values at 1200dpi; the
calculations are done in these units and the parameters for divers options are
in these units (or squares of the units). When we start to support other devices with
different resolutions, we'll probably have to change the interface and internal
math to work with real (device-independent) units such as e.g. mm.
Substantial work has gone into the SVG optimization; you'll need to remember
your geometry lessons from school (how to calculate normal vectors, how
to use dot products to do projections, etc.) and read up on Bezier
curves to fully appreciate the code.
I'm not associated with PegaTech.
I publish this purely out of joy as an open source contribution, hoping that
this might be useful for others and hoping that others may contribute with
useful suggestions, patches, bug reports and the like.
The code is published under the GNU General Public License (GPL) version 2 or
version 3 (at your option).
I can not take responsibility for anything that goes wrong when you use this
software. It may not be fit for purpose and there is a remote possibility that
you may destroy your hardware or lose important data. There's no warranty
whatsoever.
-f
orce is useddrivers/usb/core/devio.c
.