• 検索結果がありません。

第8回講義 水曜日1限

N/A
N/A
Protected

Academic year: 2021

シェア "第8回講義 水曜日1限"

Copied!
4
0
0

読み込み中.... (全文を見る)

全文

(1)

1

吉澤 信

[email protected], 非常勤講師 大妻女子大学 社会情報学部

画像情報処理論及び演習II

第8回講義 水曜日1限

教室6218

情報デザイン専攻

-フィルタ処理・エッジ強調-

セパレート実装、方向フィルタ、形態作用素

Shin Yoshizawa: [email protected]

今日の授業内容

1.

線形フィルタのセパレート実装、 Guassian ピラミッド .

2.

方向フィルタ、Log-Gaborフィルタと方向ピラミッド.

3.

形態作用素 .

4.

演習: Report05.

www.riken.jp/brict/Yoshizawa/Lectures/index.html www.riken.jp/brict/Yoshizawa/Lectures/Lec21.pdf

 

 

y

y x

x

h

h m

h h n

n m h n j m i f j

i

I ( , ) ( , ) ( , )

セパレート実装

Shin Yoshizawa: [email protected]

1次元フィルタを次元(方向)別にn回適用してn次元 線形畳み込みを効率よく適用する実装方法.

- 線形フィルタ(畳み込み和):

I 出力画像 f 入力画像 h カーネル画像:フィルタ

 

 



 

  

y

y

x

x

h h m

h h n

x

y

m f i m j n h n

h j

i

I ( , ) ( ) ( , ) ( )

もしも分離可能なら↓ h ( m , n )  h

y

( m ) h

x

( n )

セパレート実装2

Shin Yoshizawa: [email protected]

例えば、2次元のアルゴリズムはx方向のフィルタ 結果へy方向のフィルタを適用する.

 

 

 

  

y

y

x

x h

h m

h h n

x

y

m f i m j n h n

h j i

I ( , ) ( ) ( , ) ( )

1 2hx

1 2hy

x

x h

h

n f i j nhxn

j i

tmp(, ) (, ) ( )

y

y h

h

m f i m jhym

j i

I(, ) ( , ) ( )

);

, ( ) ( ) , ( ) ( ) ( ) (

n j i f n h j i tmp

n for

j for

i for

(,) ( ) ( ,);

) ( ) ( ) (

j m i tmp m h j i I

m for

i for

j for

X

方向のフィルタ

Y方向のフィルタ

セパレート実装3

Shin Yoshizawa: [email protected]

計算量は画像の縦横をsy,sxとすると、

例1:ソーベル作用素は、9/6=1.5倍:

hx, hyが大きいほど効率的→Gaussianフィルタ.

) ) 1 (

2 ( ) ) 1 2 )(

1 2

(( h

x

h

y

s

x

s

y

O h

x

h

y

s

x

s

y

O     

 











1 2 1

* 1 0 1 1 0 1

2 0 2

1 0

1 *

1 2 1

1 0 1 1 2 1

0 0 0

1 2 1













  

6 ) 1 (

2 , 9 ) 1 2 )(

1 2 (

1       

y x y x y

x

h h h h h

h

1 ) 1 2 )(

1 2 2(

y x

y x

h h

h

h

hxhyh2h21

倍 速度

セパレート実装4

Shin Yoshizawa: [email protected]

例2:Gaussianフィルタ:

2 1 2 h

倍なので、もし半径h=100なら約100倍速い!



f x u y vg uvdudv y

x

I( , ) ( , ) (, )

- 分離:

) ( ) (

2 )) 2 exp(

))( 1 exp( 2 2 ( 1

2 ) 2 exp(

) 1 , (

2 2 2

2 2

2 2 2

y g x g

y x

y y x

x g

 

 



 

高次元のGaussianは 低次元Gaussianの積.

 

 

 

  

y

y

x

x h

h m

h h n

n g n j m i f m g j

i

I ( , )

( ) ( , )

( )

) ( ) ( ) ,

( m n h m h n

h

y x

が重要.

Ex13.zip内のSeparableGaussian.cxxに実際の実装があります.

(2)

2

Shin Yoshizawa: [email protected]

Gaussianピラミッド

. , )]

(

*

[ g

1

G k g

0

f

g

k

k

例3:Gaussianピラミッド作成時のExpandとReduce 操作.

5-tap filer:

 1 4 6 4 1 

16 1

Shin Yoshizawa: [email protected]

方向微分

通常の座標軸に沿った方向の微分(微小変化率)で はなく、任意の方向(ベクトル)に沿った微分.

勾配と方向微分したいベクトルとの内積.

例えば、LoGや DoGを与えられた 方向に適用しても OK!

t t

x   

f ( ) f

Shin Yoshizawa: [email protected]

方向(Orientation) フィルタ

方向特徴フィルタ (log Gabor).

)) cos(

) )(sin(

( )

exp(i G  i 

G x t

Imaginary

Real

4方向の例

2 / 1 2 imaginary 2

real )

(ff

角度:

0 45 90 135

Quadrature Filter Set Kternels:

Real and Imaginary

Kernel画像

畳み込み結果

畳み込み結果 Kernel画像

強度

方向特徴フィルタ(log Gabor)によるOrientation Pyramid.

Shin Yoshizawa: [email protected]

Steerable Pyramid

+

Shin Yoshizawa: [email protected]

Steerable Pyramid

©www.filiprooms.be

Flat Structuring Element (SE)と呼ばれる二値化画像 (Binary Image: b)の内側の輝度値の最小値・最大値等で、

評価画素の輝度値を置き換える.

Shin Yoshizawa: [email protected]

形態作用素(Morphological Operator)

-

Erosion(収縮):

-

Dilation(膨張):

-

Opening( 穴あけ ):

-

Closing( 穴埋め ):

©Steven W. Smith

 Structuring Element はグレー

スケール画像でもよいが本講

義では取り扱わない .

(3)

3

Flat Structuring Element (SE)と呼ばれる二値化画像 (Binary Image: b)の内側の輝度値の最小値・最大値等で、

評価画素の輝度値を置き換える.

Shin Yoshizawa: [email protected]

形態作用素(Morphological Operator)2

) , ( i j

入力画像 -

Erosion(収縮):

-

Dilation(膨張):

-

Opening(穴あけ):

-

Closing( 穴埋め ):

-

Top Hat:

-

Bottom Hat:

Structuring Element

)}

( { min ) ](

[ x x t

t

b f

f b

)}

( { max ) ](

[ x x t

t

b f

f b

] ] [[

)

(fbfbb ] ] [[

)

(fbfbb ) ( )

hat(f f f b

T   

f b f f

Bhat( )(  ) ©wikipwdia

SEは円をよく使う.

Ex13.zip内の MorphologicalOpe rators.hに実装が あります.

Shin Yoshizawa: [email protected]

Erosion

)}

( { min ) ](

[ x x t

t

b

f

f

b

Erosion(収縮): 白い部分がSE分だけ収縮する.

Minフィルタと同じ.

Structured Elementは円でその半径rが

1

r r2 r3 r4 r5 r10

Shin Yoshizawa: [email protected]

Dilation

Dilation( 膨張 ): 白い部分が SE 分だけ膨張する . Maxフィルタと同じ.

Structured Elementは円でその半径rが

1

r r2 r3 r4 r5 r10

)}

( { max ) ](

[ x x t

t

b

f

f

b

Shin Yoshizawa: [email protected]

Opening

Opening( 穴あけ ): 白に黒い穴が SE 分だけあく . Erosion後にDilation.

Structured Elementは円でその半径rが

4

r r8 r16 r20 r32

] ] [[

)

( fbfbb

1

r r2 r3 r4 r5 r10

Shin Yoshizawa: [email protected]

Closing

Closing(穴埋め):白に黒い穴がSE分だけ埋まる.

Dilation 後に Erosion.

Structured Elementは円でその半径rが

4

r r8 r16 r20 r32

1

r r2 r3 r4 r5 r10

] ] [[

)

( fbfbb

Shin Yoshizawa: [email protected]

Top Hat TopHat: 穴あけで消えた部分を強調:

入力から Opening を引く .

Structured Elementは円でその半径rが

3

r r4 r5 r10 r20 r30

) ( )

hat

( f f f b

T   

(4)

4

Shin Yoshizawa: [email protected]

Top Hat2 Shading Correctionに非常によい.

入力画像 大津の二値化

TopHat

画像 大津の二値化

5 r

20 r

Shin Yoshizawa: [email protected]

Bottom Hat BottomHat: 穴埋めで消えた部分を強調.

Closingから入力を引く.

Structured Elementは円でその半径rが

3

r r4 r5 r10 r20 r30

f b f f

B

hat

( )  (  ) 

Shin Yoshizawa: [email protected]

Bottom Hat2 Shading Correction に非常によい .

入力画像 大津の二値化

BottomHat

画像 大津の二値化

5 r

20 r

Shin Yoshizawa: [email protected]

Morphologicalフィルタ

©wikipwdia

©inf.ed.ac.uk

Shin Yoshizawa: [email protected]

演習: 形態フィルタ

www.riken.jp/brict/Yoshizawa/Lectures/index.html www.riken.jp/brict/Yoshizawa/Lectures/Lec21.pdf www.riken.jp/brict/Yoshizawa/Lectures/Ex13.zip

前回までの内容=Report05の内容が出来 ていない人はそちらを先にやりましょう!

 makeでコンパイル後にプログラムを各.cxxを見て実 行してみましょう!

- Gaussianフィルタのセパレート実装.

- 形態作用素.

Shin Yoshizawa: [email protected]

来週の予定

参照

関連したドキュメント

乗次 章子 非常勤講師 社会学部 春学期 English Communication A11 乗次 章子 非常勤講師 社会学部 春学期 English Communication A23 乗次 章子

そして会場は世界的にも有名な「東京国際フォーラ

エドワーズ コナー 英語常勤講師(I.E.F.L.) 工学部 秋学期 英語コミュニケーションIB19 エドワーズ コナー

日 時:5 月 30 日(水) 15:30~16:55 場 所:福岡女学院大学ギール記念講堂

社会学文献講読・文献研究(英) A・B 社会心理学文献講義/研究(英) A・B 文化人類学・民俗学文献講義/研究(英)

乗次 章子 非常勤講師 社会学部 春学期 English Communication A 11 乗次 章子 非常勤講師 社会学部 春学期 English Communication A 18 乗次 章子