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

Microsoft PowerPoint - Lec18 [互換モード]

N/A
N/A
Protected

Academic year: 2021

シェア "Microsoft PowerPoint - Lec18 [互換モード]"

Copied!
6
0
0

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

全文

(1)

吉澤 信

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

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

第7回講義

水曜日1限

教室6218

情報デザイン専攻

-フィルタ処理・エッジ強調-特徴保存フィルタ

Shin Yoshizawa: [email protected]

今日の授業内容

1. 特徴保存フィルタの基礎. 2. 非線形拡散(エッジ保存)、Bilateral(エッジ保存)フィルタ、 Non-Local Means (パターン保存)フィルタ. 3. 演習:エッジ保存フィルタ. www.riken.jp/brict/Yoshizawa/Lectures/index.html www.riken.jp/brict/Yoshizawa/Lectures/Lec18.pdf 今日の演習は第2回のレポートで出すので、 みなさん頑張ってくださいねーp(^^)q

復習:拡散方程式の離散計算

) , , ( ) , , ( t y x I t t y x I  

)

,

(

)

,

(

)

,

(

1

i

j

I

i

j

I

i

j

I

n

n

n ) , ( 4 ) 1 , ( ) 1 , ( ) , 1 ( ) , 1 (x y I x y Ixy Ix y I xy I I          )) 1 , 1 ( ) 1 , 1 ( ) 1 , 1 ( ) 1 , 1 ( ( 5 . 0 ) , ( 6 ) 1 , ( ) 1 , ( ) , 1 ( ) , 1 (                        y x I y x I y x I y x I y x I y x I y x I y x I y x I I  時間は、前進1次差分近似:epsilonは微小時間. 4連結 8連結  空間は(Laplace作用素の)中心2次差分近似:

} ; ); ( ){ iteration ( tmp I I Filtering tmp for   Shin Yoshizawa: [email protected]

今日は特徴(エッジ・パターン)保存フィルタ

単純な平滑化 特徴保存平滑化

Shin Yoshizawa: [email protected]

 畳み込みと平滑化:  拡散方程式(偏微分方程式)と平滑化: 拡散方程式はフーリエ変換 を用いると(ある境界条件の場合に)形式解が導ける! . 0 ) ( ), ( , ), ( , , ) ( ) ( *      

f t gx tdt f g C x f x g x g f Normalized Convolution: . ) ( / ) ( ) (

f t gxtdt g xt dt . ) ( (b/a)2 ab e G  ). ( ) 0 , ( , 0 , ))), , ( ( grad ( div hxt x t hx f x h t h   拡散方程式のフーリエ解は基本解と初期値の畳み込み: Convolution Kernel: g

まず平滑化(Smoothing)とは何か?

Shin Yoshizawa: [email protected]

    y x y y y x y y x f G d t d t g f t h (4 )n ( ) t(| |) 1 ) , ( ) ( ) , ( /2 4 拡散の時間変化=Gaussianフィルタの標準偏差パラメータ変化  変分問題と平滑化:ディリクレエネルギーの最小化:  周波数領域での平滑化: . 0 ,       h t h t h

with appropriate boundary condition. Dirichletエネルギー最小化問題:

h2min. . ) , ( , , 0 ) , ( ) , 0 ( , 0 ), ( ) 0 , ( ,           t x u x t l u t u l x x h x u u t u

     l k k k ydy l k y h l b x l k t l k b t x u 0 1 2 2 2 . sin ) ( 2 , sin ) exp( ) , (    Fourier解:   t 高周波ほど急激に減少.

Gaussian フィルタ = Laplacian Smoothing =拡散・熱伝導方程式の 解=Dirichletエネルギーの最小化~高モードFourier係数の0への置き

換え=Low Pass Filter. Shin Yoshizawa: [email protected]

(2)

Shin Yoshizawa: [email protected]

標準偏差と時間変化

I

t

t

t

t

I

),

,

(

)

,

(

x

x

   

) ( ) ( ) , , (x g x y I y dy I 2 2 2 2 2 1 ) ( a r a r e g    拡散度合=時間経過= Gaussianフィルタの標準偏差

エッジ保存フィルタ:非線形拡散

 GradientのDivergenceはLaplacian:

 非線形(異方性)フィルタ(Nonlinear Diffusion): 拡散係数c を異方的に考える+エッジの大きさ(勾配強度)が大きい 方向には平滑化しない.

div

))

,

(

)

)

,

(

(

(

div

c

I

t

I

t

t

,t)

I(

x

x

x

:

div

(c

I)

cは拡散係数(普通は位置(u,v)や 輝度値I(u,v)に依存しない定数). 均一な拡散 適応的拡散 小:たくさん平滑化したい. 大:平滑化したくない (少ない平滑化). 小: Shin Yoshizawa: [email protected]

非線形拡散フィルタ2

 局所的に異方な拡散→全体で適応的拡散になる:

勾配:小: 大きく平滑化したい. 勾配:大: 平滑化したくない. 勾配:小: ©CG-ARTS協会

I

勾配:大: 勾配:小: Shin Yoshizawa: [email protected]

非線形拡散フィルタ3

 非線形拡散係数(関数)は例えば、

) σ x ( c(x) 2 2 2 exp   2 1 1 αx c(x)   や をよく使う.

))

,

(

)

)

,

(

(

(

div

c

I

t

I

t

t

,t)

I(

x

x

x

alphaの変化

Shin Yoshizawa: [email protected]

非線形拡散フィルタ3

 非線形(異方性)フィルタの離散化: 最も簡単な

前進差分の陽解法では…

2 1 1 I clm    

 

       1 1 1 1 1(, ) (, ) 1 l ( ( , ) (, )) l m m n n lm n n c I i l j m I i j C j i I j i I  ) , ( ) , (i l j m I i j I I      1  lm c もし 又は(輝度 値に依存しない)定数な ら普通の拡散方程式.

 

       1 1 1 1 l l m m lm c C

))

,

(

)

)

,

(

(

(

div

c

I

t

I

t

t

,t)

I(

x

x

x

Shin Yoshizawa: [email protected]

非線形拡散フィルタ4

Shin Yoshizawa: [email protected]

入力画像 非線形拡散alpha=0.1 非線形拡散alpha=0.005

(3)

非線形拡散フィルタ5

Shin Yoshizawa: [email protected]

       t t I t I c t t I )), , ( ) ) , ( ( div( ) , ( x x x 非線形拡散alpha=0.1 非線形拡散alpha=0.005

 Anisotropic (Nonlinear) Diffusion: P. Perona and J. Malik, IEEE PAMI, 1990.

)), , ( ) ) , ( ( ( ) , ( 2 t I t I g div t t I x x x    ), , ( ) , ( I t t t Ix x   2 2 2 2 2 1 ) ( a r a r e g    , ) ( |) (| ) ( new

   x y y y x g I d I

 Total Variation: L. Rudin, S. Osher, and E. Fatemi, Physica D, 1992.

    Inew x dx g Inew x I x dx Inew 2 | ) ( ) ( * | 2 1 |) ) ( (| min arg    ) ( * )) ( ) ( * ( )) ( ) ( ) ) ( ( div( x x x x x x            I g I I g I I new new new new

 Linear Diffusion (Gaussianフィルタ): Gabor 1960.

画像処理での平滑化

Shin Yoshizawa: [email protected]

Bilateralフィルタとは?

Input Bilateral Filter Gaussian Filter ) ( ) ) ( ) ( ( ) , (xyg IxIy gxy Z h , ) , ( / ) ( ) , ( ) ( new

xy y y xy y x Z I d Z d I

Spatial-Tonal Normalized Convolution: ) ( ) , (xygxy Z . ) ( 2 2 a r a r e g   Intensity (Tonal)

Kernel Spatial Kernel

エッジ特徴を保存する! Shin Yoshizawa: [email protected]

Edge Intensity Kernelは、エッジの 境界を跨いでの輝度値の平 滑化を抑制する. ) ) ( ) ( ( ) , (xy g I x I y Zh  Intensity Kernel ) ( ) ) ( ) ( ( ) , (xyg I xI y gxy Z h Spatial Kernel Intensity Kernel Spatial Kernelは、平 滑化の影響を局所化 する. 1 y xxy2 ) (x I ) (y2 I ) (y1 I ) , ( vu I v u, ) ( ) (xy1 I ) ( ) (xy2 I , ) , ( ) ( ) , ( ) ( new    y y x y y y x x d Z d I Z I () 2. 2 a r ar e g  

なぜエッジを保存するのか?

Shin Yoshizawa: [email protected]

 目的に応じて二つのパラメータを調節: sigmaはGaussianフィルタや 拡散方程式(微小時間×繰り返し回数)と同じ影響. hは保存したい エッジの大きさに依存.

Bilateralフィルタのパラメータ

Intensity parameter Spat ial par amet er ) ( ) ) ( ) ( ( ) , (xyg I xIy gxy Z h h / 

h

©S. Paris et al. ©ACM.

Shin Yoshizawa: [email protected]

Bilateral Gaussian

Input

Bilateralフィルタ

Shin Yoshizawa: [email protected]

©CG-ARTS協会

 数回適用が

良い結果:

hは平滑化したい部分 の輝度値の標準偏差 の0.5~2.0倍程度をよ く使う. ) ( ) ) ( ) ( ( ) , (xyg IxIy gxy Z h

(4)

Bilateralフィルタ2

Shin Yoshizawa: [email protected]

Bilateralフィルタ3

Shin Yoshizawa: [email protected]

Color Bleeding

Shin Yoshizawa: [email protected]

多次元(Color)のフィルタで、RGB各色チェンネル毎に異な るパラメータで処理すると、カラーが混ざってしまう. - RGB毎に同じパラメータでフィルタを適用する. - カラーの勾配を用いる=距離をカラー空間で測る. ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( y x y x y x y x B B G G R R I I      ) ( ) ( ) ( ) ( x x x x B G R I      入力画像 カラー 非線形拡散 RGBチェンネル毎 非線形拡散 RGBチャンネル毎 Bilateralフィルタ カラー Bilateralフィルタ ↓色が混ざって緑が出現. v u, ) (x I I(y2) ) , ( vu I ) (y1 I )) , ( (Distance ) , ( g X Y Z xyh Similarity Kernel X 1 Y 2 Y Similarity Kernelは、パターンの境界を 跨いでの輝度値の平滑を抑制する. 1 y 2 y 1 y x Pattern Pattern Pattern 1 Y X 2 Y x 1 y 2 y 3 y , ) , ( ) ( ) , ( ) ( new    y y x y y y x x d Z d I Z I . ) ( 2 2 a r ar e g   Non-Local (NL-) Meansフィルタ: A. Buades, B. Coll, and J.-M. Morel, 2004.

     l d I I g D(x,y) (t) (x t) (y t)2 t 相互相関(Gaussian Cross-Correlation) ), ) , ( ( )) , ( (Distance ) , ( 2 1 y x D g Y X g Zxyhh 重みは局所画像の相似度:Similarity Kernel

パターン保存フィルタ(NL-Means)

Shin Yoshizawa: [email protected]

相似度?: Bilateral vs. NL-Mean

) (x I ) (y2 I ) (y1 I ) , ( vu I v u, 1 y xxy2 ) ( ) (xy1 I ) ( ) (xy2 I Non-Local Meansフィルタ ), ( )) , ( ( ) , (xyg Dxy gxy Z h Bilateralフィルタ ), ) , ( ( ) , ( 2 1 y x y x g D Zh ) ( ) ( ) , (xy I x Iy D   D(x,y)

g (t)I(xt)I(yt)2dt

二つの画素の

輝度値間(距離)

テクスチャーの距離

) (x I ) (y2 I ) , ( vu I v u, t ) (y1 I

Shin Yoshizawa: [email protected]

E. Bennett and L.McMillan, 2005. Video Enhancement (3D Image): A. Buades et al. 2004~. S. Yoshizawa et al. 2006. 3D Mesh Smoothing: 2D Image Denoising: O. Schall et al. 2006. Time-Varying Range Images Filter:

ビデオや3次元形状(Mesh)への拡張

(5)

計測・観察によって得られるデータは通常ノイズを含む. 加算性白色ガウスノイズは自然界の雑音を良く近似する. 最小二乗的に最適なノイズ除去法はWiener Filter. 理想フィルタは原信号のパワースペクトルが必要… 複雑な計測・観察データでは実用上「平滑化法」.

復習:ノイズ

凹凸の曲面上表示 ©wikipedia 実測データにおける装置による雑音の例 Shin Yoshizawa: [email protected]

Signal-to-Noise Ratio (SN比)

Shin Yoshizawa: [email protected]

ノイズと元信号の比:

-

小さい=ノイズが多い.

-

大きい=ノイズが少ない.

©G. Baker, 2005. ) ) ) , max( ( 1 ( log 10 PSNR 1 2 10      N j j j j j I f I f N Peak-SNR (色々な定義あり): e.g.

n

f

g

I

 *

Statistical Analysis of Signal-to-Noise Ratio

)

(

)

(

x

noisy

I

smoothed

x

I

 Method Noise:入力から出力を引いた画像. 特徴が出て いれば使ったFilterがノイズのみでなく,入力画像の特徴 を消している.Signal-to-Noise Ratioの空間表現.

Shin Yoshizawa: [email protected]

Gaussian Median Yaroslavsky Bilateral NL-Means Input

Method Noise

様々なノイズ除去法の比較

Wiener Filters, Wavelet thresholds.

Gaussian, Anisotropic, Total Variations.

NL-Mean

NL-Mean Noisy Input Gaussian Anisotropic TV1 TV2 TV3

Fourier-Wiener

DCT-Wiener Wavelet Hard Wavelet Soft

Translation invariant Wavelet hard Noisy Input

Shin Yoshizawa: [email protected]

©A. Buades et al. 2004.

Method Noise:

I

(

x

)

I

new

(

x

)

NL-Mean Original Gaussian Anisotropic TV1 TV2 TV3

Neighborhood Wavelet Soft Wavelet Hard Wiener DCT-Shin Yoshizawa: [email protected]

様々なノイズ除去法の比較2

©A. Buades et al. 2004.

Shin Yoshizawa: [email protected]

演習: エッジ保存フィルタ

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

www.riken.jp/brict/Yoshizawa/Lectures/Ex12.zip

↑はReport06の内容です。

前回・前々回(Lec16.pdf, Lec17.pdf)の演

習が出来ていない人はそちらを先にやりま

しょう!

演習18-1: 非線形拡散方程式によるエッジ保存フィ ルタの作成. 演習18-2: Bilateralフィルタの作成.

(6)

演習18-1

Shin Yoshizawa: [email protected]

非線形拡散方程式によるエッジ保存平滑化フィルタの作 成: Ex12.zip内のNonlinearDiffusionColor.cxxの中にあるコ メントに従ってフィルタを作成しましょう. 微小時間epsilon=0.25、エッジの重みalphaは0.1と0.01で繰 り返し10,50,100で実行してみましょう(6種類). 2 1 1 c I     非線形拡散alpha=0.1, 100回 非線形拡散alpha=0.01, 100回

演習18-2

Shin Yoshizawa: [email protected]

Bilateralフィルタの作成: Ex12.zip内ColorBilateralFilter.cxx の中にあるコメントに従ってフィルタを作成しましょう. Spatial Kernelの標準偏差sigma=10.0、25.0、Intensity Kernelの標準偏差h=1.0×(画像全体のグレースケールの 標準偏差)を0.1、0.2、0.5と、畳み込み半径10で実行してみ ましょう(6種類). sigma=10.0 h=0.15 sigma=10.0 h=0.5

Shin Yoshizawa: [email protected]

来週の予定

参照

関連したドキュメント

The Development and the Using of Web Site for Supporting the Students to Assist in the Classes 加藤 隆弘 松能 誠仁 松原 道男.. Takahiro KATO Nobuhito MATSUNO

東京大学 大学院情報理工学系研究科 数理情報学専攻. [email protected]

情報理工学研究科 情報・通信工学専攻. 2012/7/12

Instagram 等 Flickr 以外にも多くの画像共有サイトがあるにも 関わらず, Flickr を利用する研究が多いことには, 大きく分けて 2

理工学部・情報理工学部・生命科学部・薬学部 AO 英語基準入学試験【4 月入学】 国際関係学部・グローバル教養学部・情報理工学部 AO

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

関谷 直也 東京大学大学院情報学環総合防災情報研究センター准教授 小宮山 庄一 危機管理室⻑. 岩田 直子

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