image processing and computer vision

Post on 12-Jan-2016

49 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Image Processing and Computer Vision. Edge Detection & Generalized Hough Transform. Edge Detection. Contour edge. Edge มี 2 ชนิด Contour edge Texture edge. Texture edge. Edge Detection. - PowerPoint PPT Presentation

TRANSCRIPT

1

Image Processing and Computer Vision

Edge Detection &

Generalized Hough Transform

2

Edge Detection

Contour edge

Texture edge

Edge มี� 2 ชนิ�ด

-Contour edge-Texture edge

3

Edge Detection การหาค่ า Edge ในิภาพค่�อการหา pixel ที่��อยู่� ติ�ดก�นิ

ที่��มี�การเปลี่��ยู่นิแปลี่งค่ า intensity มีาก ๆ เช นิ จาก 0-255 หร�อจาก 255-0

4

Edge Filter (Robert Operator)

5

Example (Robert operator)Gray scale Image Gx

Gy G

245 230 233 244 254 255 243

250 250 251 254 245 243 244

245 234 4 6 7 230 247

245 244 4 5 6 240 241

255 255 245 239 238 243 255

241 242 234 252 241 253 252

6

Edge Filter (Prewitt Operator)

7

Edge Filter (Sobel Operator)

8

Edge Filter (Canny Operator)

d. Canny operator

I[i,j] = image

Convolution image by Gaussian Filter we will get

S[i,j] = G[i,j; ] * I[i,j]

= spread of gaussian (การกระจายู่ค่ าของ gaussian filter)

ทำ��ก�รสร��ง filter จ�กส�ตร

P[i,j] = (S[i,j+1] – S[i,j] + S[i+1,j+1] – S[i+1,j]) / 2

Q[i,j] = (S[i,j] – S[i+1,j] + S[i,j+1] – S[i+1,j+1]) /2

9

Edge Filter (Canny Operator)

-Edge pixel

M[i,j] = P[i,j]2 + Q[i,j]2

- Each in edge pixel

[i,j] = arctan(Q[i,j], P[i,j])

10

Sample Image

-1 0

0 1

Gx

0 -1

1 0

Gy

11

Generalized Hough Transform

ใช"สำ$าหร�บหาร�ปร าง ๆ ใด ภายู่ในิภาพเป&าหมีายู่ (Target Image)

ซึ่(�งประกอบด"วยู่ 2 สำ วนิใหญ่ ๆ ค่�อ1 .ที่$าการเก+บรายู่ลี่ะเอ�ยู่ดติ าง ๆ ของ

Template shapeไว"ก อนิ2. ที่$าการค่"นิหาร�ปร าง (shape) ภายู่ในิภาพ

เป&าหมีายู่(Target image)

12

Learn Shape ที่$าการสำร"าง Shape สำ$าหร�บเป-นิ Template ข(.นิมีาก อนิ

1 .ทำ��ก�รเลื�อกจ�ดก��งกลื�งของภ�พต�นแบบ 2. ส��หร�บ pixel ทำ��เป็�น edge ให�ลื�ก

เส�นตรงเข��ห�จ�ดก��งกลื�ง แลืะทำ��ก�รเก"บค่$�ต$�ง ๆ ด�งน�& = มุ�มุทำ��กระทำ��ก�บแกน X

= ค่$� gradient ทำ��ได�จ�กก�รทำ�� edge detectorr = ระยะทำ�งจ�กเส�นขอบทำ��ลื�กไป็ย�ง จ�ดก��งกลื�ง

13

GHT : R-Table

สำร"าง R-Table ข(.นิมีา เพ��อเก+บค่ าช วงของ

14

Search for Shapes

Target Image

15

Search for Shape Algorithm สำ$าหร�บ search ในิภาพเป&าหมีายู่(Target) 1. ทำ��ก�รห�ขอบ ของร�ป็ภ�พเป็*�หมุ�ย แลืะทำ��ก�รเก"บค่$�

(gradient direction) ไว้�

2. ส��หร�บทำ�ก ๆ edge pixel ใช้�ค่$� ทำ��ได�จ�กข�อ 1 เพ��อทำ��ก�รค่�นห�ค่$�

แลืะ r ซึ่��งเก"บอย�$ใน R-Table3. ส��หร�บค่$�ของ แลืะ r ทำ��ได�จ�กก�รค่�นห�ใน R-Table ต�มุ น�&น

ให�ทำ��ก�ร แทำนค่$�ของ แลืะ r ในส�ตร

xc = x + rcos()yc = y + rsin()

4. ทำ��ก�ร Vote xc แลืะ yc จ�กน�&นทำ��ก�รเลื�อกค่$� Maximum vote

ของ xc แลืะ yc มุ�เป็�นค่��ตอบก"จะได�จ�ดก��งกลื�งทำ��จะทำ��ก�รว้�งภ�พ template

ลืงไป็ในภ�พ target

16

Search for Shapes

17

Case when Image Scale or Rotate

Scale factor = SRotation factor =

ทำ��ก�รสร��ง Array ขน�ด 4 มุ.ต. ข�&นมุ�เพ��อทำ��ก�ร Vote ด�งน�& Array[xc, yc, S, ]

ซึ่��งค่$� S อ�จเป็�นได�ด�งน�& 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5

ส$ว้นค่$� R ให�มุ�ค่$�ต�&งแต$ 0-359

18

Case when Image Scale or Rotate

ด�งนิ�.นิเมี��อมี�ค่ า Scale แลี่ะ Rotation เข"ามีาเป-นิติ�วแปรด"วยู่จะติ"องการเปลี่��ยู่นิสำมีการเก าเป-นิสำมีการใหมี ด�งนิ�.

xc = x + rcos() yc = y + rsin()

xc = x + r S cos(+ ) yc = y + r S sin( + )

19

Case when Image Scale or Rotate

Algorithm1. For each (, r) from R-Table

For each S = 0.3 to 1.5 For each = 0 to 359 find

Array[xc, yc, S, ]++

Look for Maximum vote in 4-D Array

xc = x + r S cos(+ ) yc = y + r S sin( + )

20

Example

21

Example

22

Example

23

24

Example

top related