Robot\Machine Vision

33
Robot\Machine Vision Cherevatsky Boris

description

Robot\Machine Vision. Cherevatsky Boris. Automatic understanding of images and videos by a computer (which could be plugged on the robot or standalone). Computing properties of the 3D world out of visual data. - PowerPoint PPT Presentation

Transcript of Robot\Machine Vision

Page 1: Robot\Machine Vision

Robot\Machine Vision

Cherevatsky Boris

Page 2: Robot\Machine Vision

What is a Computer vision ? Automatic understanding of images and videos by a computer (which could be plugged on the robot or standalone).

1.Computing properties of the 3D world out of visual data.

2. Algorithms and representations to allow a machine to recognize objects, people, scenes, and activities. (perception and interpretation)

Page 3: Robot\Machine Vision

Some applications:

Real-time stereo Structure from motion

NASA Mars Rover

Pollefeys et al.

Multi-view stereo forcommunity photo collections

Goesele et al.

Page 4: Robot\Machine Vision

Some applications:sky

water

Ferris wheel

amusement park

Cedar Point

12 E

tree

tree

tree

carouseldeck

people waiting in line

ride

ride

ride

umbrellas

pedestrians

maxair

bench

tree

Lake Erie

people sitting on ride

ObjectsActivitiesScenesLocationsText / writingFacesGesturesMotionsEmotions…

The Wicked Twister

Page 5: Robot\Machine Vision

3D Reconstruction:

Given many images of a certain scene we can use computer vision algorithms to reconstruct the 3D model.

Page 6: Robot\Machine Vision

Connection to other disciplines :

Mathematics

Algorithms

Image processing

Artificial intelligence

GraphicsMachine learning

Computer vision

Robotics

Page 7: Robot\Machine Vision

, : , , 0, 255I x y a b c d

I(176,201) = 164 I(194,203) has value 37

width 520j=1

500 height

i=1

Intensity : [0,255]

Image representation on Computer:

Page 8: Robot\Machine Vision

R G B

Color images, RGB color space :

Page 9: Robot\Machine Vision

Image formation – Pinhole Camera:

• Pinhole camera is a simple model to approximate imaging process, perspective projection.

If we treat pinhole as a point, only one ray from any given point can enter the camera.

Virtual image

pinhole

Image plane

Page 10: Robot\Machine Vision

• Far away objects appear smaller

Perspective Projection

Page 11: Robot\Machine Vision

Perspective Projection

Page 12: Robot\Machine Vision

Mathematical Equations

Page 13: Robot\Machine Vision
Page 14: Robot\Machine Vision
Page 15: Robot\Machine Vision

Perspective Projection & Calibration

3 1 3 3 3 4 4 4 4 1

3

3

3

1

4

4

4

3

:

p K Pers Hom p

Where

a point in pixel coordinates

intrinsic parameters matrix from image to pixel coordinates

perspective projection

Homogeneous trnsformation fromw

K

orld frametoCa

s

p

Hom

Per

mera frame

Page 16: Robot\Machine Vision

Intrinsic parameters: from idealized world coordinates to pixel values

xu f

z

yv f

z

Perspective projection

W. Freeman

Page 17: Robot\Machine Vision

Intrinsic parameters

xu

z

yv

z

But “pixels” are in some arbitrary spatial units

W. Freeman

Page 18: Robot\Machine Vision

Intrinsic parameters

xu

z

yv

z

Maybe pixels are not square

W. Freeman

Page 19: Robot\Machine Vision

Intrinsic parameters

0

0

xu u

z

yv v

z

We don’t know the origin of our camera pixel coordinates

W. Freeman

Page 20: Robot\Machine Vision

Intrinsic parameters

0

0

cot( )

sin( )

x yu u

z z

yv v

z

May be skew between camera pixel axes

v

u

v

u

vuvuu

vv

)cot()cos(

)sin(

W. Freeman

Page 21: Robot\Machine Vision

K Cp p

Intrinsic parameters, homogeneous coordinates

0

0

cot( )

sin( )

x yu u

z z

yv v

z

0

0

cot( )0

0 0sin( )

1 00 0 1 1

xuu

yv v

z

Using homogenous coordinates,we can write this as:

or:

In camera-based coords

In pixels

W. Freeman

Page 22: Robot\Machine Vision

Extrinsic parameters: translation and rotation of camera frame

tpRp CW

WCW

C Non-homogeneous

coordinates

Homogeneous coordinates

ptRp WC

WCW

C

1000|

|

W. Freeman

Page 23: Robot\Machine Vision

Combining extrinsic and intrinsic calibration parameters, in homogeneous coordinates

Forsyth&Ponce

ptRKp WCW

CW

pp CK

pMp W

Intrinsic

Extrinsic

ptRp WC

WCW

C

1000|

|

World coordinatesCamera coordinates

pixels

0 0 0 1

W. Freeman

Page 24: Robot\Machine Vision
Page 25: Robot\Machine Vision

25/33 עיבוד תמונות ואותות במחשב

Edge Detection - גילוי שפות

מפת שפות של התמונה

Page 26: Robot\Machine Vision

26/33 עיבוד תמונות ואותות במחשב

Edge Detection - גילוי שפות

. f(x,y) נתייחס לתמונה כאל פונקציה רציפה•הגרדיאנט של פונקציה זו:•

כיוון הגרדיאנט מציין את הכיוון שבו רמות האפור משתנות •באופן מכסימלי. גודל הגרדיאנט הוא ערך השיפוע

המכסימלי.22

yf

xf

f

yf

xf

f ,

xfyf

f arctan

Page 27: Robot\Machine Vision

27/33 עיבוד תמונות ואותות במחשב

הגרדיאנט - דוגמא

fxf

yf

Page 28: Robot\Machine Vision

28/33 עיבוד תמונות ואותות במחשב

הגרדיאנט – דוגמא – המשך

>> i = double(imread('cameraman.tif'));>> gradFilt = [-1 0 1 ; -2 0 2 ; -1 0 1]/2;>> grad_x = imfilter(i , gradFilt , 'same' , 'replicate');>> grad_y = imfilter(i , gradFilt' , 'same' , 'replicate');>> [x,y] = meshgrid([1:size(i,2)] , [1:size(i,1)]);>> figure; imshow(i , []); hold on; >> quiver(x , y , grad_x , grad_y , 3 , 'm' , 'LineWidth' , 1);

Page 29: Robot\Machine Vision

29/33 עיבוד תמונות ואותות במחשב

הגרדיאנט – דוגמא נוספתfrice.png

Page 30: Robot\Machine Vision

30/33 עיבוד תמונות ואותות במחשב

קירוב הגרדיאנט של התמונה

• -ו x על מנת לחשב את הגרדיאנט יש צורך לחשב נגזרת בכיווןy:

10-1

10-1

10-1

-1-1-1

000

111

10-1

20-2

10-1

-1-2-1

000

121

prewitt sobel

מסנן לחשוב

xנגזרת בכיוון

מסנן לחשוב

xנגזרת בכיוון

מסנן לחשוב

yנגזרת בכיוון

מסנן לחשוב

yנגזרת בכיוון

Page 31: Robot\Machine Vision

31/33 עיבוד תמונות ואותות במחשב

Edge Detection - גילוי שפות

f

Page 32: Robot\Machine Vision

32/33 עיבוד תמונות ואותות במחשב

?מהו ערך טוב לבחירת הסףT = 100 T = 70 T =40

T = 20 T = 10 T = 2

Page 33: Robot\Machine Vision

33/33 עיבוד תמונות ואותות במחשב

Canny גילוי שפות ע"י• :Canny :אלטרנטיבה

– E=edges(I,’canny’)

• :עקרונות בוחרים אך ורק נקודות –

שהן "מקסימום מקומי" בעוצמת הגרדיאנט

בוחרים גרדיאנטים חלשים –רק אם הם מחוברים לגרדיאנטים חזקים