영역처리vision.ssu.ac.kr/lecdata2016-2/grad_syste… · ppt file · web view · 2016-06-28제...

33
제 3 제 제제 제제 제제

Upload: vonhi

Post on 28-Apr-2018

220 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

제 3 장 영역 기반 처리

Page 2: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 2

영역 기반 처리

입력 화소와 그 주위 화소를 이용하여 출력 화소값을 결정

회선 (convolution) 기법을 널리 이용

영역 기반 처리 예 흐리게 하기 , 선명하게 하기 , 경계선 검출 , 잡음

제거

Page 3: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 3

회선

출력 픽셀 값 입력 픽셀과 그 주위 픽셀 값에 회선 마스크의 값을 곱하여 합한 값

Page 4: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 4

회선 수행 방법

좌측 상단의 픽셀부터 한 픽셀 씩 차례로 수행 먼저 우측 방향으로 진행 한 줄이 끝나면 아래 줄로 이동

Page 5: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

• Let’s replace each pixel with a weighted average of its neighborhood

• The weights are called the filter kernel• What are the weights for the average of a

3x3 neighborhood?

Moving average

111

111

111

“box filter”

Source: D. Lowe

Page 6: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

Defining convolution

lk

lkglnkmfnmgf,

],[],[],)[(

f

• Let f be the image and g be the kernel. The output of convolving f with g is denoted f * g.

Source: F. Durand

• MATLAB functions: conv2, filter2, imfilter

Convention: kernel is “flipped”

Page 7: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

Practice with linear filters

000010000

Original

?

Source: D. Lowe

Page 8: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

Practice with linear filters

000010000

Original Filtered (no change)

Source: D. Lowe

Page 9: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

Practice with linear filters

000100000

Original

?

Source: D. Lowe

Page 10: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

Practice with linear filters

000100000

Original Shifted leftBy 1 pixel

Source: D. Lowe

Page 11: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

Practice with linear filters

Original

?111111111

Source: D. Lowe

Page 12: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

Practice with linear filters

Original

111111111

Blur (with abox filter)

Source: D. Lowe

Page 13: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

Practice with linear filters

Original

111111111

000020000 - ?

(Note that filter sums to 1)

Source: D. Lowe

Page 14: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

Practice with linear filters

Original

111111111

000020000 -

Sharpening filter- Accentuates differences with local average

Source: D. Lowe

Page 15: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 15

영상 흐리게하기

입력 픽셀 값을 주위 픽셀 값들과의 평균 값으로 변환하는 다음과 같은 회선 마스크를 널리 사용

251

251

251

251

251

251

251

251

251

251

251

251

251

251

251

251

251

251

251

251

251

251

251

251

251

91

91

91

91

91

91

91

91

91

평균 마스크

Page 16: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 16

영상 흐리게 하기 예

입력영상 3X3 마스크 적용

5X5 마스크적용

Page 17: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

Smoothing with box filter revisited• What’s wrong with this picture?• What’s the solution?

Source: D. Forsyth

Page 18: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

Gaussian Kernel

• Constant factor at front makes volume sum to 1 (can be ignored when computing the filter values, as we should renormalize weights to sum to 1 in any case)

0.003 0.013 0.022 0.013 0.0030.013 0.059 0.097 0.059 0.0130.022 0.097 0.159 0.097 0.0220.013 0.059 0.097 0.059 0.0130.003 0.013 0.022 0.013 0.003

5 x 5, = 1

Source: C. Rasmussen

Page 19: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

Gaussian vs. box filtering

Page 20: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 20

영상의 선명화

선명한 영상 생성을 위한 회선 마스크

0 -1 0

-1 5 -1

0 -1 0

-1 -1 -1

-1 9 -1

-1 -1 -1

마스크 1 마스크 2

Page 21: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 21

선명화 적용 예

입력 영상 마스크 1 적용 마스크 2 적용

Page 22: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 22

선명화 적용 예

Page 23: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 23

경계선 검출

경계선 입력 영상에 대한 많은 정보 포함

물체를 식별하고 물체의 위치 , 모양 , 크기 등을 인지하는 데 큰 역할

영상의 밝기가 낮은 값에서 높은 값으로 또는 높은 값에서 낮은 값으로 변하는 지점에 존재

Page 24: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

Origin of edges

Edges are caused by a variety of factors:

depth discontinuity

surface color discontinuity

illumination discontinuity

surface normal discontinuity

Source: Steve Seitz

Page 25: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 25

미분 연산자

영상

명암도 변화

미분값 변화

Page 26: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 26

경계선 검출 회선 마스크

미분 연산을 회선 마스크로 표현 가능 수평 경계선과 수직 경계선을 개별적으로 검출

수평 경계선 수직 경계선

Prewitt

Roberts

Sobel

111000111

101101101

000010001

000010100

121000121

101202101

Page 27: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 27Sobel Prewitt Roberts

입력영상

경계선 검출 결과

Page 28: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 28

잡음 제거

잡음 가우시안 잡음

• 정규 분포를 갖는 잡음• 영상의 픽셀 값으로부터 불규칙적으로 벗어나지만

뚜렷하게 벗어나지 않는 잡음

임펄스 잡음• 영상의 픽셀 값과는 뚜렷하게 다른 픽셀 값에 의한 잡음

0, 255 와 같은 뚜렷하게 잘못된 밝기 값을 갖는 화소

Page 29: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 29

잡음 예

가우시안 잡음 임펄스 잡음

Page 30: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 30

잡음 제거

평균 마스크

가우시안 노이즈를 줄이는데 효과적

임펄스 노이즈에는 비효과적

영상의 대비를 약화시킴

Page 31: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 31

잡음 제거 적용 예

평균 마스크를 이용한 잡음 제거 결과

가우시안 잡음 제거 결과 임펄스 잡음 제거 결과

Page 32: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 32

잡음 제거

중간값 필터링 임펄스 잡음을 제거하기위한 효과적인 방법 경계선을 보존 또는 강화

15 16 17

13 255 18

16 20 22

입력 영상 필터 윈도우출력 영상 픽셀값의 정렬

1315161617182022255

Page 33: 영역처리vision.ssu.ac.kr/LecData2016-2/grad_syste… · PPT file · Web view · 2016-06-28제 3 장 영역 기반 처리 * * If we want to know the value of the filtered image

23年 5月 7日 33

잡음 제거 적용 예

중간값 필터링을 이용한 잡음 제거 결과

가우시안 잡음 제거 결과 임펄스 잡음 제거 결과