Note: Descriptions are shown in the official language in which they were submitted.
FROr1:Lf~DRS PfURY '~16~ TO: 613 230 8E~21 ~UG 1. 1996 6:05PI'1 #317 P.05
-- ~18~627
.
WO95~1436 r~ s~ s3
IMP~VED I~)XM~TIO~ IN~VT ~PP~RATUS
~IELD OF THE INVE~TION '
The present invention relates to input device~
fas computer~ generally.
BACXGROUND O~ THE lNV~ ION
U.S. Paten~ 4,787,051 to-OlSon describes an
inertial mouse sy~tem which u6es three pair~ of a~cele~-
ometers.
U.S. Patent 4,839,836 to LaBiche et~ al. de-
scribe~ an appa~atu6 for ~roviding spatial orlentation
data ~lgnal~, U6~ ng an inertlal plat~orm acceleromPter
: cluster having a plurallty of aece~erometErs.
U.S. Patent 5,181,181 to Glynn descrlbe~ a
computer apparatus ~nput devlce ~or three-dimensional
lnfor~ation.
SUBSTlrUT~ SHEET (RUIE26)
L~S P~RRY 2l~9~ To: 613 230 8~21 RUG 1. 1996 6:05P~ #317 P.06
~18~627 --
wo ssnl436 PCrrU$9!!i/0148 `
SUMMARY OF T~E I~V~:;N~10~ -
The present invention seek~: to provide ~n
improved input device.
~ here ls thus provided in acco~ance ~lth a
preferred embod~ment of the pre~ent invention informatl~n
input apparatus includlng body ~upported ~pparatu~ f~r
sens~ng voluntary body mot~ons and provlding an outp-t
indicatlon thereof, a ~ymbol outp~t lnt~rpreter operative
to utilize the output indication fo~ providlng sym~ol
~utputs, and a motion output interpreter ope~ati~e ~o
utili~e ~he output indication ~or p~ovlding mot~on c~n-
t~ol outputs.
Purther in accordance w~th a prsferred r~ho~,i-
ment of the pre~ent invention, the outp~t indicat o~
represents feature~ of body motlon in¢l~di~ featu.e~
w~lch are character$stlc of the individ~al~
S~ill further in accordance ~lth a pseferredemhofl~ent of the present lnventlon, a mode ~elector ~
provided whi~h is operatlve to cause a selected one of
the 8ymbol outp~t interp~eter and ~e ~otion outp~t
interpre~er to functlon. .
~ urther in ~ccordance w~th a preferred émbodi-
ment of the present invention, the body suppo~ted app~sa-
tus is a han~ held device
Still further ln accordance wlth a prefe-red
embodiment o$ the pre~ent lnventlon, the bod~ suppo~ted
apparatus is a generally pen-shaped device,
Additionally in accordance wlth a preferred
e~bo~t~ent of the prese~t invention, the gene~ally pen-
shaped devlce is ope~ative to provide a vislble writing
~unction.
Still further in accordAncc ~lth a pref~rred
embodl~ent of the present invention, t~e informdtion
lnput apparatus also includes a~ ob~ect ~hose motlol ls
Cl IR.~TITI IT~ FFr IRUI E 2~
FRln:LRD~S P~lRRY 246E19Sg TC~: 613 230 8~21 QUG 1. 1996 6:06PM #317 P.07
2182627
WO 95121~3~ }'Cl`~lS951011 83
cont~olled by the motion control outputs.
~ urther in accordance wlth a preferred e-~s~
ment of the present l~ventlon, the obj~ct is a grap~ic
object d~splayed on a di~play or a physlcal objeet.
Yurther in acco~dan~e with a preferred emb~di-
ment of the ~e~ent invention, t~e symbol outputs repFe-
sent alp~anumerlc 8ymbols or a ~ensor~ quallty such as a~
acou~tlc st~mulus, including b~t not limlted to music, or
such as a vlsual ~tlm~lus, including but not llmited to a
colo~ or a colo~ ~may~.
It is appreclated that ths applicability of the
p~esent ~nvention is very broad and is suitable for tbe
follo~ing field~ of use, inter alia: games such as v_deo
game~, toys, ~o~el veh~cles, robotics, simulation~ -uch
as flight slmulations, technical drawings and CAD.
Still further in accordance with a prefeirred
embDdiment of the present ~nvention, the in~orm~,tion
input apparatu6 also includes a c:o~puter, hav~ng a loc~-
tion input and a symbol input, and a di ~play oper~ted ~y
the compute~ and wherein the symbol outputs ~epr~8ent
information to be displayed on the d~splay and the motion
outputs sre s~lpplied to the lo~at~on inpu'c and are em-
ployed by t2~e ~omputer to govern the locatlon of the
~forma~lon on the ~splay.
Further ~n accordan~e ~ith ~ prefe~red e~odi-
~ent of tbe pressnt lnvention, the sy~bol output~ lrclude
unction commands.
There i~ al~o provl~ed, i~ accordance w~th a
p~e~er~ed embodiment of the pre~ent invention, a ~ethoa
by whi~h a manipulable de~lce prov~des an output i ~dica-
tion representing its o~n angular motion, the nethod
including recording actual accele~atlon data from a
plural~ty of accelerometers mo~nted in the ~anipulable
device, generating p~edicted acceleratlon dat~ cn the
~a6is of hypot~etical angul~r motion ~nfo~ma~lon, compar-
ing the.predicted accele~atlon data to the a~tual a~cel-
SUBSTITUTE~HEEl (RULE26)
FROI~l:LflDRS Pf~RRY 24~:1J9 TO: 613 230 B~21 RUG 1- 1996 6:06P1~1 #317 P.08
- ~182627
WO95/2~436 ~ )/v~ 14 3 ~
eratlon d~ta, computing improved hypo~hetical angular
mot~on inform~tion, repeating, whlle the pred~cted occel-
eration data differs significantly from the actual accel-
eration data, the generating, compa~lng and co~put~g
step~, and providing an output ~dicatlon of the $mpro~ed
hy~othetical angular ~otlon information.
~ rther ~n accordance with ~ preferred emboCi-
ment of the present lnvention, the angular ~otlon in~or-
mation ~ncludcs ang~lar displacement info~matlon, angu.ar
veloclty informatlon and angular accelerat~on inforna-
tion.
Still ~u~the~ in a~cordance wlth a preferred
emho~i ~ent of the present in~en~ion, the met~od incl~des
computlng linear mot~on information from the improved
hypothetical angular motion in~orma~ion and from the
,. ~ actual acceleration da~a.
Addltionally in accordance ~it~ a preferred
e~bodlment of the present invent~on, recording lncludes
reeording from at lea~t four accelerometers mounted in
the manipulable dev~ce, w~erein the accelerometers each
have a cente~ of ~a~s and wherein the centers of masE, do
not lle within a ~ingle plane.
Stlll fur~her in B~co~dance wlt~ a pref~rred
e~odi~ent of the p~esent invention, the ~e~ho~ also
includes receiving the output indication of the imp-oved
hyp~thetical angula~ motion ~nformation and manlp~l~ting
an ob~ect in accordance therew~th..
There is additlonally provided, in accordance
with a pre~erred embod~ment of t~e present lnvention, an
accelerometer array mounted in a manipula~le devic~ and
~ncluding at least four accelerometers each havtng a
cen~er of ma~s, wherein the centers of mass do no~ e
within a s~ngle plane, and a man~pulable de~ice ~otion
compu~er recei~ing input from the ac~elerometer a~d
genera~lng an o~tput slgnal ind~catlve of the motl~n o~
the manipulable devlce,
~:1 IR~TlTl 1~ SHEE1 (RULE 26)
LRDRs PIY~RY ~CH9~ TO: 'i13 a30 131321 'lIIG 1. 1996 6:07P11 #317 P.09
~182627
~095~1436 r~
~ urther in accord~nce wlth a pre~erred embodi-
men~ of the pre~ent ~nvention, the manipulable devl~e
~ot~on co~p~ter is ope~ative to:
record actual acceleratlon da~ from the accel-
erometers,
generate predicted acceleration data on the
~asis of ~ypothetical angular motlon lnformat~on,
compare th~ predicted acceleration data to ,he
act~:l acceleration ~ata,
compute impro~ed hypothetical. angular mot~on
informatlon,
repeat, whlle the predlcted acceleration dlta
dlffe~s slg~ificantly ~rom the actual a~celeratlon data,
the generating, comparing and computing 8tep5, ~nd
provide an output ~ndication of the ~mproved
hypothe~ical angular motion lnformatlon.
~ urther in accordance ith a preferred embodi-
m~nt of the present invention, ~he apparatus also inc'ud-
lng an ob~ect rnanipulator receiving the output ~ nal
lndlcative of tbe mo~ion of the manip~lable devlce ~nd
manlpulating an obje~t $n a~cordance therewlth.
There is al~o prov~ded, ln accordance ~tl a
prefesred embodiment of the pre6ent invention, an in~or-
mation lnput method including sensing voluntary ~ody
~otlons and providing ~n output indication thereof,
utili~ln~ the output ~ndication for providing symbol
outputs, and utllizing the ou~put indication for provid-
ing motlon cont~ol output~.
~1 In~ TF .~ t lRULE 26~
FRO1:L~DRS PPRRY 2~6ag5g TO: 613 230 ~821 RUG1- 1996 6:0'7PI`1 ~317 P.10
~18~627
WO9~21~36 PCT/I~S9~014 3 ~~
,
BRIEF DESCRIP~IO~ OP THE DRA~ S
T~e present invention wil~ be understood ~nd
appre~lated from tbe following aetailea description,
taken in con~unction wlth the drawln~s ln ~hich:
~ Fig. 1 ls a sl~pl~fled pi¢to~isl ill~strat_on
of object control and handwriting recognltion appara-u~
con~tructe~ and operatlve in accordance with a prefer:ed
embo~lment of ~he present invent~on;
~ igs. 2A and 2B a~e ~chem~tlc dra~gs of
preferred struct~re~ of portionæ of the apparatu6 of Pig.
l;
Pig. 3 is a simplified block diagram of tne
appa~atus o~ Pig. 1;
~ g 4 is a simplifie~ flow chart illustra lng
the ob~e~t control proces~ performed by the appa atus of
~ig. l;
~ ig. 5A i6 a si~plified flow chart ill~strating
the proce6s of step 4~0 o~ f~g~re 4;
~ ig. 5B compr~ses mathematlcal equations illus-
trating the proce~s perfo~ed by Fig. 5A;
Pig. 6 i8 a simplified block diagram of the
apparatu6 of ~lg. 1;
~ ig 7A i~ a simpllfied flo~ chart illustr-.tlng
t~e teachlng proce~s performed ~ the apparatus of Flg.
l;
Pig. 7B i~ a simplified flow ~hart ~llustratlng
the ~ecognition process performed by the apparat~s of
F~g. 1; and
Fig~. 8A ~nd 8~ are g~aphical illustratlons
u~eful in understanding a preferred method for a portlon
of the teaching and ~ecogn$tlon proce~es perfo~m-d by
the apparatus of ~lg. 1.
Appendi~ A i~ a co~pute~ l~st~ng of a ~refer~ed
software i~plementation of a portlon of steps 720 of ~$g.
7A and 800 of F~g. 79.
SUBSTITUT~ SHE~ (RULE 26)
FR0~1:LRDF15 PPaRRY 2~ J~ TO- 61 - ---`-----~-----~
3 230 ~821 RUG 1. 1996 6:08P~ 317 P.ll
2182627 -
~o sSn~q36 I'CTJUS9~01~3
D~TAILED DESCRIPTION OP PRE~E~EP E~IBO~IME~TS .
Reference ~s now rnade to Pig. 1 which is a
~lmplif~ ed plctorial illustration of apparatus operative
to perfo~ notion contsol ln synergl~lc combinat~on ~ith
~y~bol interpretation such a6 handwrlting recognitlon. A
hand-bel~ pen 10 is operative to be translated and rot~t-
ed abou~ some or all of three ~erpendlcular axes. ~he
term ~six degrees of freedo~" i~ ~sed hèrein to des~gnate
translation along and rotation a~out three orthogo~al
axes.
Pen 10 also comprlses a plurality of bullt-ln
accelerometers 25, such as model ICS 3031-2 comme~ei~,lly
available from IC Se~sors, 1701 McCart~y Blvd., Milp~tas,
CA 9503s. Prefsrably, pen 10 co~prlses.six accelerome-
ter~. 3rrang~d in pai~s, ~ith ea~h pair lylng alon~ a
part.. ~lar axis, with the axes being mutually orthogo~al.
Alter~atively, the axes may not be rnutually or~hogo~al.
In any case the accelerometers nsed not be coplana~.
Pen lO also co~prises a plurallty of ampli~iers
30, a~oc~ated with the plural~ty of accelero~eters 25.
F~g. 2~ ~s a schematic dra~lny of a p~eferre~ e~od~ment
of amplifler 30.
Alte~natively, removab~e apparatus compris.ng a
plu~ality of accelerometers 2S as descr~ed above, and
also C~ is~ng as~ociate~ ampl~iers 30, as deseribed
above, ~ay be retrofitted onto the pe~ 10. The remcvable
apparat~s may have the form of a cap fitting t~e erd of
the pen, a ring fitting ove~ the pen, or any other suit-
able ~o~m.
In a still fur~her alternative, the app.~atuæ
may not include a pen, but may h~/e any other su~table
hand held f~rm. In a yet furthe~ alte~nat~ve, the appa-
ratus ~nay be in the form of a ring fittlng the user' 8
finger, may be supported by the bod~ of B user, or mou~t-
ed thereupon in any ~uita~le matter.
nC.T~nrr~ E~ (RULF26)
DflS PRRRY 24GO~ TO: 613 230 8~21 ~JG 1. 1996 6:0BPI`1 #317 P.12
- 2182627
~VO 9~i/21~36 l'Crr~1895/014R~
Pen 10 also comprise~ a ~wltch ~S, ~hlch ~an be
used to ser~d a signal lndicating whether pon 10 is bei~g
used for handwrltlng recogl~ition o~ as ~ pointing and
control devlce. Alternatively the slgnal may ~e sent ~y
moving pen 10 in a predef~ned format, or by any oth~r
appropr~ate means. D~ring handwritlng recognitlon, th~
user ~ay write with pen lO on wrlt~ng su~face 37.
The data fro~ the plurallty of acceleromete_6
25 in pen lo i~ ter~ hereln "ac~elerometer data". T~e
ac~elerometer data i8 sent through a aable to a contr~l
clrc~lt 40. ~lternatlvely, the accelerometer data msy be
sent through any suitable ~lreles~ communicatlon lirk,
such ~8 ultra80nlc, lnfrared, or by any other su~ta~le
mean~.
Control c~rcuit 40 amp~i~ie~ ~he accelerat_on
signals from pen lo and convert~ them to ~lgital fo_m,
preferably uslng aD analog to dlgltsl co-l~ferter. ~lg. Z~
~s a schematic drawing of a pseferred ~ A~ment of an
analog to digital ~onverter s~itable ~or the present
ap~licatlon .
Control circuit 40 then ~ends acceler~tlon ~ta
to a CPu 50. CPU 50 may be any sultsble CPU such as an
IBM PC ~ompatible co~puter wlth an B0386 p~oces60r ch p.
Asso~iated wlth CPU 50 are a s~een 60 an~ a
keyboard 70. An ob~ect 80, ~uch a~ a cur60r or a gra~h$c
rep~esentation of a ~hyslcal object, ls d~splayed on
~creen 60. When psn 10 i~ used for ob~ect control, CPU
50, ba~ed on the Acceleratlon data, move~ the cur60~ or
graph~c repr~sentation 80 with ~ix d~gree~ of fre ~om,
correspo-nding to the movement of pen 10.
A symbol 8s, such as one or more charactcr or
word~, may al~o ~e displayed on screén 60. When pe~ 10
is u~ed ~or handwriting ~ecognitlon, ~P~ 50, based on the
acceleration data, d~s~lays the ~ymbols corre~ponOln~ to
ha~ ls written on ~rlt~ ng surface 37 ol~ s~reen 60 .
The functionality o$ 'c~e apparatus of Fi g .
C~ SHEEI (RULE26)
FROM:LRD~S PRRRY c4~ TO: 613 230 81321 RUG 1, 1996 6:09P1~1 #317 P.13
- 2182627
wog5nl~36 rcT~ls95l~l483
will now ~e desc~ibed. U6ing switch 3~ the user ind~-
cates whether h~ndwriting recognition or object con rol
is to be performed. Depending on the user~ 6 choice, the
apparatus of Fig. 1 perform~ the approprlate function.
The functlonallty of the sppasatus of F~g.
w~en per~orming object control w~ll n~w ~e briefly de-
scrlbed. The user ~oves pen 10 in three dimenslons; the
motlon may ~ncl~de six degrees of frseaom~ Pen 10 sends
a¢celeratlon data ~e~slblng the acceleration~ of per 10
during the motion to control circu~t 40.
Control circuit 40 amplifies and digitizes the
accelsration data. ~he data i6 sent by control box ~0 to
CPU SO.
CPV S0 co~putes the tra~latior-..l displaoQment,
veloc~ty, and acceleration of pen 10 alon;~ three mut~ally
.. ; perpendicular axes w~ich axes nee~ have no relatlol to
the axes of the accelerometers. CPU 50 also ~ompute~ the
angula~ displacement ~rotation), ~elocity and acce_era-
tion of pen lo around the ~ame three mutually perpe-dic-
ular axe8.
E~sed on the computed output, CPU 50 moves the
cursor or the repre~entation o~ an object 80 on ~creen 60
~lth tran~lat~ons and ~otat~ons correspondlng to those of
pen 10. Th~ axes for the translation and sotat$on of the
c~rsor o~ object correspond to t~e a~e~ used to compute
the translation and rotation of pen 10.
Reference is now additionally made to P~g.
which ls a ~impllfied ~lock diagram of the apparat~s of
Fig. 1. Pen 10, whe~ moved by the u~er wl~h ~ix degrees
of fr~edom, trans~ts data describlng the a~eler~tions
of pen 10 to amplification c~rcult 120. Amplifl~atlon
c$rcu~t 120 a~plifie~ the ~cceleration data and trals~ltæ
the amplified acceleration data to analog/digital ~on-
verter 130. Analog/digital conve~t~r 130 dlgltize- ~he
accele~ation data and ~ransmit~ the dlgitized data to
displacement/velocity/a .leratlon ~omp~tation apparatus
.~IIR~T~TUTE S~IEEI~ (RULE26)
S PRRRY 24GO~ TO- 613
230 ~a21 ~lUG 1. 1996 6:10PI'1 #317 P.l~
~182627
~0 95/21~3G r~ s3
140, termed ~erein DVA 140.
DvA 140 co~putes the a~g~lar alsplacem*nt,
~eloclty, and aoceleration of pen 10 around three mutlal-
ly perpendicular axes which axes need ha~e no relatiol to
the axes of the aecelerometer6. DVA ~0 ~lso compate~
th~ translational displa~ement, velocity and accele~ation
of pen 10 along the ssme three mutually perpendicular
axe~.
DVA 140 transmits data describing the ~lx
degree~ of freedo~ to ~c~een display ~ontrol 150. Eased
on the data, screen display control 1~0 up~ates scr~n 60
to show the new location and orientation of the cursor or
the othcr ob~ect depicted on screen 60~
~ eference is ~ow addltlonally ~ade to F1~. 4
whlch ls a simplifled flow chart lllu6trating operatlon
of the apparatus of Fig. 1 in accordance wlth a pre~Prred
embodiment of the invention. The p~eferred method of
operation of the method of ~lg. 4 includefi the foll~wing
steps:
STEP 410; ~ead accelerometer data. Data from
each of the plurallty of accelero~eter6 25 1~ sa~pled,
preferably at a rate of one t~ousand data point per
secona.
STEP 412; ~heck whether sessio~ is at the
beglnning. A~ the beglnning of a ~es~on, ST~P 420,
described below, ~s requlrs~.
STEP 415: Check uhether pen i~ in motion The
accelerometer data is analyzed to determi~e whether pen
10 i~ in motlon.
Preferably, pen 10 18 considered t~ be n~t in
motlon ~henever all of the accele~ation s~gnals ln~icate
that the only sensed accelerations are due to grav$ty.
Signals are chose~ from one membe~ of each of ~hree palr~
of accelero~eters, each pair arranged along a dl~ferent
axis.
Let the vector U~(Ul,U2,U3) denote the -ignals
FR0~1:LRDf:S PRRRY 2468959 TO: 613 230 8821 RUG 1. 1996 6:10PM #317 P.15
~18~627
Wo~snl436 . P~ 5~ ~83 --
of the three accelero~eters ~et the ma~ri~ A-(Ki,~;,K3)
denote the sen~tivities of each of the three accelero~e-
ters.
~ e sensit~vitie~ of the ac~elerometers co~rect
for any deviations of the axes of each palr of accel~rom-
etBrs as they are actually mounted in pen 10 from the
common axis on which they are supposed to be sltu~.ted;
this component of the sensitivlty ~s ~alled static sonsi-
tivity. The sensitivities a~so correct for devla_lons
between t~e axes o~ the global ort~ogonal coordinate
~ystem and the axes of the pair~ of acce~erometer~; thiæ
component of t~e sensitlvity is called dynamic senfiltivl-
ty. In actual practice, both statlc sonsltlvity and
dynamic . sensltivity may make i~portant contrlbutiors to
sensitiv1~y,
The statlc Eensltivlty i8 computed as part of
step 420, descri~ed in detail below. The dynamic ensl-
tivity ls computed 8S part of step 455, describ~d in
detail below.
Let ~ denote a s~all positlve conStan~ for
example, .OOSg where g denotes the a~celeration of ~ravi-
ty at the earth's 6urface. Then the pen i6 con~_dered
not to be in motlon whenever 1-6 C ¦ ~ lU ~
S~EP 420: Compute lnitlal condltlons. The
~nitial condition~ may compri~e the lnltial Euler .ngles
bs~ween the global coordinate sy~tem and the axes of t~e
pa~r~ of accelerometers. These Euler angleF are now
deter~lned.
Assuming tha~, at the inltial ~ondltion, either
at the beginning of the ~es8ion or when the pen ~8 not ln
~otion, the only acceleratlons measured are due to g~avl-
ty, the ~tat~c sensit~vity can be computed f~m the
accelerometer data while the pen is at re~t in three
known orientations. Alternatlvely~ the statlc s~n~ itl~i-
ty can be computed once ~s a prop¢rty of the pen a~d
stored ~or suture u~.
L~ ~DC!TITIl~r E ~ T /QI IJ F ~
FR01'1:L~5 PRRRY 2'16E~9~ TO: 613 230 8E321 RUG 1, 1996 6:11P~1 #317 P.16
2182627
WO 95/21~3C . I C~ 101~83
STEP 430~ Compute the diffe~entlal signa~ ~rom
each pair of accelerometeræ. The 6ignals fro~ ~ach
member of each pair of accelerometers are s~tracte~ to
form a 4iffe~entlal slgnal for eac~ p~lr of accelerome-
ters.
STEP 440: Compute rotationa~ parameters. ~he
rotational parameters def ine parameters of ~e mo~ion
about the three axes of the global coordlnate 6yS :em.
The rotat~onal parameter~ ~omprlse the t~ree E~ler
angles; the three a~gular ve~oclties; and the tlree
angular accelesations.
~ he ~otational paramete~s are comp~ted ln
parall~l usln~ an lterativ~ fè~h~k loop. In each
iteratlon of the loop, an estimated diferential acc61er-
atlon is computed from the current rotatlonal parameters.
If the difference between the estlmated differertlal
accele~atlon and the actual differentl~l accelerAtion
signal is less than a p~edetermlned s~ount, iteratio~ is
termlnated.
Otherwlse, new value~ of the parameter~ a~e
estimated in each iteration from the previous values and
the difference be~ween the est$mate~ dlfferential accel-
eration and the act~al dlffe~ent~al acceleratlon data.
~he method of this step is describe~ more fully ~slo~
~$th reference to ~lg. ~.
STEP 450; Compute translat$on acceleration.
The angular orientation and th~ angular accelerationl are
known from step 440. Yrom the an~lar o~ientatlo~ and
the sensltivlty vector the acceleratlon due to grav~ty i~
computed.
Given the angular acceleratlon a~d the accele~-
ation due to graYity as ~ell as the sénsitivity v~ctor,
the translational accele~ation i~ co~puted. The co~puta-
tion is according to the for~ula at~X lu-ag-ar whe-e at
is the tra~slatlonal accelera~ion; ~ is the sensi-ivity
vector; u is the signal of one accelerometer; ag 1- t~e
.~1IR~TIT~ C~ CT112111c~
FROI~I: LRDflS PRRRY 246E~959 TO: 613 230 ~3Ei21 MJG 1. 1996 6: llPI'1 #317 P. 17
2182627 .
9snl43fi l~ 83
componen~ of the acceleration of gravity sensed ~y t~e
one accelerometer; and ar is the angular acceleratlon.
STEP 455: Vpdate dynami~ sensltiv~ty, As
explained a~o~e, the dyna~ic sen~itl~vlty repre ents
devlations between the ~xes of the global ortho o~al
cobr~inate system and the axes of the pairs of accel~rom-
ete~s. Since the angula~ orientation of pen 10 may ha~e
changed, ths dyna~ic ~ensitivity may ~lso have changed.
Gi~e~ e change in the angular orientatlon of
pen 10, the new dynamlc ~ensltlvity m~y be computed fro~
t~e new angular orient~tion and the old ~atrix of dynamic
sensitivity.
S~P 460: Compute translational velocity a~d
di~pla~ement. The transla~ional VBlocity is comput d by
lntegrating the translational accele~atlon ulth r~spec~
to tlme. ~he displacement is co~puted by ~ntegratir.g the
translational velocity wlth respect to ti~e.
STEP 470: Move screen ob~ect. Ba~ed or the
output of prev~ous steps w~ich comprises transla~ional
acceleration, velocity and displacement as well as angu-
lar accelesatlon, veloclty and orientation, the -creen
ob~ect i~ moved.. The moving of the screen ob~ect ~ay be
according to any appropriate transformation of th~ mo-
tions of pen 10.
Reference i~ now additionilly ~ade to ~iq. 5A
which i~ a ~lm~lified flo~chart illugtrating to ope-ation
of step ~40 of ~ig. 4. ~ig. SA incl~eæ the fol owlng
steps:
ST~P 480: Set initial pa~ameters. ~he rota-
tional para~eters comprise the th~ee Euler angles; the
three angular velocltles: and the three angular acc~lera-
tions. The initial value for the Euler angles i~ el~mput-
ea based on the previously ~nown val~e of the paramleters,
assum~ng that the acceleration has remained con~tanit.
S$EP q82; Co~pUte dlfferential acceleration
from model. Pirst the po8ition of an accelerometer 1
~ /nl ~1 ~ qc~
FRa1:Lf3DflS Pf~RRY ~l~il3~3 TO: 613 230 8~321 RUG 1- 1996 6:12P~1 #317 P.ll3
- 21~627
wo 95nl~3fi , ~ 7U:.J~J01~8] '
the coordinate system of the pen is ceined by vector
and the rotation of the pen in the gl,obal coord nate
system is defined by a rotatlon matrix A(phl). For
example, A(phl) m~y be an appropriate ro~ation matri~ as
presented in ~ections 14.10-5 through'14.10-7, pag~s 475-
q8b of Mathematical UAr~ook for Scientlsts a~d Engi~eer6
by Rorn and Korn, 2nd Editlon, publl~hed by Mc~raw-Hlll
in 1968. Here p~i is a vector o~ Euler anqles:
phi~(~,B,r)T. Then the poslt~on of the ac,cele~omete_ in
the glo~al coordinate system R is deflned by RcAr.
Reference is hereby additionall~ ~a~e to ~lg.
SB, which contains e~uation6 useful for undcrstandin~ the
steps oP ~ig. 5A. Equation 490 lllus-rates the com~uta-
tion . of the accelerat~on of the .accelerometer in the
global coordinate syste~
As the Euler angles of the acceleronQte~
change, the sensltlvlty vector X al~o changes. The
change ~n the sensltivity ve~tor X ~ay be co~uted by
using equation 492 of ~lg. 5B.
Given the acceleration o the accelerometer and
the new sensitivity vector, the esti,~ated value for the
differentlal signal of the accelero,meter, ue~ may be
computed by using equation 494 of Pig. SB.
~ he remainder of the ~arame.ters may be co~p~ted
with an appropriate model. Preferjbly, a model ~h~ch
allows the use of only the para~eters speci~led above,
rather than a larger numbe~ of param~ers, is used. For
example, equation 496 of F~. SB rep~esents an appropr~-
ate model ~or computing the remainde~ of the parameters.
STEP 4~4: Is the difference between the com-
pu~ed and the current value less t~an a predete ~ned
amount? If the difference is less than thl~ amount, the
estimated param~ters are ~aken to bb correct and tera-
tion is termin~ed, with the computed parameters beiag
reported.
An appropria~e ~alue ~o~ the predete_m~ned
SUBSTITUTE SHEET (RULE 26)
FRO~DRS Pf~RRY c4~ TO: 613 230 8E121 RIJG 1. 1996 6: laq~l #317 P. 19
- 2182627 --
WO 95121436 PCl`lUSg~101-83 --`
amount ~nay vary depending on, ~or e~cample, the nla ~i~w
number of desired iteration~. One pQS~ible appropirlate
value would be . 0003 g, where g re~re~er. ~;~ the acce'lera-
tion of gravity ~t the earth ' s surface .
STEP 486: Compute changes in estlmated angle~
a~ording to the gradient ~nethod. New estimated ~,ngles
are computed by a~dlng a change to the old esti,mated
angles the change ~8 co~puted according to tbe gr~dient
method. The gradlent method i8 explained ~ore ful_y $n
sectlon 20.3-3 of Mathe~atical ~n~ook for Sc~ertists
and Engln~ers by Korn and Korn, referred to above,
STEP 488: Compute new paramete~s~ ~ew ~alues
for ~he re~aining parameters are domputed. Ite~a~ion
then continues with step 482.
The functionallty of the apparatus of ~_g.
when per'or~ing handwriting recog~ition will n~w be
br~efly .ascribed. Pen 10 sends acceleration ~ata
through. control clrcuit 40 to CPU 50. Teachinq and
recognition then occur based on the data from pen 1~.
Reference is now a2dl~ 11y ~a~e to Pig. 6
which is a simplified block ~iag,~m of the apparat~s of
~ig. 1 when used for hand~riting recogni~ion. The appa-
xatu~ of Pig . 6 receives lnput f rom psn 10 .
Pen 10, when movsd by the ~ser of the ~aJdwrlt-
ing recognition apparatu~, transm$t~ data describir g the
acceleration~ of pen 10 over tlme to acceleration teach-
ing control 630 and/or acceleration handwriting r~cognl-
tlon control 650.
The data from pen 10 may be transmit~ed to
acceleration tQachi~g control 630~ Transmission to accel-
eration teaching co~trol 630 typically occurs fo_- each
~erson ~ho is to use ~he system for handwritlng r~cogni-
tion for the first time. ~ransmls~ion to acceleration
teaching control 630 also preferebly occ~rs when r~3cog~i-
tion errors are d~tected use of acce~eration t~ach~ng
control 630 when recognit: n errors are detec~ed ls
~IIRSTITuTE SHEEr (RU~E26)
LRDRs PRRRY 2~GE~3'3 TO: 613 230 81321 f~lJG 1. 1996 6:13P11 #317 P. 20
2 6 2 7
WO9~2143G . I~l/us~sol4s3
~ermed herein adaptlve teaching.
Acceleration te~ching cont.~ol 630 operater, on
the data rece~ ved, ~hlch data represPnts hand mo~enents
by the user when w~iting a 6ymbol, to~ether with ~P ~A~-
ly-provided identl~icatlon of the syl~ol co~e6 that are
as~ociated ~ith the data. Acceleratlon teachlng control
630 the~ updates databa~e 640, a pe=-person per ~ymbo~
acceleratlon dat~base. Database 640 co~ri~e~ proto-ype~
of accelerations for each symbol, com?rising ~ata ~ clf-
ic to e~ch per~on fos each sy~bol,
Alternatively, the d~ta f~om pen 10 may be
transmitted to accelerat~on handwritlng recogn$tion
control 650. Acceleratlon handwrit~g recognltlon con-
trol 6S0 operates on the data recei~ed from pen 1~ to
re~ognize the symbol represented by the mo~ement of pen
10 .
~ he o~tput of ac~eleratlon handwr~tlng re~ogni-
tion control 650 comp~iRes a li~t cf symbol codes! and
their respecti~e probabillties. ~n accele~ation hand-
wri~ing recognition post-processing ciro~lt 660, c~oo~e~
the co~ect symbol cod~ ba~ed on the li~t of symbol codes
and probabilit1es, and on post-proce~sing infor~atlon
whlch prefera~ly comprl~es a dstabaS~ of prevlous confu-
sions and a dictionary. The output of acceleration hand-
writing recognition post-proces61ng ~ircuit 660 i~ a li~t
of symbol codes and/or words sorted ~y likellhood.
Reference i~ now addltiona_ly made to Fig-,. 7A
and 7B ~hlch are simplified ~lo~ charts i~lust~at$ng
operation of the apparatu6 of Fig. 7 in a~cordance ~i~h a
preferred embodiment of the inventipn, when pe~forming
handwriting recognltlo~ Fig. ?A l~lu~t~ates the ~ea~h-
ing process and Fig. 7B illustrates the ~eco~nltion
process. The steps ln ~ig. 7A include the followln~:
STEP 710: Read accelerometer data. ~he ~ccel-
erometer data comprise~ data poln~s representing sa~pl~ng
o~ t~e acceleration mea~ured ~y accelerometers 25.
~1~u~ IIT~ ~u~c~r~
FRa`1:LRDRS PRRRY 24GO~ l:1 TO: 613 230 BE~21 ~UG 1. 1996 6:13P11 #317 P.21
~1~2627
95/21436 ~ C~1483
Preferably, the sampling rate is appro~imately 1600 data
po~nts per second, averaged over 8 po1n~s, ~roducing an
output of approxlma~el~ 200 data polnts pe~ second.
ST~P 712: Identify pen-sur~ace ~ont~ct te-.mi-
nation The data from step 710 does not include the
surface contact ~tatus of pen lO. The ~ur~ace contact
status of pen lO may be der~ved from the accelera lltion
data as follows:
The acceleration data is filtered to re nove
co~ponents other than noise. ~o~ exanple, the accelera-
tion data may be filtered by a Butter~orth diqital filter
de6cribed in Diqital Filter Desio~ ~y T.W. Par~.~ ana ~.~
Burr~, John Wiley & Sons, 1987, chapte~ 7, 6ectlon
7.3.3, using the 4th orde~ lowpass digital filter wlth a
cut-off fre~uency of O . 7 to 0. 9 .
The flltered acceleratlon ~ata i8 the~ ..nte-
grated ove~ tlme. The slope of the integrated ~t l~ered
acceleration data is then snalyzea ~o determine th~ ~oint
at which the slope exceeds a thre~hol~ ~al~e. The ~o~ nt
at wh~ch the slope exceeds the threshold value i~ ~aken
to be the flrst point with status ~peh down". The ~oint
at which the slope falls below a thre~hold value is -aken
to be the first point with status "pe1 up~; the thre~hold
~alue may or may not ~e the same as the previously de-
scribed threshold v~lue.
The threshold values de~aribed above may be
determined ln advance for the partlcular type of pen snd
writing sur~ace, may be determined b~ a learning process
for the part~cular person, or may be de~ermined by ~ther
~ne~ns .
S~EP 715: ldent$fy 1nd1vidual ~ymbols and
words. ~he ~ata rom the previous step 18 di~i~ed lnto
~ata representing indivldual symbols. The status which
comprlses the status of "pen ~p" is termed hereln "pen
not down~. Prefera~ly, the num~er of consecutive data
points witb stat~s of "pen not do~n", whi~h data points
C!l 112C!~ITI ~TF .~ FT (RII~E 26~
FRO1~1:LRDRS PRRRY 246E3959 TO: 613 230 E1~21 RUG 1. 1996 6:14P1~1 #317 P.22
2627
Wo 951~143G ~ J~j~!i/( 1483 - ~
.
18
rcpresent a particular du~ation of the status "pen- not ..
down" i~ taken to lndica~e the end of a ~ymbol o~ o~ a
~osd.
Typ~cally, the duration of 6tatus "pen not
downr withln a range from 200 mllll~econds to 400 milli-
second~ is taken to in~ic~te the end of a symbol. Dlura-
tion of the statu~ ~pen not down~ ln th~ range from~ 800
milliseconds to 1200 milllseconds is typi~ally taken' t~
indicate the end of a word. .
Alternatlvely, the end of a sy~bol or of a word
may be ~ndicated by data polnts whlch represent pen
mo~ements that are not part of a sy~bol, or by ~ther
means. Outp~t data from ~te~ 715 co~prises ~ymbol end
and word end data.
STEP 720: ~ormalize accel~rometer data~ The
accelerometer data is normalized in tl~e or by other
means, Appendlx A is a compute~ llsting ln the C pro-
gra~ing language comprising rou~ine~ ~hat aro a pref~rred
implementstion of step 720. The routines comprise ~he
following routines in section II, "p~o pse~rocessing":
normal; toge~her wlth various deflni~ions used by roltine
normal .
STEP 730: ~ilte~ accel~omoter data. ~he
normali~ed ac~elerometer data received fro~ the prevlous
step i~ filtered ln order to remove noi~e. The f$1te~ing
may be accomplished by iteratlve ~moothlng of ad~accnt
point~ until the total change in the ~ignal ~ue to a
smoothing operation is less than t~e de~i~ed accuracy of
the data, or by other sulta~le means.
S~EP 740 Parameterize accelerometer data.
The data is parameterized according to crlte~ia which are
chosen .to ~epresent each ~ymbol. I~ the accelero~ete~s
are not m~tually orthogonal, the ~cceleration data ~ay ~e
~onverted into equivalent data in a mutually orthDgonal
coordi~ate system as follows:
Let the non-orthogonal slgnals be denoted by
SUBSTITUTE SHEEr tRUL $)
FRO~:LRDRS PRRRY 246~959 TO: 613 230 6~21 RUG 1. 1996 6:1~ #317 P.2~
- '~18262 ~
W~ss~l43c l~Y~u~s~l~s3
the vector u=(u1,u2,u3)T snd the orthogonal ælgnals be
denoted by the ~ector u~u~l~u~2~3l~ Then ~'~AoA 1u
where A is a vector of static ~onsitl~ity vectors
A-~A1,A2,~3) of the three accelerometers. The stat~c
sensitivity vector is compute~ from t~e outputs of the
ac~elerometers during a defined orientation without
movement. Ao is a dlagonallzed matrlx of sen~ltivity of
the orthogonal coordinate syste~ com~lslng the norm of
A1, A2, and A3.
T~e parameters prefe~a~ly compri~e the fo'low-
ing:
number o points ~efore nor~allzatlon;
~ormali~ed slgnal of pen stat~s
nor~alized signal o~ Z accel.eratlon;
slne of the angle ~' whlch ~ngle is define~ as
the angle between the vector assoclated with the current
data point ~AccXi,AccYi,~ccZi) and the AccXAccY plane as
shown in Pig. ~A;
cosine of the an~le a';
sine of the angle B' ~hich .angle is defin~d a~
the angle between t~e vector that conne~ts the polnt
before the prev~ous data point (AccXt_2,~ccY1_2,Ac~Zi_2)
an~ e c~rrent polnt ~AccX1,Ac~Yi,A~cZi), and the vecto~
that connects the cu~rent point with the point afte.- the
~ubsequent point (AccXi+z,AccYi+z,A~cZl+~) ln 6pace
~Accx~A~cy~Accz) as shown ln ~lg. 8B;
and cosine of the angle ~.
STEP 750: Generalize pa-3me~ers. ~he p~.ra~e-
ters of the symbol belng learned epsesent a fipe~lfic
lnstance of the symbol~ The symbol prototype stored ~y
the sy~tem is to represent the general ~haracteristlcs of
the symbol ~s drawn by that person. Therefore, the
parame~ers of the symbol belng learned are generalized by
some su~table means, ~uoh as by computatlon of the a~er-
age of the value o$ each paramete~ from previo~s in-
stan~eS of t~e symbol along with the value of each para~-
.SI IR~ rlT~ I~E SH~ (R~ II E 263
FRa`l~ S PPRRY C46Elx;~l TO: 613 230 81321 RUG 1. 1996 6:15PI~1 #317 P.24
Z182fi27
~095~1436 r~ ~s/o-483
eter from the cu~rent instance of the 8ymbol .
S~EP 760: Update per-person per-symbol ac~el-
eratlon prototype database. The newly comp~ted par2me-
ters from the previous step are stored in the per-pe:son
per-symbol accelera~lon prototype ~atabase.
The steps in Plg. 7B lnclude steps ~h$ch ~ave
already been descrlbed above wlth reference to ~ig. 7A.
The remainder of the steps ln Flg. 7B include t~B fol_ow-
ing:
STEP 800~ For each prototype in the pes-person
pe~-~ymbol acceleration prototype d-.tabase, build a
measure of comparlson between the sa~le and the proto-
type, co~lned ove~ para~eters in t~e prototype. In
accordance with a preferred embodiment of the present
invention, all parameters are combined together to pro-
- , duce t~e measure of comparlson. Appendix A is a computer
listing in the C programing language domprising rou~ines
that are a preferred implementation of step 800. The
routines comprise the following, w~ich are foun~ $n
section ~, "sym~ols recognltion": ma~e corr; cor~el hem;
obj funct; togethe~ with var$ous definitions used by the
rou~i~es.
STEP 810: Create a list o~ probable sy~bols
sorted by likelihood Based on the ~easure or mea ures
of comparlson generated in 8~ep 800, a single 118.t of
probable symbol~ sorted by likelihood 1~ generated~
STFP 820: Chcose the corr~ct 8ymbolS and the
correct word based o~ the list, the databa8e of previous
confuæions and a dictionary. ~he symbols wlth gr~atest
llkelihood a~e the candidate8 f ro~ whlch the Correct
8ymbol is choçen.
The database of previous confusions provides
info~mation that allows the correc~i.on of t~e choi~e of
t~e correct symbol based on previous incorrect ide~tifi-
cations. The database of previous confusions comp_ises,
for each symboL, a li~t of other sy~bols whlch have been
Sl~RSTITUTE SHEEr (RULE 26~
FRa`l:LRDRS Pf~RRY ~4~ TO: 613 230 ~E~21 f~UG 1, 1996 6:1SP~1 #317 P.25
- 2182627
Wo 95J21~3G rcrtusss~s3
confused with tlle first sym~ol; for ~xa~ple, that. the
symbol " f " has of ten ~een confused with the symbol "b" ~
When ~uch an ent~y is foun~ comprising previous co~fu-
slons Ior a symbol in the 11st, the gymbol or sympols
that have previol~sly been con~uf~ed with the symbol ~n the
list are added to the li~t ~n accordance with the
p~evious example, if the sy~nbol "f " is found in tbe l~s~,
t~en the symbol "b~ is sdded to the list.
An indication of the en~ of each word ha~ been
passed as output since step 715, desc~ibed above. ~ased
on the ind1catlon, the mo6t likely word, comprislng the
most llkely identiflcations for each symbol in the ,ist,
is ldenti~ied.
The most llkely word 1~ checked against t~e
dictionary. P~ fera~ly, the dlctiona~y comprises bo~h a
general dictionary used for all u~ers of ~he system and a
~ersonal dictionary for each uses -of the ~ys~em I~ an
entry eXi6~S in the dictionary fo~ tbe most likely ~o~d,
~he word is cho~en a~ the correct identification.
If the most llXely word is not found in tl~e
dictiona~y, all possible ~ord co~binatlons in the li6t
are formed and eac~ is check~d against the dicticn~ry.
Among all such words ~hich are found in the dictlona~y,
the word wlth t~e highe~t likelihood i8 then chos~:n as
the correct ideDtification.
If none of the words is found ln t~e d~ction-
ary, the most likely wo~d is chosen as the corre~t lden-
tification.
. STEP E30; Check to ~ee lf a correction has
been entered. During the p~oce6s of re~ognltion, the
user of t~e syste~ is ~referably p~ovided with a vis~al
indicatlon of each symbol recogn~zed
~ fter the end of a word ls ~etected, the user
of the system prefera~ly is pro~lded with a visual indi-
ca~ion of the word recogni~ed~ The user ~ay irdicate
manually that a given word ~as incorrectly recognl2.ed and
~ T~TI ITI~ C!U~ 10~
FROM:LRDRS PPRRY 246~ TO: 613 2
3~3 8821 RUG 1. 1996 6:16P1~1 #317 P.26
21~2627
WO 95Q1~3C r~ g51~ 183 ---
may lnp~t a correction.
STEP 840: Update databa~e of'previous co~fu-
sions, Based on a manua~ correction ent~red in step 830
or an auto~atic co~rection based on t~e dic~ionary, the
database of previous con~usion6 is up~ated. Based o~ a
ma~ual correctlon, the personal ~lct~onary ls al 60 u ~ at-
ed if t~e corrected wosd ls not ~ound in th~ dlction~!ry.
Preferred met~o~s and apparatus for handwr~ting
recognitlon are descrlbed iR the ~ollowlng appl$cati?ons,
the alsclosure of which i6 hereby lncdrporated by r~t~er-
ence: PCl'/US92/08703; Israel 104S7~ T nppllc-~lon .-
flle~ 31 January 1994 ln the US Recelving O~f~e ~y Ehu~
Baron and ~dward A Wolf e .
It is appreciated that t~e parti~ular embodi-
ment described ~n Append~x A ~s ~nten~ed only to pr~vldQ
an extremely detailed di~closure o$ t~e present lnve~lon
and i~ not intended to be lim~tlng.
- It is appreciatea that var~ OU6 features of the
i~ventlon ~lch are, fo~ olarity, descri~e~ in the con-
texts of separate ~rho~iment~ ~ay also be pro~id d in
com~ination ln a single embodi~ent. Conversely, v~riou~
features of the invention which ~re, for b~evity, de-
scrlbed ln the context of a single e~ho~m~nt may a_so be
provided separately or ln any suitable ~ubcomblnatlon.
It will be appreciated by pe~sonfi skill~d $n
the art that the p~esent lnventlon is not limltêd t~ what
ha~ been particul~rly shown and de~cribed herei7above.
Rather, the scope of the present invention is ~.ef~ned
only by the clai~s that ~ollow;
r~n IT~: C~FFT ~RI 11 F ~
FRa~l:LQDP~i P~RRY 24613959 TO: 613 230 ~31321 RUG 1. 1996 6:1-~1 #317 P.2'7
- 2182627
WO 9S/21-3G PC:TIUS95/0~83
23
APPENDIX ~
Recognition according . ~mbination Of signals
pefinitions and data 5trUcture~;
Board tl fil~
Function Init_datatr ( pottbase ) set~ con~munir ~` ~ n w1th date
translatio~ board via port portbase. It retl-ms:
O - colTnnunicaUon was es~u~l'~ed;
-1 - error on board (board ;~ not exi~
Mnt init_datatr ( int );
int ne~ ee ,~ ( void ~;
int read~ int channel, int ~ain );
Mnt read_point ( *truct polnt ~, Int );
/'int read_bl~ck ( struct p~int ', Int ma~_nurr~_poin~,
int time~ut_for_begin, int tirneout_for_end,
int key_mouse_stop ); ~1
Mlnt read_symbol ( strucl point ~, int, Int );
int mshit ( void ):
void close_datatr ( void );
~define PORT_BASE 0x210
A~derlne KEY_STOP 0x1
~denne llOl.JSE_STOP 0X2
#define l~EY_MOUSE_STOP 0x3
#denne PEI~_WAIT 0x1
~:define PEI l_NOW~lT 0x0
l~a~ ~ fil~
struct point_pen
unsigned ax;
unsi~ned ay;
unslgned az;
~nsi~ned pn;
struct point_~ablst
in~ x;
Int y;
Int p;
t~deline SYNCP~OBI r ox~o
~1 IQ~:TlTl ITF ~ ~ IRI 1I F ~
FROM:LRDRS PRRRY 246B959 TO: 613 230 B821 RUG 1. 1996 6:17PM #317 P.2B
2182627
woss/z1~36 . ]~ 153~rj 8j --
24
Da~r.H tile
detine PORr_BASE Ox210
de~ine CSR 0~0
..define GAIN Ox1
4deline DACO_LOW 0 ~2
:~deflne DACO_HIG~t Ox3
~de~ine l;~AC1_LOW Ox~
~de~ine DAC1_HIGH Ox5
#define CHANNEL_AX Ox4
~deffnc CHANNEI _AY Ox5
~define CI~ANNEL_AZ Ox6
#define CI IANNEL_PN 0
~define ST/~TUS Oxe
~derme CHANNEL_EMPTY OxO ,'
~define IDREGICTER Oxf
~define GAIN_1 OxOO
#dcflne GAIN_2 Ox40
~define GAlN_4 0~80
~de~ine GAI1~1_8 OxcO
~define IEP~ Ox21
#deflne IIR Ox20
ti!define IRQOOxOB
~d~fine IR01 0~tO9
#define IRQ2 OxO8
deSino IRC~3OxOb
define IRQ4 9xOc
~denne IR05 OxOd
~define IRQ6 OxOe
~define IRQ7 OxOf
/ struct poinS (
unsT~ned ax;
unsigned ay;
unsi~ned az:
unsigned pn;
I ;'l - :
~deflne ~INUS_PEN 1700
rOdefine PFN_UP Ox2
~define PEI~ DOWN Ox4
~define PEN_THRSLD 200
~define EMPTY
~define BUFS12E Ox80
..define TIME_COUNT 3000
#inelude <dos.h~
SUBSTITU~E SHEEr (RULE 261
FRa~: LRK~S PRRRY 21~00~ TO: 613 230 ~821 fYJG 1. 1996 6:17P1~1 #317 P. 29
~^ ~18~627
WO 9~iJ2143C I ~ pr~ t3
~ier.H file
.. .. ..
Fl LENA~IE; SERIAL.H
Some detinitions used by SER.C
~1
~deline COM1
#define COM2 2
#define COM1BASE Ox3F8 t~ Base port address for Ct:~M1 ~/
~denne C~M2BAS~ Ox2FB r Ba6e port sddre6s ~or COM2
Tho 8250 UART has 10 registers a~o~. '7 ~hrough 7 pon ad~fe~i~s.
Here Qre their ~dd,~sse6 telative to COM1BASE and COM2B~S~, Note
thal the baud rate reglstcn, (DLL) and ~DLH) are actlve only when
the Divlsor-La~cl1 Access-Bit ~DLAa) is on. The ~DLAB) 18 blt 7 o~
lhe (LCR).
o ~XR Output data to the serial porl.
o RXR Input data from the serlal port.
o bCR Initiall2~ the serial porl.
o iER Controls Intenup~ generatlon.
o IIR IdenLfi s Interrupts.
o MCR Send contorl signal6 to the modem.
o LSR Monitor 1hG st~tus o~ the serial port.
s o NISR Receive st~tus of 1he modern.
o DLL Low byt~ ol beud rate divlsor.
o DHH High byle o1 b~-Jd rate divisot.
~/ .
Xde~ine TXR O r TransmN tegister (WRITE) ^/
#de~ine RXR O r Receive reglster ~READ) ~/
~:de1ine IER 1 /~ Interrupt Enable
:~define IIR 2 I Interrupt ID J
#deflne LCR 3 /' Llne control ~I
#deflne MCR 4 /- Mo~emcontr~l /
~detine LSR 5 /t LineStatus
:~deline MSR 6 r ModemStatu6 /
1~define DLL O r DivisorL~tch Low ~/
l~define DL~ 1 /^ Divisor latch Hlgh '/
I = .. .. . .
Blt valuss held in the Llne Conlrol Reglster ~l.CR).
blt n.-_n 9
0-1 00-5 bits, 01_6 blls, 10=7 bits, 11-8 blt8.
2 Stop bll~,
3 o-pa~ty ~ if, 1=parlly on.
4 O=parlly odd, 1_parlty even
Sticky panty.
6 sel break.
Toggle porl addresses.
, . I
~define l~lO_PA~ITY 0~00
#define ~VEN_P~RITY Ox18
#deline ODD_PARITY Ox08
SUBS71TU~F .C~JF~ ~
FROM:L~DRS PRRRY 246B959 T0: 613 230 ~21 RUG1. 1996 6:18PM #317 P.30
WO 9.U21~36 2 1 8 2 ~ 2 7 P~9 101~83
26
E~it values held in the l ine Slatus Re~lster ~LSR).
bit m~aning
,,, .. ,....................... :
0 Dala ready.
Overr~n error - Data reglster o~ el..
2 Parity srror- bad l,~r.~lsslon.
3 Framin~ error - ~o stop bit was ~ound.
Break detect - End to tran6nl1~1un re~uestnd
5~ Transmltter holding register Is empty.
6 Tr~r,sr"i~tar shlft register Is empty.
7 Tlme out- off line.
~define RCVRDY 0x01
#detine OVRERR 0x02
~define PRTYERR 0x04
#dcfine FRUIERR 0x08
~define BRKERR 0x10
~define ~M~RDY 0x20
*deffne XM~RSR 0~40
#define TIMEOUT 0x80
r
Bit valuo~ held In the Modem Output Control Regi~ter (MCR).
bit meanln~
. .
O Data T~rrninsl Ready. Computor ready 1O 9c.
Request To ~end. Cornputer wants to ~end data.
2 a~l~al1a~ output ~1
3 ~uxlllary output #2.(~ote: Thls blt must be
6et to allow The cornmu, -qt: n~ cud to ~end
Interrupts to the system)
- 4 UART ouput looped back es Input.
5-7 not used.
tldefin~ DTR 0x01
#define RTS 0x02
~define MC_INT oxoa
Bit values held in the Modem Input Status np ~;t~r tMSR).
bit meaning
_ _
O delta t::lear To Scnd.
delta Data Set Raady.
z d~lta Rin~ 1n - r.
3 delta Data Carrler Deteet.
4 Clear To Send.
Data Set P~aady.
6 Ring Indlcator.
7 Data Carrier De~ect.
~define CTS 0x10
Jtceline DSR 0~20
CT~Tl I~F ~HEEI (RUL26)
DRS PPRRY ~4~ TO: 613 230 ~21 RlJG 1. l~G 6:18P~1 #317 P.31
218~627
Wo 95t21436 I . 11-J: 3~ ~1483 --
27
Bit v~lues held In the Interrupl Ena~le Register (IEf~).
bit meaning
.. ..
0 Interrupt when data received.
Inlerrupt whcn transmltter holdin~ re~. ernpty.
Inlerrupt when data reception error.
3 Interrupt when change in modem slatus regls!er.
4-7 Not used.
. . I
#d~fine RX_INT 0x01
.. .
r . ~ .
Bit values held In the Inlermpt Iderlf~ . n f~e ,;ster (IIR).
blt meanin~
.
O Inl6rrupt pending
1^2 Interrupt IC) code
00~Change in mOdsm stat~ ro~ister
01-T,~r,~,..iller holdlr~g regls1er empty,
10=Data ~cel~..d.
11-r~c~ption error, or break encountered.
3-7 Not used.
., I
~defin~ RX_ID 0x04
ffde~ine RX_MASK0x07
These are the p0r~ ~d~lre~es ot the 825g Pro~ramm~bls Interrupt
Controller ~PIC).
~1 .
*define IMR 0x21 r Interrupt M~sk P~egister port '/
~d~tine ICR 0xZ0 1 Interrup~Control Port ~/
An end of inlerrupt needs to be sent to the Control Port ol
tho 8259 when a hardw~re interrupt ends
1
#define EOI 0x20 / End Of InterrL~pt I
The ~IMR) tells the (PIC) to sen~ice an interrupt only If It
Is not m~sked (FALSE).
1
#d~fine IRQ3 0xF7 r COM2 ~/
#detine IRO4 0xEF /~ COM1 /
The ~IMR~ t~lls th~ (PIC) lo ser~ioe an interrupt only If It
is not masked (FALSE).
1 .
~define IRQ3 01~F7 / COM~ J
~define ll~Q4 0~tEF r COM1 /
SUB~ JTE S~EEi (RUlE 26~
FRO~1:L~DRS PRRRY 24G83~ TO: 613 230 13821 RUG 1. 1996 6:19PM #317 P.32
~182!i27
~09~143C r~J~ 483
int llag; 2B
int SetSerlal~);
int SetOthers(lnt Porlly, in1 Bils, int StopBlt),
int SetSpeed(int Speed);
int SelPort(int Port):
void inTt_serial~v~
void comm_off(~old~;
void s~ (bll Pon. Int Speed, Int Parity, Int Bits, int Stop~11);
int putchpon~char);
void putstrport(char 3;
int 6oleh~ (vo~d);
vold offport():
S~rsonsl,H nle
r ~- . .
FILENAME: SERCONST.H
Sorr~ definhlono used by SER.C
The 82~0 UART has 10 reglslers ~ç~- ~le through 7 port addte~ses.
, Here are their ~d~ 2s rela~v~ to COM1BASE and COM2BASE. No~e
that th8 bsud rate reglstsrs, (PLL) and (DLH) are active only.w~en
the Divisor-La~ch A~s~ 81t (DLA~) Is on. The (DLAEI) i6 blt 7 ~f
1he (~CR).
o TXR Ou~put data to the serlal pcr~
o RXR Input data from the serial port.
o LCR Inl~l~llze the serlal port.
o ICR Controls lnterrupt generation.
o IIR IdenU,. s interrup~s.
o MCR Send eonto~ signals to the modem.
o LSR Mon~tor the status of tlle serlal porS.
o MSFt Recelve statl~s of the modem.
o DLL Low byte of baud rate dlvlsor.
o D~ High by~ of ~aud rate divisor.
. I
#defino TXR O r Tran6mlt register (VVRITE) 1
#define RXR O 1~ Recelve regi~ter (P~EAD) /
~define I~R 1 ~ Interrupt Ensble
#define IIR 2 r InterruptlD /
~define LCR 3 r Line control /
~define MCR 4 r r~Jlodem control ~1
*de~ine LSR 5 r Line StetlJs
.'tdefine ~SR 6 / ModemStatus ~1
#define DLL O r Divi60r Lalch Low /
ffdeffne DLH 1 r ~ivisorlatch Hioh ~I
~denne DLAB 0~80 1 ~/ :
Bit values held in ~he Linc Control Register (LC~).
blt meaning
. _ .
C!l It~CTlTI ITF .~I~E~ ~RUJ~ 26)
LRDR5 PRRRY ~ TO: 613 230 8~21 ~ 19966:19P~ #317 P.33
WO 9SQ1~3G 2 1 ~ 2 6 2 7 ~ 9~lol~3
2g
0 ~ 00~5 bits, 01=6 bits, 10-7 bits, ~1-8 bl~s.
2 Slop bits.
S O-parity off, 1~parity on.
4 o_parity odd, 1=parity sv~n.
S Stidty parity.
6 Set break.
7 Toggle porl a~dresses.
/
..define NO_PARITY OxOO
#define EVEN_PARlTr 0~18
~doline ODD_PARI IY 0x08
.
Blt values held In ~he Line Sbtus Re~istsr (LSR).
blt me~nin~
O Dats ready.
Overrun error - Dela regi6~er ov~ r. .Illen.
Parlty enor- bad ~na"~sion.
3 ~ramino srror - No stop ~it was found.
4 Br~ak detect - End to tran~n.isSi~n requ~s~ed
Transmitter holdln~ re~i~ter is empty.
6 T,~h~".ilhr shlft rr~gister is empty.
7 Time out - off lino.
, #deline RCVRDY ox07
~define ov~ERR ox02
~de1ine PRrf~RR Ox04
.. detine ~RMERR ~xOB
"define BR~ERRoxl o
" de~ne XMTRDYOx20
~define X~.qT~SF~ 0~t40
~deline TIMEOUT Ox80
r " ,.
Bit values held in the Modam Output Control Register (MCR).
bi; me~ning
._.
O Da~a Tsrrr~nal Ready. Computer ready to go
Requsst To Send. Computer wants to send da~a.
2 auxlllary output ~1.
3 suxillarl/ output ~2.(Note: Thls bit must be
set to allow t, ;. comrnu., skn~ card to send
interrupts to the system)
4 UART ouput looped back as Input.
5-~ not usQd.
#detine DTR oxo1
~denne R rs oxoz
~define MC_INT oxo~
Bi~ values held in thc Modem Input S~atus Ro~ister (~SF~).
bil rnsaning
... . .
SUBSTITUl~ SHEET lRULE 26)
LRD~S PRRRY --1;a~ To: 613 230 ~21 RUG 1. 1996 6:20P~1 #317 P.34
X182627 -
WOssn~43fi ~ 9 Jo~483 --
0 delta Clear To Send.
delta Da~a Se~ Ready.
2 della Ring Ir ~ -rl r.
3 della Data Carrier Detect.
Clear To Send.
Data Se~ Ready.
6 Rlng Indicator.
7 Dala Carrier Detect.
.. , . . - /
~denne CTS Ox10
#define DSR Ox20
.,
r~
Bit values held in the Interrupt Enabh Re~ister (IER).
blt meanlng
O Interrupt when data ,t ~i d.
Inlerrupt when transrnitter holdlng re~. empty.
Interrupt wh~en data receptl~n error.
3 Int~rrupt when chan~e in rnodem 6htu8 re~7ister.
4-7 Nohlsed.
~. - 1
#detine P~X_INT OxO1
r . --
Blt values held in the Interrupt IdurC~c~ ;n Re~lster (IIR).
bil meaning
o Interrupt pendln~
1-2 Interrupt ID oode
00-Change in modem statlls re~ister,
01-~ransrnltter holding reglster empty,
- 10=Data .ecG~.~d,
11_re.,t ~tion error, or break encountered.
3-7 Not ul~d.
#define RX~ Ox04
#deflne RX_I~ASK Ox07
These are the port add,ess~s ot 1he ~259 ~luy,a~"..able Interrupt
Controller (plc~
1
~de1ine ~ R o~t27 1 Interrupt Ma6k Register port ~/
#define ICR Ox20 r Interrupt Control Pott
~n end of in~errupt needs to be sent to the Control Port of
the 8259 when o hardware inlerrupl ends,
/
~detine EOI Ox20 / EndO~ Interrupl /
SUaSTllUTE SHEEr (Rll~E26)
FROt~1: LRDRS P~RRY ~16~ T0: 613 230 B821 RUG 1. 1996 6: 20P~1 #317 P. 35
- 2182627
~0 9Y~1~3~ 5-~483 --
31
The (IMR) ~ells the ~PIC) to sorvice an interrupt on~y l~ It
is not rnaskcd (FALSE)
1 .
nsi~ned char IRO[â~ 0x01, -0x02, -0x04, -0xB0,
_Q ~0,-0x /
~Sdefine IR~3 0x~, COM2 ~/
~define IRQ4 0x~F r COM1 '/
in~ SerSetPorlBase ( int, unsigned ~ );
int ScrSetSpe~d ( unsisned, long );
int SerSetBitsPari~ySlopBit ( unsigned . Int, int, In~
Int SerPutChar ~ unsigned, ~ d char ):
int SerPutSlring ( unsl~nod, u-- .ig~nd ehar );
Inl Serlr.i''`~rSter ( unsigned );
int SerGe~Char ( und~ned );
int SerTestDSR ( unsigned );
Int SerTestCTS ( unsl~ned );
/~ int nag;
Int SetSerial();
int SetOthers~inl Parity, Int Blts, int StopBit);
Inl setspeed(int Speed);
int SetPon(int Port);
void inl~_ser"~vs7ir);
void comm_of~(void):
void sel~llport(ln~ Port, int Speed, int Parlty, Int Bits, int ~t~Rlt);
in~ putchpon lchar);
void puts~rpor~(char);
int ~0tcnport(void);
~old of~port0;
'-1
T~hlel.~ flle
~dR1ine PI~N_DOWN
.. define PEN_UP 0
#define PE~_OUTPROX 09
~define TBL_WACOM_II 3
~define TBL_DATA_ASCII
J~define TBI _DATA_81~A~Y O
J~define TBL_MODE_S~REAM 3
1tdefine TBL_MODE_SUIITWI_STREAM 2
~tdefine TBL_MODE_SUBh~S5 u O
#denne TBL_MODE_POINT 0
#de~ine TeL_TYPE_ABSOLlJtE O
~define TBL_TYPEJRELATI~E
~defir~e TBL_MILLINIETERS 0
#define T9L_INCHES
#denne TBL_AI_WAYS_TRA~.'SMIT_YES
~d~Sin~ TBL_ALWAYS_TRANSMIT_NO 0
#d~fine 'rBL_BAUD_1 9200
Jldefine TBL_BAUD_9600 6
#deffne TEIL_E~AUD_4B00 5
#define Tf~L_BAUD_2400 4
fldetine TBL_E~AUD_~200 3
~dcrine TBL_8AUD_600 2
Jtdefine TeL_BAUD_300
~1 IR~TI~I ITF .~ rRI 11 1~ !~R~
FRa`1:LqDRS P~RRY Z~0~5~ T0: 613 230 8~21 RUG 1. 1996 6:20~t #317 P.36
- ~18~27
WO 9S/21~3G 1J~lru:~g~ 83 - -
32
~;de~ine ~E3L_~AUD_150
t;de1ine TE;l _PARlTY_r~loNE 0
~detine TE3L_PARllY_ODD
~de~ine TBL_PARITY_EVEN 2
~:d~1inc TBL_STOP81TS_1 0
#define TBL_SrOPBlTS_2
#detine TBL_DSR_IUO~JITOR_OFF 0
~defineTBL_DSR_~ONlTOR_O~ 1
~defineT~L_DATALENGTH_7 O
~dcfine~BL_DA~ALENGTH_8
~dofineTBL_TRANSFER_RATE_~AX 7
~delin~TBL_TRANSFER_RATE_~00 6
~de1ine TEL_TRA~SFER_RATE_67
#dofineTBL_TRANSFER_RATE_50 4
~dofineTBL_TRANSFER_RATE_20 3
#define T~L_TRANSFER_RATE_10 2
ffde1ine ~BL_TRANSFERLRATE_5
ëdefine TBL_TRA~ISF~ER_RATE_1 0
#defineTBL_ORlt31NLOG_UPPER LEFT
~define TBL_ORIGINLOG_LOWER_LEFT O
~deflne TBL_~ATA_TE~MINATOR_CR_LF 2
#define TBL_DATA_TERlullNATOR_LF
~de~ine TBL_DATA_TERMINATOR_CR 0
int read_poin~_tablet_pen ( unsigned, Int,
stNd poln~_teblet ~, 6truct point_pen 18~ );
int tind_se~pa~r.æt~r~_tablet ( int compon, unsigned 'pG~ Se ):
int ini~_tablet ( int port, unsigned ~on~ase, int cG~l".land_set,
int data_formEIt, Int oper~l;on_ node, Int orlgln_type,
int unit_mssure, int always_transmit, In~ spoed,
IM PantY, int stopbi: ~ Int dsr_monltot,
int dabl~ngth, int transfer_r8~e, int crlg_lo~,
in~ data ~,""~ ~tr~r, int ma~ t, in~ max_y );
vold clos~_tablet ( unsign~d potl~es~ );
SUBSTITUl~ SHEE1 (RULE 26~
FROM:LRDRS P~RRY Z4G~ T0: 613 230 ~21 RUG 1. 1996 6:21P~ #317 P.37
'~182627
... .
WO 9~121436 1 ~~ 1483 ---
33
I R~adina ~rom devlco
This procedure reads s~ hr ~ni~ed d~ta lrom ~he graphic tablct and acceler., .,ehl i r
nt read_point_lablet_pe~ ( unsigned pv~tb~se, int re~d_pen,
struct point_tablet tablst,
suucl point_pen p~n~8] )
int ind_paclcsge _ o, reply, debug~10~, I;
v,-siyl,ed ~har p:~agp~ = { O, O ~ O ~ O ~ O ~ O ~ O );
if ( lead_pen )
read_poin1_pen ( &penl0] );
l- O ;
Waltin~ for syn~hr~-bit ~r
do
if ~ ~ reply ~ SerG~tChar l pu.lbass ) ) c 0 )
retllrn reply;
debvg~ reply;
if ~ ~ P~ ll = (char) raply ) 8 SYNCROBIT
break;
) while ( ind_p~ e~ c 10 );
r Error ~ No synchro-bit In 10 bytes /
j~ ( ind_paCka~e ~10 )
return SER_SYNC1~081T;
I Read the next 6 bytes from tabht end 6 polnts from zcc.~l~r~l..e(tt /
lor ~ ind_package = 1; Ind_package c 7 ind_p~-~k;~e~ )
if ( read_pen )
read_point_pen ~ 8pen[ind_package] )
If ( ( rl~ply - SerGelChar ( po,l~_~ ) ) c o )
retum reply;
pa~Agelind--packa~] = (char~ reply;
I^ R~ad last point trom a~ e!e.v...eter
it ( read_pen )
read_point_pen ( &pen[ind_psclcage~ );
r Caleu -1es the values o~ the si~nals for table~ ~/
1able~-~x - ( p~ DPl0] & 0x03 ) cc 14;
table~-,x . = ( p~rlt-g~ lL 0x71 ) cc 7;
tablet-~x ~= ( pa; l ~ 2] 8 0x7l );
p~rl .ge~o] ~ 0x04
tablet-~x = table~-~x;
tabls~-~y ~ ( package[3] ~ 0x03 ) cc 14;
tablet-~y ~ ~ package~ ox71 ) <c 7;
tablet-~y ~= ( pa- ~3~t5] ~ û~713;
SIIR.~TITI IT~ .~HI;CT (Rl IJ ~
FRa~1:LRDRs PRRRY 2~ , T0: 613 230 8~21 ~UG 1. l~G 6:21P~1 #317 P.3~3
2182627
wo 9snl~36 . 1~~ 4B3
34
tablel-~p = 0;
il ( ! ( paeltage~o] & Ox40 ) )
tablel ~p ~ 99;
i~ ~ p4rkq~el3] ~ 0~04 )
lablet-~y _ - tablet-~y;
Il ( pAe~ set6~ & Ox20 )
~ablet-~p = ( pa~s~l6~ & Ox1t );
return 0;
)
GrA~ 9
/~ Two p.i~d ~s. Nonnalzation In time and Sllterin~ the lnp.~Jt si~na~s by mGoti.' ,ç
void normal ( int nu~old, ~loat arr_oldD, int num_ne~, ~loat arr_r~ewO
double koefl
in~ ind_old, ind_new;
koet~ - ~double) ( nurr~_old~ loat) ( num_n~w~ 1 );
Brr-new~o]t arr_old[0]
tor ( ind_nsw . 1; ind_new c nwTI--new -1; Ind_new
Ind_old ~ (int) ( floor ~ koeff ' Ind_new ) );
arr_new~lnd_new~ = ( ind_old + 1 - koeff ' Ind_new ) arr_old~ir d_old~
( koeft Ind_new ~ hd_old ) arr_old~ind_old ~ 1];
t an_newlind_newl = ur_new[ind_new];
arr_n~wllnd_newl = srr_oldlnun_old-1];
.
float smooth1 ~ int num ~ noat zD )
int ind;
nOat temp;
110at norma;
for (ind ~1, norma ~ O; ind c num - 1 ; irld~ ) {
temp = ~ z~hd -1]+z[indi+z[1nd+1~ 113.:
norrM ~= ~bbs ( ~[lnd~ - temp );
zEindl - tomp
reSurn norma;
)
.~1 IR.~TlTl ITF .~ ~ lRl~E 26~
~ DRS P~RI?R~I' c4GO~l TO: 613 230 8~21 RUG 1. 1996 6:22P~ #317 P.39
`- ~182627
W0 951Z143G ~,y"~ 83 ~ -
111. Pa~ame~er's e~trdclion
(`-q~ on of the parsmetcts or a symbol from the input si~nals ~/
int rnake_par ( char arg_ch )
s~ruct point 1
unsigned int x : 12;
unsi~ned int y : 12;
unsigned in1 ~ : 12;
U.IS;,~ ~d Inl pen: 4;
point, pointsl500];
Int read_noxLsymbol ( Fll E ~, ~truct pointO );
char f71e_narnel40~;
int lei , nurrber_poin1s c o;
f:ILE 'in_file, out_filel103, ~outJnUer , 'out bln;
tloat psraml6][NUMBER_POlNT], sum_part6][NUMBER_POlN~l;
int Indsx e O, max_point;
Int Ind, start;
in~ cur_x, r,~r_y, c~r_z, cur_p,
float arr_~MAX_POlNll, arr_ylMAX_POlN~, arr_ztMAX_POlNt~, arr-p~MAx-polN~
I~ Initiallzation of the resulls arrays to zero 'I
for(ind=O;lnd~6;ind~1 )
for t Index = O; index c NUMBEPl_POINT; Index4 1 ) t
param[ind]tindex] ~ 0.0;
sum_par[lnd~[index] - ;
?
r Id~r,ti~i atbn o~ the ~ile of data 'I
sprinn-t file_name, ~%o3d~smb~, [Int~ ~r~
it ( ( In_file -10pen ~ file_narne, ~rb~ ) ) c~ NULL )
strcpy (ext_err,file_name~;
ret-lrn -4;
stan o;
r Reading dats from file
while ( ( max_poin1 c read_next_symbol ( in_me, polnts ) ) ~ O )
for ( Index c O; indox ~ maX_point; index++ ) (
Qrr_xfindexJ ~ ~nOat) polnts'lndex'.x;
arr_y~lndex3 . ~tloat) points Index,.y;
crr_zlindex] ~ (:loat) pD!"ls';..dex,.z;
arr_p[indexJ - (float) ~ L-.d~ pen
arr_p~O~ = arr_p~ point 1] e 1
start~
nomber_points +- rnax_polnt;
J~ Calling ~he procedure n~ake_par_let for c~ parameters 1 6 1
make_par_lel ( arr_~, arr_y, arr_z, arr_p, param. max_point- 1 );
SUBS~ITUTE SHEEl (RULE 26)
FR0M:L~DP6 PRRRY ~4Ga~ T0: 613 230 ~21 RUG 1. 1~6 6:22P~1 #317 P.40
~- ~18~627 -
Wo 9sr2luG PC~T/US~ 1483
36
/~ Calculating the average o( each parameter ~/
~or ( ind ~ 0; ind < 6; Indl~ ~
~or ( index = 0; index c ~UMBER_POINT Index+~ ) (
surn_parlind]tindex] ~- param[ind3tindex];
..
for ( ind ~ 0; ind c 6; ind+~ )
ror ~ index = 0; index c ~UMBER_POINT; Index~ )
s~m_par{ind]~index] /- start;
5Urrl_p8t[0][0~ c (lloa1) numbet_polnts / ~tart;
fclose ~ in~tile 3;
r wr,lte 8Y9 in Binary file ~1
~printf ( file_name, ~3~ p- ~, (int) ar~_ch );
out_letter ~ fop0n ~ me_nerne, 'wb~);
tor ( index z 0; Index c 6; index~ )
1wrlle ( sum_par{index] . si200t(noat), NUM9EP~_POINT, out_lel~er):
fclose ( out_letter );
rell~rn stert;
void makE_,r~ar_le~ ( float ~rr_x~i, tloat arr_yO . flo~t ,arr_zD .
floa~ arr_pn, tloat paraml6371~UhllBER_POlN'rl, In~ rna~-poin1 )
. I .
noal end_smoo1h;
tloat neu~_arr_xl500], new_arr_yt500~, new_arr_z~S00] . new_arr_p[5301;
int ind, index;
r Call 1Or pr~ pr~.c~ssi,~ 1
normal ( mzx_point, arr_x, NUMBE~_POtl'~T, new_arr_x );
normal ( max_polnt, arr_y, NUMBE~_POINT, new_arr_y );
normal ( max_po~n~, arr_z, NUMBER_POII~IT, new_arr~
normal ( max_polnt, arr_p, NUMBER_POINT, new_arr_p );
max_point = NUMEIER_POINT;
for ( Ind ~ 0; ind ~ rnax_point; ind~ )
arr_x'ind = new_arr_~iinr~];
arr~,lnd, = new_arr_ylndl;
arr_z'ind - new_arr_z,ind];
arr_p,ind~- new_arr_p[lnd~:
~Ivhile ( ( end_6moo~h ~ srnooth1 ~ ma~t_polnt, arr_x ) ) ~ NIJMBER_POINT 110 );while ( ( end_smoo~h c smoo~h1 ~ max_polnt, ~rr_~ NUMBER_POINT I 10 );
while ( ( end_6moo~h = snlooth1 ( ms~t_point, ~rr_~ NUM8Ef;'~_POlNT 110 );
/^ Initialization of parameters ~/
psram[0 o _ ~floaS) srr_pl0~;
paramtl, ,o, - ( arr_~o] - arr_z[01 );
param'2 ,0, = 0.0;
param,3]!0] - o.o;
param,4~103 = 0.0;
pararr~3[01 = -;
~:1 IR~:TITI ~T~ HFFl ~RU~E 21i~
L~s PRRRY 246~959 TO: 613 230 8~21 RUG 1. 1996 6:23P1~1 #317 P.41
~ 2182~27
WO 95/2143G Pcsrus~ ol~u ---
37
param~OJ[1~ lo~l) arr_p~
/' C~lCL~ ;On 01 parameters 'I
param(1][1~ - ~ arr_2[1] - orr_z~o~ );
elev ~ arr_x~2] - arr_x~O~, arr_y~2~ - srr_y[O~, art Zt2~ arr_z[O~,
~pararnl2~l1), 8pararn[3][1
par4m[4~1) = O.O;
par~rn[5]~ O.o;
for ~ index - 2; Index c ma~_point - 2; Index~ ) I
param[O~lindex~ oat) arr_plindex];
p~ram[1]{~ndex] - ~ arr_ztindexl - arr_z[O] );
ele~ ( arr_x[index ~ lJ - arr_x[inde~t - 1], arr_ylindex ~ rr~ index 1l . arr_zlndex + 1] -
arr_z[inde~
¶m[2~[indexJ, ~pararn(~]pndex~ );
an~les ( arr_x[index ~ arr_xrindex~,
arr_ylindex ~ 23 - ur_y[lndex],
arr_z~indsx ~ 2l - ur_z[indexl,
srr_xtlnde~] - arr_x~indcx ~
arr_ylindex] - atr_ylndex - 2~,
arr_zlindex~ - arr_z index - 2],
¶m[~]~index~, ~pararn[5]tjndex] );
index_ index;
paramlOllindexl _ T'~at) arr_plinde~;
param!1J~index] ~_z[index] ~ arr_ztO] );
elev ~ arr_x[index . 1] ~ arr_xlinde~- 1], arr_yllndex ~ rr_ytindex 1J, arr_~[ndex + 11 -
arr_zllndex- 1] .
8paraml2][index~, ¶m~3~11ndexl );
~ param[4][index]~ -;
paramr~rlnde1t] - O.o
Index~;
r ~akul~tion o~ parame~ers for last point '/
param[O]lindex3 _ (float) arr_pllndexJ:
pa!aml1 [index] - ( arr_z[inde~t] - arr_zlo] ~;
parr~mf2 tindex3 = -:
psrarn~3,[index~ = 0-0 i
pr~r~ 4][index~ = O.O;
paraml5]tindex]- O.O;
)
/~ Proced~re nlev ca~rlJIates the SIN and COS o1 the an~le of el~allon '/
~oid elev ~ tloat x, float y, tloat z, tloat 'cos_Ug, tloat ~sin_ug )
lloat norma;
norma~t1loat)6qrl~x~x~y y~z~2)
il l norrna ~ .00001 ) I
'r os_U9 ~
'sin_ug 8 0.0;
return;
)
'cos_ug z ~ (tloat) sqrt ( x x ~ y ' y ) ) I norm~;
~sin ug = z / norma;
return:
)
SURsTITUTE SHE~T r~l IJ ~
LRD~S PRRRY ~4GO~ TO: 613 230 E~1321 fYJG 1. 1996 6:23P~1 ~317 P.42
~18~627
W() gS12143G ' I~ u;~ 1483 --'
38
/~ Procedure angl~s c~ os ~he SIN and COS of the an~le ~ ~t
void an~les ( lIoat x1, lIoat y1, noat z1, float x2, float y2, ~loat z2,
.flo~t cos_ug, noa~ '~in_u~ )
{
~loat normal, norma2, x3, y3, z3;
normal _ ( lIoat ) sqrl ( x1 ' xl I yl ' y1 ~ z1 ~ z1 );
normBz ~ l tloa1~ sqrt ( x2 ^ X2 ~ y2 ~ z2 - z2 );
;f ( norrna1 c .ooo1 il norrna2 c ~ooo1 )
.o;
's~n_ug = o.o ;
return;
~cos_U~ _ ( x~ y~ Zl ' ~2 ) / norma1 / norm~2;
X3 - ( yl ~ z~
y3~x2'~1-xl ~
z3=txl 'y2-x2'yl);
sin_u~ = ( (lloat) sqrt ( X3 X3 ~ y3 ~ y3 ~ z3 ' z3 ) ) / no~nal / norma2;
return;
FROM:LflDR5 PRRRY ~ æ~ TO:613 230 882l fWG 1. 1996 6:23PI-1 #317 P 43
~182627
WO 9~21~3G I ~ ~OIJR3
39
V Tr~inlna procçdures
r Procedure tor preliminary teacl7in~ '/
int first_teach ( void )
FILE ~1p;
FILE Ipout
int ~;
char bul~41 NdxStr[4], symholc[2F6]:
int ndx . O, max_symb ~ 0
Int num_sym;
CGI N~ r,~,1 ,9 data files, ple~se wait-,0,1);
It ~ hpen ~ 's~ ' rlat~, r'~ ) ) 2- NULL )
f
8trepy (exLorr,~ 1 ok rl7~
hlde_w, H ,e ~t (~con~erting data files, please W~ ,o);
return ~4);
~hile ( fscant ( fp, '%s', buf ) ~ 0 )
~ nb~i~[max_symt~t~] ~ bu1[0];
fclose ( Ip )
~pout-~open ("text adp','v~
~or ~ ndx 0; nd~ c max_symb; ndx~
sprintt ( 1~dxStr, ~%03d-, ndx ~;
: If ( ( nvtn-sym~make-par ( 6~."bol~[ndx] ) ~ ~= )
hide_comment ~conv~rti ~ data files, please walt-,O);
return (num_sym);
else lor ~I.O;icnum_sym;i++)
tprintt (1pout,-%c ,symbols[ndO
fclose (~pout);
hlde_co ~ e~ converting data flles, please ~alt~,O);
return ~0)
r prooedurefor ~ pt~tion olpr~.t~ ,es 1
float hu~e ~all_parl100];
int ~irst_sdsp ( Yoid )
(
float old_rec, n~w_rec
Int Goun~2o, ternp
char text;
char strtBOI
if ( ( temp ~ read_tex1 ("try txt~, &tex1 ) ) c O )
retun~ernp);
read_paranl l ~;
new_rec ~ rewgn ~ ^t~ prl', te~ct, O, o );
sprintt (slr,-%31-be1Orc cd~pl~tion-,new_rec);
commenl ~str,-1,1);
do ~
S PRRRY -hiO~ TO: 613 230 8~21 ~UG 1. 1996 6:24P~ #317 P.44
21~2627 --
WO95r2l~3c P~ ,g~GI~83
it (new_rec c o ) ~
hide_comment ~s~r,-1);
while ~ all_parllemp~ ULL )
fa~ee ( all_parltcmp+~] );
rellJrn ((int) neW_rec),
il ~ new_ree > .9g5 )
break;
dd_rec 8 new_rec;
new_rec = recogn ( ~try.prl-, text, 1, 0 );
i~ ~new_rec c ) l
hide,c~ln,nenl (str,-1);
v~hile ~ ailLpartternp] !- NULL )
Sarlree ( all_pzr[len,pw] );
return ~(int) new_rec);
hlde_a,,.u.,e nt (6tr,-1);
~print~ (str,'%3~- in ~ r t 1 n~,new_rec);
comment (str,-1,1);
new_rec = recogn ( "by.prl', text, O, O );
hide_c~.~,....er,t (~tr,-1);
sprintS (str,~,' 3f-aner adaption',new_rcc);
tom~en~ (str,-1,1);
il ~new_rec c O ) ~
hide_coml..ent ~str,-l);
whlle ( alLcarttempl 1- NULL ~ l
~ er~roe ( all_par~temp+~
return ((in~) new_rec);
}
~ whlle ( 'abs ( old_rcc - new_rec ) > .005 & covntt+ c ~ )
hidr~_cornment ~str,-1);
tarfree
while ( all_p~.[~mp] l~ NULL )
1arfree ~ pL~[t~
retum O;
SuBsTlTuTE .SHEf~ ~R~
FRO~:LRD~S PRRRY 21GO~ TO: ~182~327~ 8e21 ~ 1. 1996 6:24P~ #317 P.45
WO 95~ 36 I .~ ;101~83 --
41
V. Svmbol'S recogrlitiOn
stn~c~ point ~
unslgned int x : 12;
unsigned Inl y 12;
unsi~ned int z : 12;
unsignedlnt pen: 4;
) ;
struct reply
(
int ndx;
tloat WQi~ht;
~;
tloat reco~n ~ char 'file_pen, char tex~, Int adapt, int ~vc~rd~ )
(
11oat old_rec, new_rec, probs~l O][ZOJ;
int co~ t=O;
char syrrll~Q1~756], b~t[4];
unslQn~d long ttl;
Int max_symb;
FILE 'in_tite, ~file_symb, ~temp_word;
int symb;
unsigned long sta~ ord, end_word;
float paran~[6~[NUMBER_POl
int index = O, max_polnt:
strud reply repl;
int lemp;
int ~la~ ~d O;
int ind, NumSymbols ,ndY:
struet point symb_pnts lMAX_POlNT~
tloat arr-~qM~t - polNTl, arr_y[MAX_POlNl'l, arr_z[MAX_POlr~ . arr_p~MAX_POll~n;int mapl2561;
int order-O:
char lettersl10]~20],dict_wrds~10]~20]
Int end_o~_word-O;
int wrdlen;
tlDat ~umllOl,maxsum,ndx_maxsum;
char org_wrd(20~,t~ "JI~O];
Int t~_wldth;
in~ i;
If ( ( file_syrnb = fop~n ( ~sy"~bols dat-, ~r ) ) ~= ~ULL ) ~
6trcpy ~ext_err,~y.nbols.dat~):
return (-4);
70r (Ind-o;lndc256;1nd-f~) map[ind]c-1;
ma~symb- O;
~vhile ( fscanf ( file_6ymb, ~,' s~, buf ) ~ O )
(
~P [bu1~o]]~ -symb
5y~"l~ol;~[max-symbt~ - but[O~;
~closc ( file_symb ):
syrnbols[max_symb] = ;
~or ( ind _ O; Ind c 6: Ind++ )
t~l 1~,, ., r, r . _r ~_r ~
FR01~1: LQDRS ~t c4~ T0: 613 230 8~21 RUG 1. 1996 6: 24PI~1#317 P. 46
~182~2t7
Wo 9~143~ PCTlUS~ 3 --~
42
Ior ( ind~x = o; index c NUMBER_POINl; index~.~. )
pararn~ind]~index3 z o.o;
if ( ( in_fjlo c 10pen ( ~ile_pen, ~rb" ) ! =- NULL
..
strcpy (ex~_err,file_pen);
return -4
Indc~c ~ o;
~lumsymbols - 0;
symbs-1;
If (adPpt)
r~pl = make_corr ( param, r;ymbols, symb);
else (
repl, make_corr ( param, ~ymbols, -1);
1~ (repllo].ndxco)
return ( repl[0].wei~ht);
if (repll03.r.d~; sy..l~)
Ng~dl l;
else
Ngood _ Ng~od;
)
fclose ( in_Dle );
lumSy.~l~ols.;_0) return 0;
el~e return ~Ngood/(float)NumSy".~ols);
r C~lc~ n ot 1he ~imilaritv of all the parameters of ~ll the prototypes and the
syn~bol to be r~c~r~kgd l
extern tloat huge 'all_parl100~;
strua reply
(
int ndx;
fioat wei~hl;
~'
strltic Int comm_count = 0, abs_count ~ 0;
in~ obLtunc~ ( noa~ . Int, in1, float ~1003, ~loat p] . Int [10l );
float oorrel_hem ( ~loot [NUMBER_POINTl, tloat [NUMBER_POII~I" . float )
noat correl ( float tNUM~ER_POlN~ . noat ~NI IMBER-polNTi );
struct reply make_corr ( ~loat cur_parl6][NUMBER_POlN n, char 'symi~ols ,;nt symb)
tl~E 'cu~ le;
int ind_repl . ind_oorrct, ind, max_symb, ind_symb, Index;
struct reply arr_repll~0);
in~ arr_lnd[10];
float resl100], nresl7~, old_max_pnt - cur_p~rt03t03, com_wight;
rloat old_m~x_pnt2, corr~ 7], tmp~_par~6]rNUi~BER_POlNT];
char bu~[~];
int iterat
s~ruct reply n;
in~ i,j;
SUBSTITUTE SH~E~ rRI IJ F ~
FRa~i:L~S P~ ~ TO: 613 230 ~1821 ~UG 1. 1996 6:25PI~1 #317 P.47
- ~18~627
WO 95/~1436 rcTlusg~l483~~-
43
max_symb = strlen ( symboIs );
lor ( Ind_symb = o; ind_syrnb c max symb; ;nd_symb+~ ) (
~or(i-O;ic6;
for(j=O; jcNUMeER_POlNT;I+~
Imp_par[i]~1 z alI_partind_symb~ OO+j1;
if ~ ~mp_parlO~[O~ ~ o ~1
cur_parlO3~0] = old_max_pnt;
eo~r{lnd_symb3~N_PA~ 1.0' ~
min ( labs ( tmp_parlO~[O] - cur_parlO~tO] ) / cur-parto][ol, 1 ) );
old_max_pnl - c~lr_partO~lO~;
~rnp_parlO][4] ~1.;
cur-paqo~[o~
corrllnr~_syrnb~lO] = correl_hem t cur_parlOl, tmp_p~rlO], .~ );
tor ( Ind ~ 1; Ind c N_PAi~ -1; Ind~ ) ~
cotrllnd-symbl~ind~ ~ correl ( cur_parlIndl, trnp_par~ind3 );
]
)
else
for ( Ind _ 1; ind c N_PAR - 1; ind~+ )
corrlind_symb~rmd~ = 0.0;
)
)
if (symbcO)
, index = ob]_tunct ( cor. . ma~symb, hl_PAR, tes, nres, arrJnd );
Iterat=20;
else
f
sprintt ( bu7, ~%Q3d~r~ int) ar~ ollsym~
~ortlrO;lc6;i~)
tor ( j c O; j ~ NUMBER_POINT; J~ )
tmp-pertqo] ~ all_parlsymyD~1oo+Jl;
iterateo;
whlle ( (I"dax~obJ_tunct (eorr,max_syrnb,N_PAR,res,nres, arr_ind))>O
~ ~arr_lndtOp.~symb))
[
1f (iterat~1~) break;
for (Ind-O, Ind_corre~-O; IndcN_PAR-1; Ind++)
1t (eorrlsymy~lnd]~o.95 ' nreslmaJ)
Ind_corrct+~;
tor (index=O; index ~ NUMBER_POINT; index~+)
trnp partind]~index] = tmp_par [Ind][inde~q~.g
~Cur_par{inaJ~ de.~] `.1;
)
it (corrtsyrnb3~1ndlcO.g5 ~ nres~lnd])
ind_corrd~+;
Unp_partG]IO] = Imp_par~O]10~ ~ .9 ~ old_ma~_pnt ~ .1;
I~ (!ind_corrc
eral = ~u;
break;
. ) .
FROM:LP~S P~ ~'3 TO: 613 230 ~21 RLG 1. 1~96 6:25P11 #317 P.4~
2182627
W0 9.sl2l~36
44
iteral~
cur~parlO]IO)- old_ma~_pn~;
corrlsymbJlN_PAR-1]-1-fabs(tmp_par[O]~Ol cur_parlo]lol~/ cur_parlO~[O];
old_max_pn~ - cur_parlO~[O~;
old_rr~x_pnt2= lmp_parlO][O~;
tmp_parlol(o~
cur_par[O][~] = 1;
corr~symb~O~ c correl_hern ( cur_parlOl, tmp_par[o], 9 );
tor ( lnd z 1: Ind c rJ_PAR -1; ind+~ 3 ~
corr[syrnbl[ind~ - correl ( cur_par~lnd~ . tmp_p~r[indl ~;
)
cur_par~o~lOl ~ old_max_pn~;
tmP-p~rto]lo~ 5 old-rnax-pnl2;
r wnlie /
) r ~Ise '/
if ((Iterat~20) ~ ~index~O~ ~8 (iterabO))
(
cut_file = ~pen ( buf, 'w+b- );
fo~ ( Index - 0: Index c N_PAR,,1 Index l ~ ~
lwrite ( tmp_parfindex), skeof ( float ), I~UM3ER_POINT, cLIr_file );
tclose ~ cur_file
for(i=O,ic6;h+~
tor ( j = O ; j ~ NUMBER_POINT ; j++
all_par{symb]ll-100~D = trnp_par[
Index ~ min l index, g );
arr_ind!index~
~ res~rr_ir~l'..dcxn=-1;
~or (isO;jc=irlJex,l+~)
arr_repl[i].ndx.arr_ind~
arr_repl~i].wel~ht=-res[arr_ind[i3];
return zrr_repl;
)
I Ca~cul~ n of correlation bet~Ner~n two vect~r~ ~l
float co~rel ~ tloat tirst~NUMBER_POlNTl, float second[NUMBER_POlNn )
float sumxy = 0.0, surnx = 0.0, sumy - 0.0, sunlx2 = 0.0, s~!my2 ~ 0.0;
int l_d, I_s;
for ( I_s = O; i_s c NUMB~R_POINT ~_s~ ) (
sumxy += first~ s~condr_~];
surrLx ~_ n-stti-s1;
~surny ~_ ser~ond[i_ri];
~ mx2 ~ ~irs~ s] ' tirst[l_s];
sumy2 ~ second[i_sl ~ second[i_s~:
)
If ( ( 6urrlx2 - sumx ~ sumx / NUMBER_POI~T ) c O ll
( sumy2 sumy sù~ny I NUMBER_POINT ) ~ O )
return o;
il ( ( sumxy _ ( sumxy - sumx ~ sumy I NUM3ER_POINT ) I
ClIQ~!rlTIIT~ 1IJ 1 !~
FRa`1:L~DRS PflRRY ~460~ TO: 613 230 8~21 RUG 1- 1% 6:26PI~1 #317 P.49
WO ~Q143C 21 8 2 6 2 7 ~ J.,~ 4R3
sqn ( s~mx2 - sumx ~ sumx / I~lUMBER_PolNT ) /
sqn ( ~umy2 - s~)my sumy / I~ JIBER_POIN r ) ) c .~ )
re~urn O;
rell~rn sumxy;
/' Similarlty ~Jnction tor the parameter ot pen upldown /
tloat correl_her~ loaî par7[NUl~.~E~_POl~ , lloat p~rztNuMElE~ - polN~, noat b~rder )
in1 index;
~loat resull e 0.0;
~or ( index = 1; index c 1~IUM~ER_P011~1T; indsx 1 ~ )
result += ~abs ( parllindexl - per21index] );
result 1- ~UMBER_POII~IT;
result . 1 - result;
I~ ( re~ult c border )
retum P;
return result:
)
r Sele_t;on o~ the list of symbols that are likely to be the ~ymbol to be r~c~r,i~ed '/
int ob~_1unc~ ( tloat srrt100]p], int n_~yrnb, int n_par,
tloat res~100] . tloat nres~7~, im arrindex[30] )
' . ~ int ind_s, Ind_p, ind_arr = O;
: 110at max_res - 0.0, cur_res, abs_res = 0.0;
Int result_ -1
lor ( ind_s ~ 0; Ind_s c n_~ymb; ind_s~+ ) ~
10r ( ind_p = O, cur_res 0.0 ind_p c n_par; ind_p+~ )
eur_res ~= arrt.- ,_s]~lnd~
res[ind_sl ~ c~n_res;
I~ ( cur_res > m~x_r~s
resull = ind_~;
rnaY_rss c cur_re6;
abs_res = ma~_res ~ .85
d~ (
arrindexlind_an~] = result;
r~s[result3 ~ ~ reslresult];
for ( Ind_s = O, ma~t_res c O.o; Ind_s c n_symb; ind_s++ )
I~ ( reslind_sl ~ max_res ) (
resull = ind_s;
max_res_ res[lnd_~];
3 while ~ ma~_res ~ abs_res && Ind_arr c ~0 );
lor ( ind_p = 0 ind_p c n_par; Ind_p~ )
tor ( ind_~ = O, nres[ind_p] _ -5; Ind_s c n_syrnb; Ind_s~ )
nresllnd_p] - max ( art[ind_s~[ind_p] . nresllnd_p] );
rcturn ind_srr;
SUBSTITUTE SHEEr (RULE 2~)