「mrcImageBilateralFilter」の版間の差分
(→アルゴリズム) |
(→実行例) |
||
(3人の利用者による、間の45版が非表示) | |||
行7: | 行7: | ||
<math> | <math> | ||
− | f_i = | + | f_i=\frac{\sum W(i, j) \cdot I_j}{\sum W(i, j)}, where W(i, j)=W_x(x_i, x_j)*W_l(I_i, I_j) |
+ | </math> | ||
+ | ------- linfo.mode : 0 | ||
+ | <math> | ||
+ | W_x(x_i,x_j) = e^{ -\frac{|x_i-x_j|^2} {2 \sigma_{Space}^2} }, | ||
+ | W_I(I_i,I_j) = e^{ -\frac{|I_i-I_j|^2} { 2 \sigma_{Density}^2} } | ||
+ | </math> | ||
+ | ------- linfo.mode : 1 | ||
+ | <math> | ||
+ | W_x(xi,xj) = \frac{1}{1+\frac{|xi-xj|^2}{\sigma_{Space}^2} } | ||
+ | W_I(Ii,Ij) = \frac{1}{1+\frac{|Ii-Ij|^2}{\sigma_{Density}^2} } | ||
</math> | </math> | ||
行33: | 行43: | ||
<td>-i</td> | <td>-i</td> | ||
<td>必須</td> | <td>必須</td> | ||
− | <td> | + | <td>入力ファイル:[[mrcImage]]</td> |
<td>NULL</td> | <td>NULL</td> | ||
</tr> | </tr> | ||
行39: | 行49: | ||
<td>-o</td> | <td>-o</td> | ||
<td>選択</td> | <td>選択</td> | ||
− | <td> | + | <td>出力ファイル:[[mrcImage]]</td> |
<td>stdout(設定しなければ標準出力)</td> | <td>stdout(設定しなければ標準出力)</td> | ||
</tr> | </tr> | ||
行45: | 行55: | ||
<td>-sD</td> | <td>-sD</td> | ||
<td>選択</td> | <td>選択</td> | ||
− | <td>SigmaDensity(float) [ImageAmplitude]</td> | + | <td>SigmaDensity(float) [ImageAmplitude] : <math>\sigma_{Density}</math></td> |
<td>2.0</td> | <td>2.0</td> | ||
</tr> | </tr> | ||
行53: | 行63: | ||
<td>Kernel Type of Density (int) </td> | <td>Kernel Type of Density (int) </td> | ||
<td>0</td> | <td>0</td> | ||
− | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
行64: | 行73: | ||
<td>-sS3</td> | <td>-sS3</td> | ||
<td>選択</td> | <td>選択</td> | ||
− | <td>SigmaSpace 3D (x:float, y:float, z:float) [pixel]</td> | + | <td>SigmaSpace 3D (x:float, y:float, z:float) [pixel]: <math>\sigma_{Space}</math></td> |
<td>1.0 1.0 1.0 </td> | <td>1.0 1.0 1.0 </td> | ||
</tr> | </tr> | ||
行72: | 行81: | ||
<td>Kernel Type of Space (int) </td> | <td>Kernel Type of Space (int) </td> | ||
<td>0</td> | <td>0</td> | ||
− | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
行85: | 行93: | ||
<td>Kernel Size 3D (x:int, y:int, z:int) [pixel]</td> | <td>Kernel Size 3D (x:int, y:int, z:int) [pixel]</td> | ||
<td>1.0 1.0 1.0 </td> | <td>1.0 1.0 1.0 </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>-c</td> | ||
+ | <td>選択</td> | ||
+ | <td>コンフィグファイル設定</td> | ||
+ | <td>NULL</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>-m</td> | ||
+ | <td>選択</td> | ||
+ | <td>モードを設定</td> | ||
+ | <td>0</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>-h</td> | ||
+ | <td>選択</td> | ||
+ | <td>ヘルプを表示</td> | ||
+ | <td> </td> | ||
</tr> | </tr> | ||
</div> | </div> | ||
行90: | 行116: | ||
===モードの詳細=== | ===モードの詳細=== | ||
+ | <table border="1"> | ||
+ | <tr> | ||
+ | <th>モード</th> | ||
+ | <th>説明</th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>0</td> | ||
+ | <td></td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | ===-kTD の詳細=== | ||
<table border="1"> | <table border="1"> | ||
<div align="left"> | <div align="left"> | ||
行96: | 行134: | ||
<th>説明</th> | <th>説明</th> | ||
</tr> | </tr> | ||
− | + | <tr> | |
+ | <td>0</td> | ||
+ | <td>ガウス関数</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>1</td> | ||
+ | <td>ローレンツ関数</td> | ||
+ | </tr> | ||
</div> | </div> | ||
</table> | </table> | ||
+ | |||
+ | ===-kTS の詳細=== | ||
+ | <table border="1"> | ||
+ | <tr> | ||
+ | <th>モード</th> | ||
+ | <th>説明</th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>0</td> | ||
+ | <td>ガウス関数</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>1</td> | ||
+ | <td>ローレンツ関数</td> | ||
+ | </tr> | ||
+ | </table> | ||
== 実行例 == | == 実行例 == | ||
+ | ===[[Media:Input-1VOM-N-2D.mrc | 入力ファイル]](2D)の画像=== | ||
+ | <table> | ||
+ | <tr> | ||
+ | <td>[[画像:Input-1VOM-N-2D.png]]</td> | ||
+ | <td><p align="left">最小<br> | ||
+ | 最大<br> | ||
+ | 平均値<br> | ||
+ | 標準偏差<br> | ||
+ | 標準誤差<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">-18651.7 (10, 1, 0)<br> | ||
+ | 52942.7 (24, 39, 0)<br> | ||
+ | 7214.87<br> | ||
+ | 10067.6<br> | ||
+ | 125.845<br></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | ====オプション必須項目のみの場合==== | ||
+ | <table> | ||
+ | <tr> | ||
+ | <td>[[画像:Outdata-mrcImageBilateralFilter.png]]</td> | ||
+ | <td><p align="left">最小<br> | ||
+ | 最大<br> | ||
+ | 平均値<br> | ||
+ | 標準偏差<br> | ||
+ | 標準誤差<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">-18651.7 (10, 1, 0)<br> | ||
+ | 52942.7 (24, 39, 0)<br> | ||
+ | 7214.87<br> | ||
+ | 10067.6<br> | ||
+ | 125.845<br></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | ====オプション -sD==== | ||
+ | =====sD=50000で実行===== | ||
+ | <table> | ||
+ | <tr> | ||
+ | <td>[[画像:Outdata-sD-mrcImageBilateralFilter.png]]</td> | ||
+ | <td><p align="left">最小<br> | ||
+ | 最大<br> | ||
+ | 平均値<br> | ||
+ | 標準偏差<br> | ||
+ | 標準誤差<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">-3963.33 (76, 66, 0)<br> | ||
+ | 36164.2 (26, 29, 0)<br> | ||
+ | 7213.95<br> | ||
+ | 8271.46<br> | ||
+ | 103.393<br></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | <div>以降はsD=50000で実行する</div> | ||
+ | |||
+ | |||
+ | ====オプション -kTD==== | ||
+ | =====kTD=1で実行===== | ||
+ | <table> | ||
+ | <tr> | ||
+ | <td>[[画像:Outdata-kTD-mrcImageBilateralFilter.png]]</td> | ||
+ | <td><p align="left">最小<br> | ||
+ | 最大<br> | ||
+ | 平均値<br> | ||
+ | 標準偏差<br> | ||
+ | 標準誤差<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">-4063.09 (56, 4, 0)<br> | ||
+ | 36357.6 (26, 29, 0)<br> | ||
+ | 7212.18<br> | ||
+ | 8280.1<br> | ||
+ | 103.501<br></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | ====オプション -sS==== | ||
+ | =====sS=10で実行===== | ||
+ | <table> | ||
+ | <tr> | ||
+ | <td>[[画像:Outdata-sS-mrcImageBilateralFilter.png]]</td> | ||
+ | <td><p align="left">最小<br> | ||
+ | 最大<br> | ||
+ | 平均値<br> | ||
+ | 標準偏差<br> | ||
+ | 標準誤差<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">-3196.78 (38, 0, 0)<br> | ||
+ | 32196.3 (25, 39, 0)<br> | ||
+ | 7210.81<br> | ||
+ | 8039.59<br> | ||
+ | 100.495<br></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | ====オプション -kTS==== | ||
+ | =====kTS=1, sS=10で実行===== | ||
+ | <table> | ||
+ | <tr> | ||
+ | <td>[[画像:Outdata-kTS-mrcImageBilateralFilter.png]]</td> | ||
+ | <td><p align="left">最小<br> | ||
+ | 最大<br> | ||
+ | 平均値<br> | ||
+ | 標準偏差<br> | ||
+ | 標準誤差<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">-3198.73 (38, 0, 0)<br> | ||
+ | 32222.2 (25, 39, 0)<br> | ||
+ | 7210.86<br> | ||
+ | 8040.82<br> | ||
+ | 100.51<br></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | ====オプション -kS==== | ||
+ | =====kS=10で実行===== | ||
+ | <table> | ||
+ | <tr> | ||
+ | <td>[[画像:Outdata-kS-mrcImageBilateralFilter.png]]</td> | ||
+ | <td><p align="left">最小<br> | ||
+ | 最大<br> | ||
+ | 平均値<br> | ||
+ | 標準偏差<br> | ||
+ | 標準誤差<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">-3871.71 (76, 66, 0)<br> | ||
+ | 35969.2 (26, 29, 0)<br> | ||
+ | 7213.84<br> | ||
+ | 8256.51<br> | ||
+ | 103.206<br></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | ===[[Media:Input-1VOM-N.mrc | 入力ファイル]](3D)の画像=== | ||
+ | <table> | ||
+ | <tr> | ||
+ | <td><p align="Center">[[画像:Input-1VOM-N.png]]<br> | ||
+ | xy平面<br></p> | ||
+ | </td> | ||
+ | <td><p align="Center">[[画像:Input1-1VOM-N.png]]<br> | ||
+ | yz平面<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">最小<br> | ||
+ | 最大<br> | ||
+ | 平均値<br> | ||
+ | 標準偏差<br> | ||
+ | 標準誤差<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">-2390.42 (77, 14, 69)<br> | ||
+ | 4374.62 (17, 62, 46)<br> | ||
+ | 72.1487<br> | ||
+ | 577.82<br> | ||
+ | 0.722275<br></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | ====オプション -sD==== | ||
+ | =====sD=1000で実行===== | ||
+ | <table> | ||
+ | <tr> | ||
+ | <td><p align="Center">[[画像:Outdata1-sD-mrcImageBilateralFilter.png]]<br> | ||
+ | xy平面<br></p> | ||
+ | </td> | ||
+ | <td><p align="Center">[[画像:Outdata2-sD-mrcImageBilateralFilter.png]]<br> | ||
+ | yz平面<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">最小<br> | ||
+ | 最大<br> | ||
+ | 平均値<br> | ||
+ | 標準偏差<br> | ||
+ | 標準誤差<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">-1272.88 (77, 14, 69)<br> | ||
+ | 4131.48 (17, 62, 46)<br> | ||
+ | 67.6465<br> | ||
+ | 267.559<br> | ||
+ | 0.334449<br></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | <div>以降はsD=1000で実行する</div> | ||
+ | |||
+ | |||
+ | ====オプション -sS3==== | ||
+ | =====sS3=(1, 0.7, 1)で実行===== | ||
+ | <table> | ||
+ | <tr> | ||
+ | <td><p align="Center">[[画像:Outdata-sS3-mrcImageBilateralFilter.png]]<br> | ||
+ | xy平面<br></p> | ||
+ | </td> | ||
+ | <td><p align="Center">[[画像:Outdata1-sS3-mrcImageBilateralFilter.png]]<br> | ||
+ | yz平面<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">最小<br> | ||
+ | 最大<br> | ||
+ | 平均値<br> | ||
+ | 標準偏差<br> | ||
+ | 標準誤差<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">-1459.87 (77, 14, 69)<br> | ||
+ | 4154.41 (17, 62, 46)<br> | ||
+ | 68.4469<br> | ||
+ | 284.532<br> | ||
+ | 0.355665<br></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | ====オプション -kS3==== | ||
+ | =====kS3=(2, 2, 1)で実行===== | ||
+ | <table> | ||
+ | <tr> | ||
+ | <td><p align="Center">[[画像:Outdata-kS3-mrcImageBilateralFilter.png]]<br> | ||
+ | xy平面<br></p> | ||
+ | </td> | ||
+ | <td><p align="Center">[[画像:Outdata1-kS3-mrcImageBilateralFilter.png]]<br> | ||
+ | yz平面<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">最小<br> | ||
+ | 最大<br> | ||
+ | 平均値<br> | ||
+ | 標準偏差<br> | ||
+ | 標準誤差<br></p> | ||
+ | </td> | ||
+ | <td><p align="left">-1966.48 (78, 4, 26)<br> | ||
+ | 4354.27 (17, 62, 46)<br> | ||
+ | 71.3418<br> | ||
+ | 396.845<br> | ||
+ | 0.496056<br></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
== 参考資料 == | == 参考資料 == | ||
* C. Tomasi and R. Manduchi, Bilateral Filtering for Gray and Color Images, Proceedings of the 1998 IEEE International Conference on Computer Vision, Bombay, India | * C. Tomasi and R. Manduchi, Bilateral Filtering for Gray and Color Images, Proceedings of the 1998 IEEE International Conference on Computer Vision, Bombay, India |
2019年1月11日 (金) 02:53時点における最新版
mrcImageBilateralFilterとはmrcImageファイルを平滑化するためのEosのコマンドである。 Tomasi and Manduchiにより提唱された手法であり、エッジを保ちつつ、平滑化するための手法である。像の強度差による重みを付けた平滑化である。二つの偏差(強度差、距離)をガウス分布などにより重みを計算していることにより、強度差がある領域をぼかすことなく維持できる。
アルゴリズム
Wx(xi, xj)とWI(Ii,Ij)の二つのウェイトをもち、いずれも|xi-xj|, |Ii-Ij|のガウス関数もしくはローレンツ関数などとして定義されている。すなわち、エッジ付近では、画像の差が大きくなるため、自分自身が属する密度帯での平滑化のウェイトがかかる。
linfo.mode : 0
linfo.mode : 1
fi = Sigma_j(W(i,j)*Ij)/ Sigma_j(Wj) ,where W(i,j)=W_x(xi,xj)*W_I(Ii,Ij) ------- linfo.mode : 0 W_x(xi,xj) = exp(-|xi-xj|^2/2 sigmaSpace^2 ) W_I(Ii,Ij) = exp(-|Ii-Ij|^2/2 sigmaDensity^2) ------- linfo.mode : 1 W_x(xi,xj) = 1/(1+|xi-xj|^2/sigmaSpace^2 ) W_I(Ii,Ij) = 1/(1+|Ii-Ij|^2/sigmaDensity^2)
オプション一覧
メインオプション
オプション | 必須項目/選択項目 | 説明 | デフォルト |
---|---|---|---|
-i | 必須 | 入力ファイル:mrcImage | NULL |
-o | 選択 | 出力ファイル:mrcImage | stdout(設定しなければ標準出力) |
-sD | 選択 | SigmaDensity(float) [ImageAmplitude] : | 2.0 |
-kTD | 選択 | Kernel Type of Density (int) | 0 |
-sS | 選択 | SigmaSpace(float) [pixel] | 1.0 |
-sS3 | 選択 | SigmaSpace 3D (x:float, y:float, z:float) [pixel]: | 1.0 1.0 1.0 |
-kTS | 選択 | Kernel Type of Space (int) | 0 |
-kS | 選択 | Kernel Size (int) [pixel] | 1.0 |
-kS3 | 選択 | Kernel Size 3D (x:int, y:int, z:int) [pixel] | 1.0 1.0 1.0 |
-c | 選択 | コンフィグファイル設定 | NULL |
-m | 選択 | モードを設定 | 0 |
-h | 選択 | ヘルプを表示 |
モードの詳細
モード | 説明 |
---|---|
0 |
-kTD の詳細
モード | 説明 |
---|---|
0 | ガウス関数 |
1 | ローレンツ関数 |
-kTS の詳細
モード | 説明 |
---|---|
0 | ガウス関数 |
1 | ローレンツ関数 |
実行例
入力ファイル(2D)の画像
最小 最大 |
-18651.7 (10, 1, 0) 52942.7 (24, 39, 0) |
オプション必須項目のみの場合
最小 最大 |
-18651.7 (10, 1, 0) 52942.7 (24, 39, 0) |
オプション -sD
sD=50000で実行
最小 最大 |
-3963.33 (76, 66, 0) 36164.2 (26, 29, 0) |
オプション -kTD
kTD=1で実行
最小 最大 |
-4063.09 (56, 4, 0) 36357.6 (26, 29, 0) |
オプション -sS
sS=10で実行
最小 最大 |
-3196.78 (38, 0, 0) 32196.3 (25, 39, 0) |
オプション -kTS
kTS=1, sS=10で実行
最小 最大 |
-3198.73 (38, 0, 0) 32222.2 (25, 39, 0) |
オプション -kS
kS=10で実行
最小 最大 |
-3871.71 (76, 66, 0) 35969.2 (26, 29, 0) |
入力ファイル(3D)の画像
最小 最大 |
-2390.42 (77, 14, 69) 4374.62 (17, 62, 46) |
オプション -sD
sD=1000で実行
最小 最大 |
-1272.88 (77, 14, 69) 4131.48 (17, 62, 46) |
オプション -sS3
sS3=(1, 0.7, 1)で実行
最小 最大 |
-1459.87 (77, 14, 69) 4154.41 (17, 62, 46) |
オプション -kS3
kS3=(2, 2, 1)で実行
最小 最大 |
-1966.48 (78, 4, 26) 4354.27 (17, 62, 46) |
参考資料
- C. Tomasi and R. Manduchi, Bilateral Filtering for Gray and Color Images, Proceedings of the 1998 IEEE International Conference on Computer Vision, Bombay, India