Rochester Institute of Technology
RIT Scholar Works
Theses
Thesis/Dissertation Collections
1989
Three-dimensional data input using Sutherland's
two-dimensional tablet strategies plus enhanced
user feedback
Myra Bennett Pelz
Follow this and additional works at:
http://scholarworks.rit.edu/theses
This Thesis is brought to you for free and open access by the Thesis/Dissertation Collections at RIT Scholar Works. It has been accepted for inclusion
in Theses by an authorized administrator of RIT Scholar Works. For more information, please contact
.
Recommended Citation
Rochester Institute of Technology
School of Computer Science and Technology
Three-Dimensional Data Input
Using Sutherland's Two-Dimensional Tablet Strategies
Plus Enhanced User Feedback
by
Myra Bennett Pelz
A thesis submitted in partial fulfillment of the requirements
for the degree of
Masters of Science
Approved by:
Dr. John Schott
Dr. Andrew Kitchen
Dr. Peter Anderson
Title of Thesis
-i
NuL -
l),
~riJ(
i
;'1.11
~ ~r
aii·X
-he
UU~,
It<'
11£. .
~
if}?
~~~Yld.i- 7~r .J{,t<-Z<t-L~~ r&~ 13K/~'iLUA (~JVr
Mbtuk
I
hereby (grant/deny) permission to the Wallace
Memorial Library, of
RIT,
to reproduce my thesis in whole or in part. Any reproduction will not
be for commercial use or profit.
or
1
.Problem
Statement
1
2
.Previous
Work
2
3.
Sutherland's
"Three-Dimensional
Data
Input
by
Tablet
6
4.
Theoretical
andConceptual
Development
10
5.
System
Implementation
16
6
.Results
58
7
.Bibliography
7 7
Appendices
Appendix
A:
Technical
Documentation
A-l
Appendix
B:
Testing
Documentation
Feature
Testing
B-l
User
Testing
B-15
Although
the
representation ofthree-dimensional
computerimages
has
become
increasingly
more sophisticated andcomplex,
the
problem ofmaking
three-dimensional
data
availableto
the
computer continues
to
plaguegraphics
systemsdesigners.
In
1974,
Ivan
Sutherland
developed
a systemthat
defines
athree-dimensional
point
by
digitizing
the
same pointsimultaneously
in
two
different
two-dimensional
views of an object.This
projectwill
implement
Sutherland's
system,
withrefinements,
particWork
All
computergraphics
systemsthat
presentthree-dimensional
images
mustbegin
with amodel,
ordescription,
of athree-dimensional
object or scene.One
ofthe
moredifficult
problemspresented
to
graphics
systemsdesigners
is
how
to
makethese
often complex models available
to
the
computer,
sothat
they
canthen
be
manipulated,
modified and analyzedby
the
graphics
software.
The
most commongraphical
representation usedfor
modeling
solidthree-dimensional
objectsis
the
polyhedron.This
is
because
polyhedra,
comprised of polygonfaces
whichare
in
turn
comprised ofonly
points andlines,
can with adequatecomplexity
approximateany
solid object.Many
systemshave
been
developed
for
constructing
complexmodels
using
polyheda.Some
have
started with physicalthree-dimensional
models andhave
then
used avariety
of methods-special
lighting,
drawn
lines,
light
grids
andlaser
beam
patterns,
as well as sound andmicrowaves,
projected onto
andreflected off of
the
object's surface.Appropriate
detectors
orspecially
placed cameras arethen
usedto
capturethe
images.
For
example,
by
illuminating
a scenefrom
four
different
directions,
Shirai
andTseyi
[1971]
extractedfour
line
drawings
of an object
using
extensiveimage
processing
and artificialintelligence
techniques,
andthen
usedtwo-dimensional
logical
operations
to
create a singlethree-dimensional
image
actor's
face,
andtook
photographssimultaneously
from
three
positions
using
carefully
registered cameras.Measurements
werethen
taken
from
these
cameras,
the
coordinatestransformed
to
three-dimensions,
andthen
recast as polygons.More
recently,
Altschuler
[1982]
used a series oflaser
beam
dot
patterns whichwere
rapidly
projected onto a surface and viewedfrom
severalperspectives .
If
a physical modelis
available,
athree-dimensional
sonicdigitizer
may
be
used,
as well asdigitizers
that
employ
atransducer
placedin
contact withthe
modelthat
cantrace
the
model's actual contours.
Other
systems,
ratherthan
working
with a physicalmodel,
expect
the
userto
createhis
three-dimensional
modeldirectly.
Some
ofthese
systems,
such asBraid's
[1975],
arebuilt
from
more primitive objects
that
are made availableto
the
user,
suchas
cubes,
wedges,
and cylinders.Many
other systems requirethe
manipulation of polygon
vertices,
edges andfaces.
Unfortunately,
systems
that
require modelsto
be
built
from
primitives canbe
time
consuming
andlaborious
when agreat
deal
ofcomplexity
is
required.
Still
other approachesto
providing
the
computer withthree-dimensional
data
usetwo-dimensional
representationsof
objects,
wherethe
objectsthemselves
cannotbe
manipulatedby
projected effects or precise viewing.
Negroponte
[1973]
used asystem which allows orthographic projections
to
be
drawn
methods,
representations.
Sutherland
[1974]
used a simpler system ofdigitizing
multipletwo-dimensional
views ofobjects,
i.e.,
mechanical
drawings
or photographs.The
two-dimensional
coordinates obtained
from
the
multiple views werethen
transformed
into
three-dimensions.
More
recently
researchershave
been
concerned withthe
modeling
of solid objectsfrom
mechanicaldrawings.
Wesley
andMarkovsky
[1981]
developed
aformal
mathematical procedurefor
generating
solid objectsconsisting
of planarfaces.
Sakurai
and
Gossard
[1983]
expandedtheir
workfor
non-planar objectsand
Yoshiura
[1984]
added naturallanguage
processing
to
handle
missing
information
and ambiguities.However,
all ofthese
attempts require perfect and consistent orthographic projections.
In
the
end,
the
input
system chosenis
largely
dependent
onthe
application;
that
is,
the
type
andcomplexity
ofthe
modelrequired,
andthe
availability
of a physical modelthat
canbe
manipulated or of mechanical
drawings
ofthat
object.The
Center
for
Imaging
Science
atRIT
wanted ageneral
purpose systemthat
could
generate
three-dimensional
modelsusing
photographs,
ratherthan
mechanicaldrawings,
sincethe
latter
will notbe
available
to
them.
They
alsohoped
to
model objects ofany
size,
particularly
onestoo
large
to
be
brought
into
alaboratory
to
be
projected with markings or
precisely
viewed.To
implement
such asystem,
Sutherland's
1974
paper was chosen as a model sinceit
requires
a minimumamount
ofhardware,
all ofwhich
is
currently
Sutherland's
"Three-Dimensional
Data
Input
by
The
position of athree-dimensional
pointin
Sutherland's
system
is
found
by digitizing
the
point's projectionin
each oftwo
views ofthe
object simultaneously.Sutherland's
system usesa
large
areadigitizing
tablet
(3ft
X
4ft),
allowing
for
the
digitizing
of several views of an object at onetime.
Both
orthographic projections
(mechanical
drawings)
and perspectiveviews
(photographs)
of an object canbe
accommodated.A
matrix,
representing
the
three-dimensional
to
two-dimen
sional
transformation
for
eachview,
is
first
developed.
This
is
then
usedto
"undo"the
viewing
tranf
ormation of eachtwo-dimen
sional
data
point and convertit
to
three-dimensions.
The
userbegins
the
processby
specifying
the
tablet
areaoccupied
by
each ofthe
two-dimensional
viewshe
is
using.He
does
this
by
pointing
to
the
lower
left
and upper right cornerof each view
area,
thereby
defining
a rectangular space alignedwith
the
tablet
axesfor
each view.This
allowsthe
systemto
automatically
determine
which viewis
being
used,
and allowsthe
user
to
changefrom
one pair of viewsto
another at will.The
user mustthen
specify
whatSutherland
refersto
as"exemplary"
points,
which aretwo-dimensional
data
pointsin
each view
for
whichthe
corresponding
three-dimensional
worldcoordinates are
known.
They
are calledexemplary
because
they
are examples of what
the
viewing
transformation
did
to
certaintransfor-mation
from
three
to
two
dimensions.
Using
both
the
known
coordinates of several pointsin
three
dimensions
andtheir
corresponding
projectionsin
two-dimensions,
a matrix
is
formed
for
each view andis
then
inverted.
Using
this
new matrixto
transform
all subsequent points accountsfor
not
only
the
viewing
direction
of eachview,
but
alsofor
any
tilt
ofthe
view onthe
tablet
and skew ofthe
tablet
axes.It
also
easily
accommodatesdifferent
scalefactors
for
different
views.
Since
the
exemplary
pointslie
atdifferent
distances
from
the
origin,
the
matrix will contain automatic scalefactor
compensation.
Sutherland
also points outthat
using
exemplary
points
to
specify
the
viewing
transformation
is
often muchsimpler
than
specifying
the
viewing
parametersdirectly,
andit
relieves
the
user ofthe
needto
know
the
mechanics oftransfor
mations.
Exemplary
specificationmay
be
usedfor
both
orghographicand perspective views.
However,
orthographic views requirethat
only
the
origin ofthe
three-dimensional
coordinate systemin
each view
be
specified,
along
with a point on each ofthe
three-dimensional
axes.Perspective
projections requirethat
coordinates of at
least
six pointsin
three
dimensions
be
identified.
In
eithercase,
the
exemplary
points chosen mustnot
be
coplanarin
three
dimensions.
Once
the
transformation matrixhas
been
defined,
the
useris
ready
to
digitize
the
pointsin
his
two-dimensional
viewsto
views of
the
object aredigitized
simultaneously,
using
two
pens.Sutherland
arguesthat
the
two
pen system makesit
easierfor
the
user
to
think
aboutdigitizing
the
same pointin
different
views,
and
that
it
allowsthe
userto
keep
better
track
of wherehe
is
in
the
digitizing
process.To
facilitate
this
process,
Suther
land
mountsthe
penfor
one ofthe
viewsin
astand,
whiledigitizing
corresponding
pointsin
the
second view.This
leaves
the
userfree
to
concentrate ondigitizing
one view at atime.
This
system works wellfor
orthographicprojections,
but
notfor
pairs of photographs
in
whichdirections
ofthe
axes are notclear.
Each
pointin
the
pair ofviews,
along
withtheir
respectivetransformation
matrices,
defines
aray
in
three-dimensional
space.
Together
the
two
define
athree-dimensional
point.However,
because
there
aretwo
coordinatesin
eachview,
for
atotal
offour
coordinates ratherthan
three,
one coordinateposition will
be
redundant.In
orthographicprojections,
the
user can
specify
that
one coordinatein
each ofthe
viewsis
to
be
ignored.
In
perspectiveviews,
however,
the
four
planesmay
not
intersect
at a singlepoint,
soSutherland
suggeststhat
the
redundant
degree
offreedom
be
removedby
somebest
fit
method.The
three-dimensional pointsthat
have
nowbeen
identified
are
the
verticesthat
define
a collection of polygonfaces.
These
form
the
"skin" ofthe
three-dimensional
model.Sutherland's
system allowsthe
userto
define
polygonsdoes
this
by having
the
userdefine
a of polygonsby
digitizing
a set of pointsthat
lie
on each side ofthe
row.The
systemautomatically
generates
the
quadrilateralsbetween
each set of points.
The
user also must collecthis
pointsinto
either aVisible
(V)
set or anInvisible
(I)
set of vertices,
depending
on whether or notthe
polygonface
is
visiblefrom
outsidethe
object.All
points are enteredin
a clockwisedirection.
The
pointsin
the
I
set,
i.e.,
those
that
are seenthrough
the
object,
but
notfrom
outsideit,
areautomatically
reversed and output
in
a counterclockwisedirection.
This
is
typical
ofhow
graphics
systemsdistinguish
between
the
"outside"
4.
Theoretical
andConceptual
Development
The
mathematicsthat
Sutherland
usesto
determine
the
three-dimensional
coordinates of a pointfrom
two
views areexamined
below.
As
the
author pointsout,
by
handling
the
general
perspectivecase,
the
simpler case of orthographicprojections
is
automatically
covered.The
strategiesthat
follow
alsotake
care of misalignmentbetween
views andtablet
axes,
since misalignment showsup
as a simple rotation whichis
automatically
included
in
the
general
perspective.Non-perpen
dicularity
oftablet
axesis
likewise
accountedfor.
Sutherland
determines
the
viewing
transformation
for
eachview,
given
each view'sexemplary
specification,
by
representing
the
transformation
as a matrix.Points
are representedin
homogeneous
coordinates;
that
is,
the
three-dimensional
coordinate
X,
Y,
Z
is
represented asthe
row vector[X,
Y,
Z,
1],
where
1
is
the
homogeneous
term,
or as a multiple ofthat
vector,
as
in
[wX,
wY,
wZ,w],
where wis
arbitrarily
chosen.A
pointin
homogeneous
terms
may
therefore
be
representedin
lower
casenotation as
[x,
y,
z,
w]
whereX
=x/w,
Y
=y/w,
andZ
= z/w.A
general
perspective projection canbe
represented
in
homogeneous
coordinates as a4
X
4
transformation
matrix,
T,
whereby:Ti
tTi
2Ti
3Ti
4T2
iT2
2T2
3T2
4T3
iTs
2T3
3T3
4T41
T42
T43
T44
(1)
and
[x,
y,
z,
w]
is
a pointin
"object
space",
[x',
y',
z',
w']
is
a pointin
"image
space",
and X' =x'/w',
Y' = y'/w' andZ'
= z'/w'
.
Sutherland
notesthat
a perspective projectionis
actually
aprojection
from
onethree-dimensional
space(here
termed
"object
space")
to
anotherthree-dimensional
space(or
"image
space"),
which computes
the
perspectivedepth
as well asthe
positions ofobjects on
the
screen.The
matrixitself
may
be
arbitrarily
scaled,
sincedivision
will removethe
effects of such scaling.To
go
from
three
to
two
dimensions,
we mustdrop
the
depth
coordinate Z' and
the
projectionbecomes:
Ti
1Ti
2Ti
3[X,
Y,
Z,
1]
X
T2
iT2
2T2
3T3
1T3
2Ts
3T4
1T42
T4
[x' ,
y'
,
w']
=w'[U,
V,
1]
J
2)
where
[x',
y',
w']
arehomogeneous
coordinatesin
two-dimensional
space,
andU
=x'/w'
and
V
= y'/w'.The
tablet
measurements wewill
get
from
each of ourtwo-dimensional
views areactually
expressed,
not asx',
y'and w'
but
asthe
ratiosU
andV
as seenabove.
We
have
noway
ofknowing
the
value ofw',
anddifferent
X,
Y
andZ
inputs
may
give usdifferent
w'values.
However,
since
exemplary
points willbe
usedto
scale eachtwo-dimensional
projection,
the
value of w'is
not needed.The
three
equations representedby
the
matrixexpression
TuX
+
T21Y
+T31Z
+T4
1 = w'UT12X
+T22Y
+
T32Z
+
T42
= w'VT13X
+T23Y
+T33Z
+T43
= w*(3)
By
substituting
the
value of w'found
in
the
third
equationand
grouping
terms
weget:
(Tn-
Tt3U)X
+
(T21-T23U)Y
+ (Tai-T3
3
U
)
Z
+
{
T4
1 -T4
3
U )
=0
(T12-TiaV)X
+
(T22-T23V)Y
+
(
T3
2 -T33V)Z
+
(T42-T4
aV
)
=0
(4)
If
weknow
the
location
of several pointsin
three
dimensions
(X,
Y,
Z)
andtheir
measured pointsin
the
view(U,
V),
then
there
aretwo
equations per pointin
the
twelve
unknowns
Ti
j
which would require sixdata
pointsfor
their
solution.
We
are nowready
to
find
the
value ofTj
j .If
we set wto
1
we can rewritethe
equationsin
(3)
as:TuX
+T21Y
+
T31Z
+
T4
1 -U
=0
T12X
+
T22
Y
+T32Z
+ T42-V
=0
Ti
3X+
T23 Y
+
T33Z
+
T43-1
=0
(5)
We
can alsoinclude
U
andV
in
the
last
equation of(5)
by
multiplying
by
U
andV,
respectively.Ti
3UX+
T23UY
+
T33UZ
+T43U
-
U
=0
Ti
3VX+
T23VY
+T33VZ
+
T43V
-
V
=0
(6)
Since
0-0=0,
we can combine equations(5)
and(6)
asfollows:
TuX
+
T21Y
+
T31Z
+
T41-U
-(T13UX+
T23UY
+
T33UZ
+
T43U
-U)
=0
T12X
+
T22Y
+
T32Z
+
T42-V
-(T13VX+
T23VY
+
T33VZ
+
T43V
-V)
=0
and
then
rewritethem
as:TuX
+
T21Y
+
T31Z
+
T41-T13UX
-T23UY
-T33UZ
-T43U
=0
T12X
+
T22Y
+
T32Z
+ T42-T13VX
-T23VY
-T33VZ
-T43V
=0
(8)
Equation
(8)
canthen
be
expressedin
matrixform,
using
the
subscripts a-f
for
eachexemplary
point as:Xa
Ya
Za
1
0
0
0
0
Xb
Yb
Zb
1
0
0
0
0
Xc
Yc
Zc
1
0
0
0
0
Xd
Yd
Zd
1
0
0
0
0
Xe
Ye
Ze
1
0
0
0
0
Xf
Yf
Zf
1
0
0
0
0
0
0
0
0
Xa
Ya
Za
0
0
0
0
Xb
Yb
Zb
0
0
0
0
Xc
Yc
Zc
0
0
0
0
Xd
Yd
Zd
0
0
0
0
Xe
Ye
Ze
0
0
0
0
Xf
Yf
Zf
-UaXa -UbXb -UcXc -UdXd -UeXe -Uf
Xf
-VaXa -VbXb -VcXc -VdXd -VeXe -VfXf
-UaYa -UbYb -UcYcUdYd
-UeYe -UfYf
-VaYa -VbYb -VcYc -VdYd -VeYe -VfYf
-UaZa -UbZb -UcZc -UdZd -UeZe -UfZf
-VaZa -VbZb -VcZc -VdZd -VeZe -VfZf
u, Ub Uc -Ud -Ue -uf -Va -Vb -Vc -vd -V, -VfTi
iT2
iT31
T41
T12
T2
2T3
2T42
Tl3
T2
3T3
3T4
3[0]
9)
Because
the
equations of(9)
arehomogeneous,
the
solutionsfor
Ti
j
will contain anarbitrary
scalefactor
if
any
suchsolutions exist.
To
solvefor
T,
wemay
chooseT4
3to
be
unity,
add
the
last
column ofthe
matrixto
both
sides ofthe
equation,
suggests
using
a mean-squaresfit
method,
where,
given:
AX
=B
(10)
where matrix
A
has
too
many
rowsfor
the
degrees
offreedom
in
X,
aleast
mean-squared errorfit
canbe
found
by
solving
AT
AX
= ATB
(11)
where AT
is
the
transpose
ofA
andATA
is
square andthe
rightdimension
to
suitX.
If
no solutionto
X
is
computable,
conditions
imposed
on equation(11)
are redundant and no solutionrepresents
the
least
error condition.To
solvefor
X
in
equation(11)
wemultiply
both
sidesby
the
inverse
ofATA:
(ATA)-i
(ATA)X
=(ATA)"MATB)
(12)
and can
then
solvefor
X
where:X
=(ATA)-MATB)
(13)
Finally,
once wehave
calculatedthe
tranf
ormationTi
j
using
the
formula
above,
and weknow
the
position ofthe
pointU,
V
we cantake
the
original equations of(4)
and,
substituting
the
terms
in
parentheses with computableconstants,
we canrewrite
them
as:aiX
+
biY
+
ciZ+
di
=0a2X +
b2
Y
+
c2Z+
d2
=0
(14)
where each equation represents a plane
in
three
space on whichthe
point mustlie,
and each pairdefines
aray
extending
from
the
camerathrough
the
point.Given
transformations
for
two
views and two-dimensional coordinates
U
andV
for
eachview,
wethen
suggests
using
aleast
squaresfit
to
solvefor
the
values
of
X,
Y
andZ.
We
canaccomplish
this
by
expressing
the
four
equations
in
matrixform:
au
1bu
1cu
iav
ibv
icv
ian
2bu
2cu
2av2
bv
2 Cv2[X,
Y,
Z]
du
idv
idu
2dv
2(15)
where
the
subscripts ul and vl representthe
constantsin
the
two
equationsin
the
first
view,
and u2 and v2 representthe
constants
in
the
second view.We
canthen
find
aleast-squares
5.
System
Implementation
Introduction
A
system,
calledIVAN,
wasdeveloped
similarto
Sutherland's,
but
using
photographs
for
input
instead
of orthographic
drawings.
Certain
refinements were alsoadded,
particularly
in
the
areas of user-interface andfeedback.
IVAN
allowstwo-dimensional
pointsfrom
up
to
four
views ofan object
to
be
enteredusing
adigitizing
tablet
andhand-held
stylus.
From
these
points,
the
system produces afile
of pointsand vertices
that
representthe
objectin
three-dimensions.
The
file
canin
turn
be
usedby
ageneral-purpose
graphics
packagefor
displaying
andmanipulating
the
three-dimensional
modelthat
has
been
created.The
useris
carefully
guided
through
the
entire process ofcreating
his
three-dimensional
model - eachstep
mustbe
completed
before
going
onto
the
next.The
usermay
also end asession at
any
time,
and work-in-progressmay
be
storedin
files
to
be
used atlater
sessions,
sothat
earlier steps need notbe
System
Overview
IVAN
allows
up
to
four
different
photographs
orortho
graphic
drawings
ofthe
three-dimensional
objectthat
is
to
be
modeled.
These
views arefirst
"grabbed"by
the
videodigitizing
component of
the
system,
whichcreates
a512
X
512
X
8
bit
representation
of each view.These
grayscale
images
arelater
displayed
on a videomonitor
to
provide userfeedback.
The
four
photographs
ordrawings
arethen
placed on anx-y
digitizing
tablet.
For
convenience,
one area ofthe
tablet
is
also set aside
for
amenu,
allowing
most commandsto
be
enteredwithout
putting
down
the
tablet
stylus.All
menu optionsthat
are
currently
available aredisplayed
before
each optionis
selected.
Once
the
views and menu are attachedto
the
tablet,
the
system requests
the
tablet
positions of each.At
least
six"exemplary"
points must
then
be
defined
for
each view.These
aretwo-dimensional
pointsthat
correspondto
known
three-dimensional
world coordinates.They
are called"exemplary"
because
they
are examples of whatthe
viewing
transformation
from
three
dimensions
to
two
dimensions
has
done
to
certainknown
points
in
each view.The
system usesthese
exemplary
pointsto
construct a
viewing
transformation,
represented as amatrix,
for
each view.
Points
may
then
be
selectedfrom
the
two-dimensional
views,
using
the
digitizing
stylus.Each
point onthe
object mustbe
Three-dimensional
points arethen
calculatedfrom
the
position
ofthe
pointin
each pair of viewsusing
the
transformation
matrices.
The
three-dimensional
pointsform
the
vertices ofthree-sided
facets
which createthe
"skin" ofthe
object model.Points
canbe
formed
into
facets
directly,
orthey
canbe
grouped
by
the
userinto
rows,
leaving
it
to
the
programto
convert each pair of rowsinto
the
triangular
facets.
While
selecting
the
two-dimensional
points,
one ofthe
grayscale
images
digitized
earliermay
alsobe
displayed.
Any
two-dimensional
pointthat
is
selectedfrom
the
viewcurrently
displayed
onthe
video monitoris
recorded and superimposedon
the
videoimage.
The
user can usethis
feedback
to
keep
track
of
his
progress.Once
facets
areformed,
the
pointsdisplayed
on
the
screen are replacedby
labels
that
canbe
usedto
directly
choose
three-dimensional
pointsfor
subsequentfacets,
thereby
bypassing
the
needto
convertthe
points againfrom
the
two-dimensional
views.The
final
output ofthe
systemis
alist
ofthree-dimen
sional points and a set of
triangular
facets
createdfrom
those
points.
These
canthen
be
writtento
afile
andin
turn
used asinput
to
a graphics systemthat
can,
using
hidden
line
removal,
Hardware
Requirements
IVAN
uses aScientific
Accessories
Inc.
GP-8
2-d
Sonic
Digitizer
for
digitizing
the
object views.The
GP-8
measures
the
transit
time
of a soundimpulse,
generated
by
astylus,
to
calculate
the
distance
from
the
"X" and"Y"
microphones.
The
microphones are mounted on an
L-frame
and positioned on adrafting
table,
andboth
the
microphones
and stylus are attachedto
acontrol unit.
The
digitizer
has
an active area of 60"by
72" andresolution of
0.01
inches.
The
control unit communicates withits
host
computer,
anIBM
AT,
via anRS232
serial cable.The
IBM
AT
has
640K
ofmemory
and aSony
12" video monitor.It
is
equipped with akeyboard
and mousefor
input
and anImaging
Technologies,
Inc.
imaging
board
for
grabbing
anddisplaying
the
grayscale
images.
A
Monochrome
vidicon camera with standardvideo
output,
equipped with a25mm
lens
and mounted on a verticalcopy
stand,
is
usedto
'grab'the
images,
and a secondSony
12"video monitor
is
usedfor
displaying
them.
An
illustration
ofthe
setup
canbe
seenin
Figure
5.1.
Software
Requirements
IVAN's
files
are writtenin
Microsoft
C,
and mustbe
compiled
using
the
large
memory
model andthe
/AL
/Ze
options.The
C
language
was chosen overFORTRAN
primarily
because
ofits
enhanced
data
structures.Microsoft
C
is
the
only
C
compilerthat
cancurrently
callthe
FORTRAN
Werner
Frei
IMAGETOOL
grabbing,
storing
anddisplaying
images,
andfor
writing
points
to
the
video screen.The
Microsoft
Mouse
Library
providesroutines
for
using
the
mouseto
locate
the
image
boundaries.
System
Input
Ivan
acceptsinput
from
both
the
keyboard
andthe
digitizing
tablet.
Digitizer
input
is
necessary
for
selecting
two-dimen
sional
points
from
the
various objectviews,
andfor
selecting
menu options.
Input
from
the
digitizer
is
requested withthe
prompt
"!>",
andis
enteredby
clicking
the
stylus on eitherthe
desired
two-dimensional
point or onthe
appropriate area ofthe
menu.
A
copy
ofthe
menuis
found
in
Figure
5.2.
Keyboard
input
is
requested withthe
prompt"->".
It
is
implied
that
any
keyboard
input,
exceptfor
<RETURN>
itself,
willbe
followed
by
a<
RETURN
>
.Incorrect
input,
from
eitherthe
tablet
orthe
keyboard,
results
in
an appropriate message and a"beep"
,
sparing
the
userthe
needto
constantly
keep
an eye onthe
screento
seeif
his
MENU
KEYBOARD
EXIT
VERTICES
CHANGE
OPEN
OBJECT
ADD
POINT
OPEN
ROW
VIEW
ADD
ROW
DISPLAY
1
2
SAVE
3
4
DELETE
ERASE
CANCEL
QUIT
Tablet
Menu
(3/1/89)
23
Initialization
To
startusing
the
system,
ivan
is
typed
atthe
keyboard.
The
system
begins
by initializing
the
data
structuresthat
areglobal
to
allfiles.
A
global
array
of records containsinfor
mation about each view -
its
boundary
values,
exemplary
points,
transformation
matrix,
andimage
boundaries.
The
array
is
accessed
by
the
view number.A
global
integer
array,
done,
holds
flags
that
indicate
which stepsthe
userhas
completed sothat
the
system can allowhim
to
move aheadto
the
next step.A
second
integer
array,
flags
,holds
the
flags
that
indicate
whichmenu options are
currently
available,
andis
accessedby
the
number
given
to
each menuoption,
assignedin
the
#define
file.
A
moredetailed
description
ofIVAN's
files
anddata
structurescan
be
found
in
the
Technical
Documentation
in
Appendix
B.
The
IMAGETOOL
routinesINITIM,
CLKSEL,
LUTSEL
,WRLUT
andSETSCR
arethen
calledto
select,
initialize
and enablethe
Data
Files
IVAN
next requestsinput
from
files
createdby
the
system
at a
previous
session.IVAN
creates
severaldifferent
types
offiles.
The
parameterdata
file
stores valuesfor
the
global
array
of viewrecords,
as well asother
information
which
indicates
which stepswere
completed at a previoussession
sothat
these
need notbe
repeated
for
the
current session.A
sample parameter
data
file
is
found
in
Figure
5.3,
with adescription
ofthe
format.
The
system outputfile
storesthe
three-dimensional
pointsand
facet
verticesthat
representthe
objectbeing
modeled.These
aregrouped
into
distinct
object sets.The
first
data
line
in
the
outputfile
containsthe
number of object setsthat
have
been
created.Then,
for
eachset,
the
file
contains a count ofthe
points andfacets
for
the
set,
alist
of allthe
three-dimen
sional points
that
have
been
created,
and alist
of allthe
facets
that
have
been
formed.
A
sample outputfile
is
found
in
Figure
5.4.
The
display
file
storesthe
pointlabels
that
have
been
written onto
the
grayscaleimages.
For
eachview,
the
file
holds
the
number of pointsfor
the
view,
andthen
a series oflines
that
containthe
x andy
coordinatesfor
the
pixel
location
of
the
label,
and anindex
into
the
objectlist
that
represents
the
three-dimensional pointfor
that
location.
This
file
is
usedto
re-display
all points created at a previoussession,
andthe
during
the
current session.Figure
5.5
shows a sampledisplay file,
with6
pointsfor
view1,
4
pointsfor
view2,
2
pointsfor
view3,
and nopoints
displayed
for
view4.
Note
that
for
view4
a zerois
stored
to
indicate
that
no points weredisplayed
for
that
view.IVAN
also createsfiles
for
testing
the
accuracy
ofexemp
lary
points,
which willbe
discussed
in
greater
detail
in
the
Testing
Exemplary
Point
Accuracy
section.Generally,
whenthe
systemis
instructed
to
savethe
current
data,
the
appropriatefile
name or namesis
requested,
and
the
appropriatedata
writtento
each.Values
not yetcreated
for
the
parameterfile
are written asO's.
Data
file
13.46 -3.37 14.28 -11.38 24.23 3.69 -3.36 -20.25 view
boundaries
13.55 -12.1014.48 -20.15 24.36 -12.01
5.08 0.79 6.05 0.00 -3.47
2.03 2.75 0.00 0.00 6.97 5.01 6.79 6.05 8.25 1.69 5.04 5.45 6.05 6.25 -1.28
2.81 5.71 1.88 6. 13 5.88 8.11 2.87 12.03 0.00 6.97 7. 13 5.96 9.91 6.30 5.78
0.00 0.00 0.00 0.00 0.00 view 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 exemplary points-0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1.57 3.52 0.00 0.00 6.97 5.52 6.40 6.05 8.25 1.69 5.57 7. 15 7.53 8.25 4.38 4.19 6.88 4.47 8.25 4.38 6.21 4.68 6.05 6.25 -1.28
view 2 -34 exemplary points-2.57 6.49 5.98 1.21 1.88 6.05 6. 13 0.00
6.49 4.66 12.03 0.00 6.97 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 2.29 1.71 6.05 0.00 -3.47
4.28 6.79 6.05 8.25 1.69 view 3
5.88 6.97 7.53 8.25 4.38 exemplary
points-4.67 7.22 4.47 8.25 4.38
3.12 5.32 6.05 6.25 -1.28
4.21 6.62 1.88 6. 13 5.88 8.37 2.77 12.03 0.00 6.97 7.43 5.91 9.91 6.30 5.78
0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 O.OO 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00
4.95 1.47 6.05 0.00 -3.47 2.00 5.64 0.00 0.00 6.97
4.94 1.18 6.05 8.25 1.69
5.76 2.42 7.53 8.25 4.38 vi ew 4
4.08 2.62 2.35 3.70 4.47 1.88 8.25 6. 13
4.38 exemplary
points-5.88
7.81 5.64 12.03 0.00 6.97
7.15 3.79 9.91 6.30 5. 78
0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00
transformation
matrix - view 1
-0.02 0.17 1.28 0.00 0.58 0.26 1.59 0.00 0.00 0.03 0.51 -0.02 -0.14 2.76 0.14 transformation
0.39 matrix - view2
0.34 1.53 0.00 -0.01 0.01 0.17 -0.05 0.38 1.95 -0.27 0.30 0.24 3.77 -0.02 -0.01 0.02 0.38 -0.12 -0.20 transformation 2-82 matrix - view 4 0.03 -0.24 0.23 2.33 0.00 -0.02 transformation matrix - view 3
-0.04
exemp pts 8
digitized? 1111 437 38 441 31 445 29 imEi3e bounds 445 34
view boundaries done? 1
current cmmand code 0
189
204
249
230
187
246
2^jo
266
242
185
300
218
4
228
238
287
234
228
284
295
264
328
208
269
237
0
0
1
4
5
0
1
If
the
userbegins
a session withIVAN
by
reading
in
aparameter
data
file
that
has
been
createdduring
a previoussession,
it
is
assumedthat
the
viewboundaries
andexemplary
points contained
in
the
file
stillapply;
that
is,
the
viewshave
not
been
moved.If
the
viewshave
been
re-positioned,
allsubsequent points selected will not
be
accurate.If
a complete parameterdata
file
has
been
usedto
begin
the
currentsession,
apreviously
created outputfile
may
alsobe
read.
Any
new points and vertices arethen
appendedto
those
readin
from
the
file,
and subsequent saves will storeboth
previousand new
data.
If
an outputfile
has
been
readin,
the
useris
given
the
option
to
amendthe
file
by deleting
facets
that
may
have
been
incorrectly
created.This
is
done
by
supplying
the
system withthe
three
verticesthat
comprise eachfacet
to
be
deleted.
The
vertices are represented
by
each point'slocation
in
the
objectGrabbing
the
Views
The
useris
nowinstructed,
step
by
step,
in
"grabbing"the
object views
to
producegrayscale
images.
The
videocamera,
mounted
to
astand,
shouldbe
turned
on andthe
lights
adjustedfor
properillumination
ofthe
views.The
systemfirst
requeststhat
a namebe
given
to
the
objectthat
is
to
be
created.This
is
limited
to
eight characters.The
system usesthe
object namefor
reading
andwriting
the
appropriate
image
for
the
current object andthe
correct view.If
no nameis
entered,
nodisplay
feedback
is
available.The
useris
askedto
arbitrarily
assign each view a numberfrom
1
to
4
.The
number servesto
identify
the
views andmust
be
usedconsistently
throughout,
sinceit
alsoidentifies
the
view's grayscaleimage,
boundary definitions,
exemplary
points , etc.
The
useris
then
promptedfor
a viewnumber,
representing
one of
the
four
viewsthat
the
user wouldlike
to
grab.The
usermay
grab
asmany
ofthe
four
views ashe
likes,
or none at all.If
the
viewshave
already
been
grabbed and stored at a previoussession,
orif
none aredesired,
<RETURN>
will movethe
user onto
the
nextstep
in
the
process.If
a view numberis
given,
the
IMAGETOOL
routineDIGITZ
is
calledto
begin
producing
continuousvideo output.
The
view correspondingto
the
number enteredis
then
placed underthe
camera,
and adjusted sothat
allfour
edges of
the
view are visible onthe
video monitor.31
monitor,
writtenby
the
IMAGETOOL
routine
DRVEC.
The
lines
crossat
the
lower
left
hand
corner ofthe
screen andserve
as aguide
for
proper alignment ofthe
photograph.
The
photograph
should
be
placed
carefully,
sothat
the
lower
left
corneris
aligned
withboth
the
horizontal
and verticallines,
since proper alignmentis
critical
for
accuratedisplay.
Taping
the
four
corners ofthe
photographs
to
aheavier
piece of cardboard makesit
easierto
manipulate
them
during
this
process.<RETURN>
grabs
the
image
onthe
screen with another callto
DIGITZ
in
singleframe
grab
mode.In
orderto
calculatethe
tablet-to-screen
coordinatesso
that
a point selected onthe
digitizer
canbe
displayed
onthe
monitor,
the
system needsthe
boundary
values ofthe
image.
The
lower
left
hand
corneris
known,
sincethe
userhas
alignedthe
photograph withthe
perpendicularlines
that
appear onthe
screen.
Using
callsto
the
cursor control routinesCMOUSEL
,CURTYP,
CURON,
andCURSET
in
the
Microsoft
Mouse
Library,
the
mouse
is
then
moved untilthe
cursoris
onthe
upper right cornerof
the
view and clickedto
locate
and storethe
upper rightcorner
boundary.
The
image
boundaries
arethen
storedin
the
parameter
file
along
withthe
viewboundaries
that
have
been
stored
for
each corresponding view.The
systemthen
storesthe
grayscale
image
in
afile
with acall
to
the
IMAGETOOL
routineWDISK.
The
name ofthe
file
is
automatically
createdby
the
systemfrom
the
object namegiven
earlier and
the
view number.For
example,
view1
of animage
the
sameimage
in
CART_2
, etc.The
systemthen
comes
back
to
request
another
viewnumber,
and
the
aboveprocedure
is
repeated
for
each ofthe
views
the
user would
like
to
grab
for
future
display.
When
all viewshave
been
grabbed,
a<RETURN>
lists
which ofthe
viewshave
been
grabbed.
The
systemthen
offers
anopportunity
to
savethe
image
boundaries.
If
the
name of afile
is
entered atthe
prompt,
the
boundaries
that
werelocated
for
each view are savedin
the
parameter
data
file
named.Although
helpful
for
userfeedback,
the
images
that
have
been
grabbed
are not adequatefor
usein
selecting
the
two-dimen
sional points needed
in
creating
objects.First
ofall,
the
range of visible
gray
tones
onthe
videoimage
is
severely
reduced,
making
the
locating
of pointsin
eithervery
light
orvery
dark
areasimpossible.
Discrimination
ofthese
pointsis
much
better
onthe
original photograph.Secondly,
the
spatialresolution of
the
videoimage
is
less
than
half
that
of a 9"X
12"
photograph
(0.010
inches/pixel
vs0.023
inches/pixel).
Finally,
since each point mustbe
selectedin
atleast
two
views,
and
possibly
more,
multiple views mustbe
visible atthe
sametime.
This
would requireup
to
four
separatemonitors,
sinceit
would
be
prohibitively slow andconfusing
to
movefrom
one viewimage
to
another on a single monitor.Given
these
factors,
the
original photographs are used
for
creating
three-dimensional
33
Preparing
the
Tablet
Once
the
grabbing
ofthe
video
images
in
complete,
the
four
image
views
areaffixed
to
the
tablet.
The
views
should
be
placed
toward
the
left
side
ofthe
tablet,
parallel
to
the
tablet
axes,
and
leaving
enough
digitizing
areato
the
right
for
the
menu.
Next,
the
menushould
be
attached
to
the
right ofthe
views,
but
within
the
range
ofthe
digitizer
microphones,
andkeeping
in
mind
that
the
photographs
and menucannot
overlap.
Figure
5.6
is
an
illustration
ofwhat
the
arrangement
should
look
like.
The
systemfirst
initializes
communication
withthe
digi
tizer
by
calling
the
externalMicrosoft
C
routinecom.
The
useris
then
askedto
selectthe
lower
left
andthen
the
upper right menuboundaries
withthe
digitizing
stylusto
define
the
position ofthe
menu.This
allowsthe
systemto
calculate
the
position ofthe
various menu options.Before
proceeding,
the
system checksto
be
surethat
the
menuis
properly
aligned.
If
not,
the
system prints an errormessage,
asksthat
the
menube
adjusted,
andthen
prompts againfor
the
position ofthe
menu's corners.This
processis
repeated untilthe
menuis
properly
aligned.Communication
withthe
digitizer
is
also accomplished withthe
routine.The
digitizer
sendsbytes
in
the
format
+XXXX+YYYY<LF>
. receivesdata
16
bits
ata
time.
The
low
orderbyte
containsthe
data
byte
received andthe
high
orderbyte
contains error statusbits.
Once
the
data
is
free
oferror,
IVAN
strips offthe
low
orderbits,
collectsthe
x andy
data
in
a characterarray
and convertsthem
to
floating
point values.Once
the
menuboundaries
have
been
accepted,
most ofthe
input
to
the
systemis
from
the
menuusing
the
digitizing
stylus.
At
each requestfor
input,
the
integer
array
flags
is
reset and
only
those
optionscurrently
available are set.The
available options are
then
displayed,
andonly
those
are acceptedas valid.
All
others resultin
the
message'Invalid
Selection.'always valid.
MENU
lists
all current options and whatthey
currently
do.
SAVE
permitsthe
userto
savethe
currentdata
in
afile.
DISPLAY
displays
viewboundaries,
exemplary
points,
object points and
facets,
etc.,
depending
on whatstep
the
useris
currently
engagedin.
QUIT
endsthe
entiresession,
giving
the
user afinal
opportunity
to
save alldata
before
terminating.
The
EXIT
commandis
also usedthroughout
the
program,
to
indicate
that
the
userhas
completedthe
current option and wouldlike
to
Defining
View
Boundaries
Before
the
points
in
the
two
dimensional
views canbe
selected,
boundary
valuesthat
define
arectangular
view areafor
each view must
be
defined.
The
systemfirst
printsthe
current
boundaries;
eitherthose
boundary
definitions
readfrom
the
file
of a
previous
session,
orO's
if
noboundaries
have
been
defined.
If
viewboundaries
have
been
readin,
the
systemgoes
onto
the
definition
ofexemplary
points.There
is
noopportunity
to
changethe
boundaries
oncethey
have
been
defined,
since allsubsequent points are
dependent
ontheir
values.If
noboundaries
have
been
read,
the
systembegins
the
process of
defining
viewboundaries
by
prompting
for
one ofthe
views numbered
1-4,
corresponding
to
the
numbers1
to
4
onthe
tablet
menu.After
selecting
a number withthe
tablet
stylus,
the
system requests
that
the
user selectfirst
the
lower
left
cornerand
then
the
upper right corner of each view.The
system willrepeat
the
requestfor
view numbers andthe
corresponding
viewboundaries
untilthe
menu optionEXIT
is
selected.Once
EXIT
is
chosen,
the
final
boundaries
aredisplayed.
The
useris
then
allowed one
final
chanceto
changethe
boundary
values.CHANGE
allows
the
userto
go
back
and re-definethe
boundaries,
EXIT
indicates
acceptance ofthe
values.Since,
as statedearlier,
all subsequent
data
points aredependent
onthe
values ofthe
view
boundaries,
it
is
important
that
these
boundaries
be
correct.
requests
the
name of afile
for
saving
the
boundaries
for
use ata
later
session.If
the
values are notsaved,
the
boundaries
must
be
redefined atthe
nextsession,
and all points mustbe
selected again.
Several
other menu options are also availableduring
the
process of
defining
viewboundaries.
They
areDISPLAY,
whichdisplays
the
current viewboundaries
for
the
viewgiven;
SAVE,
which saves
the
boundaries
in
afile
specifiedby
the
user;
MENU,
whichdisplays
alist
ofthe
menu optionsavailable;
andDefining
Exemplary
Points
The
next
step
is
the
definition
ofexemplary
points.
Exemplary
points
arethree-dimensional
points
represented
in
world
coordinates,
andtheir
corresponding
points
onthe
two-dimensional
views.At
least
sixexemplary
points
areneeded
for
eachview,
with amaximum
of15
points
for
eachallowed.
The
three
dimensional
component
of eachexemplary
point
must
be
measured
orotherwise
taken
from
the
object,
orfrom
the
scene
in
which
the
object appears.This
entailschoosing
anarbitrary
origin
and axesin
three-dimensional
space,
andthen
determining
the
three-dimensional
coordinates
of points on eitherthe
object orfeatures
in
the
scene.Although
atleast
sixexemplary
points are neededfor
eachview,
a pointin
real-world coordinate space canbe
sharedby
allthe
viewsin
whichit
appears.Choosing
3-d
coordinatesthat
appear
in
allfour
views requirethat
a minimum of six real-worldpoints
be
created.Regardless
ofthe
number of pointschosen,
they
must not allbe
coplanarin
allthree
dimensions.
The
process ofdefining
exemplary
pointsinvolves
severallevels
of menu commands.The
top
level
requeststhat
the
userchoose
to
either add ordelete
pointsfor
any
view.An
EXIT
atthis
level
endsexemplary
pointdevelopment,
andthe
systemattempts
to
calculatetransformation
matricesfrom
the
points
that
have
been
stored.Whether
or notpreviously
defined
exemplary
pointshave
been
delete
the
currentexemplary
pointsfor
any
ofthe
views.Choosing
the
ADD
POINT
option onthe
menu allowsthe
user
to
continue
adding
exemplary
points untilEXIT
is
chosen.The
system
begins
the
process ofcollecting
exemplary
points
by
asking
for
a pointin
worldcoordinates,
taken
from
the
objector
from
the
scenein
whichit
appears.Each
x,
y
and zvalue
is
enteredseparately,
one perline.
A
two-dimensional
pointthat
is
the
projection
ofthis
three-dimensional
point onany
ofthe
viewsis
then
requested.The
viewitself
need notbe
indicated
sincethe
systemdetermines
the
viewusing
the
boundary
definitions.
Once
selected,
the
coordinatesfor
the
2-d
pointare converted
to
be
relativeto
the
appropriate view'sboun
daries
andthe
new pointis
then
stored.After
the
pointis
chosen,
alist
is
displayed
of allthe
exemplary
pointsthus
far
chosen
for
that
view.At
least
six points aredisplayed;
if
fewer
than
six pointshave
been
chosen,
the
rest are shown asO's.
This
is
a reminderthat
six points arerequired,
and makesit
easy
to
seehow
many
more are necessary.After
the
first
two-dimensional
projection ofthe
currentpoint
is
<