49
3D Shape Inference Computer Vision No.2-1

3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Embed Size (px)

Citation preview

Page 1: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

3D Shape Inference

Computer Vision

No.2-1

Page 2: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Pinhole Camera Model

x

y

z

the camera center

Principal axis

the image plane

Page 3: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Perspective Projection

the optical axis

the image plane

the camera centerz

Focal length

f

u

z

xfu

x

Page 4: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Orthographic Projection

the optical axis

the image plane

the camera center

xu

Page 5: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Weak Perspective Projection

the optical axis

the image plane

the camera center

0z

xfu

the reference plane

0z

Page 6: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Para Perspective Projection

the optical axis

the image plane

the camera center

0

00

0

z

xzz

xx

fu

the reference plane

),,( 000 zyx

Page 7: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Orthographic Projection

the optical axis

the image plane

the camera center

xu

Page 8: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Obtain a 3D Information form Line Drawing

Given – Line drawing(2D)

Find– 3D object that projects to given lines

Find– How do you think it’s a cube, not a

painted pancake?

Page 9: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Line Labeling Significance

– Provides 3D interpretation(within limits)– Illustrates successful(but incomplete)approach– Introduces constraints satisfaction

Pioneers– Roberts(1976)– Guzman(1969)– Huffman&Clows (1971)– Waltz (1972)

Page 10: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Outline

Types of lines types of vertices Junction Dictionary Labeling by constraint

propagation Discussion

Page 11: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Line Types

convex concave

occluding occluding

Page 12: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Labeling a Line Drawing

Easy to label lines for this solid→Now invert this in order to understand shape

Page 13: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Enumerating Possible Line Labeling without Constraints

•9 lines•4 labels each

→4 x 4 x 4 x 4 x 4 x 4 x 4 x 4 x 4= 250,000 possibilities

We want just one reality must reduce surplus possibilities

→Need constraints   (by 3D relationship)

Page 14: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Vertex TypesDivide junctions into categories

Need some constraints to reduce junction types

Page 15: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Restrictions

No shadows, no cracks Non-singular views At most three faces meet at vertex

Page 16: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Fewer Vertex Types

Page 17: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Vertex LabelingThree planes divide space into octants

Enumerate all possibilities   (Some full, some empty)

Trihedral vertex at intersection of 3 planes

Page 18: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Enumerating Possible Vertex Labeling(1)

0or8octants full--no vertex2,4,6 octants full

singular view7octants full

1FORK5octants full

2L,1ARROW

Page 19: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

3octants full– upper behind L

– right above L

– left above L

– straight above ARROW

– straight below FORK

Enumeration(2)

Page 20: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Enumeration(3)

1 octant--Seven viewing octants supply

Page 21: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Huffman&Clows Junction Dictionary

Any other

arrangements cannot

arise

Have reduced

configuration from

144 to 12

Page 22: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Constraints on Labeling

Without constraints-- 250,000possibilities Consider constraints→3 x 3 x 3 x 6 x 6 x 6 x 5 = 29,000possibilities

We can reduce more by coherency/consistency along line.

Page 23: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Labeling by Constraint Propagation

“Waltz filtering”

By coherence rule, line label constrains

neighbors

Propagate constraint through common vertex

Usually begin on boundary

May need to backtrack

Page 24: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Example of Labeling

Page 25: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Ambiguity

Line drawing can have multiple labelings

Page 26: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Necker Reversal(1)

Wire-frame cube– Human perception flips from one to the other– (After Necker 1832,Swiss naturalist)

Page 27: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Necker Reversal(2)

Page 28: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane
Page 29: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Impossible Objects

No consistent labeling But some do have a consistent labeling

– What’s wrong here?

Page 30: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Limitations of Line Labeling

Only qualitative;only gets topology Something wrong

Page 31: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Summary(1)

Preliminary 3D analysis of shape

1. Identify 3D constraint

2. Determine how constraint affects images

3. Develop algorithm to exploit constraint

--> General method for 3D vision

Tool:constraint propagation/satisfaction

Page 32: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Summary(2)

Problems

1. Significant ambiguity possible

2. Assumes perfect segmentation

3. Can be fooled without quantitative analysis

Page 33: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Gradient Space

Computer Vision

No. 2-2

Page 34: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Gradient Space and Line Labeling

Last time: line labeling by constraint propagation

Use gradient space to represent surface orientation

- -

+ +

Page 35: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Review of Line Labeling

Problem Given a line drawing, label all the lines with

one of 4 symbols + convex edge - concave edge←→ occluding edges

Approach Narrow down the number of possible labels

with a vertex catalog

+ ++

--- + +

Page 36: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Surface Normal

Normal of a plane

Rewrite

0 DCzByAx

0x 1x

Normal vector (A,B,C)

0),,(),,( 010101 zzyyxxCBA

)1,,(),,(C

B

C

ACBA )1,,( qp

Page 37: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Surface Gradient

Gradient of surface is

Gradient of plane

),( yxfz

),(),(),(y

z

x

z

y

f

x

fqp

C

Dy

C

Bx

C

Az

DCzByAx

0

),(),(),(C

B

C

A

y

z

x

zqp

Page 38: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Surface Gradient

C

Dx

C

Az

DCzAx

0

)0,(),(C

Aqp

q

p

p1

p3 p2y

Page 39: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Relationship of Normal to Gradient

(p,q)1

0p

q

xy

x

p1p4

p5 Normal Vector

p1

p3

p2

y q

p

Page 40: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Polyhedron in Gradient Space

GH

F

ED

C

B

I

A+

+++

+ + + +

++

+ +

+-

-x

y

A’

D’C’

B’

I’H’

G’

F’

E’

p

q

Top view of polyhedronA x-y plane∥

Same order as left

Page 41: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Vector on a Surface

Suppose vector on surface with gradient

Under orthography, vector in scene projects to

is surface normal vector, so

),,( zyx ),( qpG

),( yxE

)1,,( qp

zyxqp

zyxqp

),(),(

0),,()1,,(

zEG

Page 42: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Vector on Two Surfaces

Suppose vector on boundary between two surfaces

Surfaces have gradients and

If , then

),,( zyx

),( 111 qpG ),( 222 qpG

2S

1S

E

),( yxE

0)( 21

21

EGG

zEGEG

EGG 21

p

q

G1

G2

Page 43: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Ordering of Points Along Gradient Line Perpendicular to Connect Edge

B1

B3

B2S

T

A B1’

B2’

B3’

A

p

q

If connect edge ST convex, then points on gradient spacemaintain same order (left-right) as A and Bi in image

If ST concave, then order switches

Page 44: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

How does this gradient space stuff help us to label lines?

L is a “connect edge” (vector on two surface)Assume orthographyLine in gradient space connecting R1 and R2 must beperpendicular to line L

)1,,( 22 qp)1,,( 11 qp

2R1R

),( 22 qp

),( 11 qp

p

q

LL

Page 45: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Line Labeling using Gradient Space1. Assign arbitrary gradient (0,0) to A

2. Consider B lines 1,2 may be connect edges or may be occluding edges

3. Suppose line 1 a connect edge

4. Suppose line 2 a connect edge, then (line A’B’) (line 2) impossible. So line 2 occluding.

BA

C

1

2

34

5

B’

A’ p

q

A’

B’

p

q

Page 46: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Line Labeling using Gradient Space5. Suppose lines 3 and 4 are connect edges

6. and so forth can get multiple interpretations

B’

A’ p

q

A’

B’p

qC’

C

+- - +

-+

BA

C

1

2

34

5

Page 47: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Another Payoff: Detect Inconsistencies

R2

R1L2L1

L1 L2

),( 11 qp

),( 22 qp ),( 22 qp

Page 48: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

Summary

Can use gradient space to

– represent surface orientation

– detect inconsistent line labels

– constraint labeled line drawings

– establish line labels without the vertex catalog

Page 49: 3D Shape Inference Computer Vision No.2-1. Pinhole Camera Model the camera center Principal axis the image plane

References

M.B. Clowes, “On seeing things,” Artificial Intelligence, Vol.2, pp.79-116, 1971

D.A. Huffman, “Impossible objects as nonsense sentences,” Machine Intelligence, Vol.6, pp.295-323, 1971

A.K.Mackworth, “On reading sketch maps,” 5th IJCAI, pp.598-606, 1977