?? chp3.htm
字號:
</v:shape><![endif]--><![if !vml]><img width=107 height=75
src="./chp3.files/image007.gif" v:shapes="_x0000_i1032"><![endif]></span></sub><span
style='font-size:10.5pt;font-family:"Times New Roman"'>=<sub> <!--[if gte vml 1]><v:shape
id="_x0000_i1033" type="#_x0000_t75" alt="" style='width:66pt;height:30.75pt'>
<v:imagedata src="./chp3.files/image008.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap03.files/image016.gif"/>
</v:shape><![endif]--><![if !vml]><img width=88 height=41
src="./chp3.files/image008.gif" v:shapes="_x0000_i1033"><![endif]></sub></span><span
lang=ZH-CN style='font-size:10.5pt'>×</span><span lang=ZH-CN style='font-size:
10.5pt;font-family:"Times New Roman"'> </span><sub><span style='font-size:10.5pt;
font-family:"Times New Roman"'><!--[if gte vml 1]><v:shape id="_x0000_i1034"
type="#_x0000_t75" alt="" style='width:41.25pt;height:56.25pt'>
<v:imagedata src="./chp3.files/image009.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap03.files/image018.gif"/>
</v:shape><![endif]--><![if !vml]><img width=55 height=75
src="./chp3.files/image009.gif" v:shapes="_x0000_i1034"><![endif]></span></sub><span
style='font-size:10.5pt;font-family:"Times New Roman"'>=<sub> <!--[if gte vml 1]><v:shape
id="_x0000_i1035" type="#_x0000_t75" alt="" style='width:99.75pt;height:56.25pt'>
<v:imagedata src="./chp3.files/image010.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap03.files/image020.gif"/>
</v:shape><![endif]--><![if !vml]><img width=133 height=75
src="./chp3.files/image010.gif" v:shapes="_x0000_i1035"><![endif]></sub><o:p></o:p></span></p>
<p align=right style='margin:0cm;margin-bottom:.0001pt;text-align:right;
line-height:18.0pt'><span style='font-size:10.5pt;font-family:"Times New Roman"'>(3.3)<o:p></o:p></span></p>
<p style='margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:
inter-ideograph;line-height:18.0pt'><span lang=ZH-CN style='font-size:10.5pt'>我們來驗證一下。</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'><o:p></o:p></span></p>
<p style='margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:
inter-ideograph;line-height:18.0pt'><span lang=ZH-CN style='font-size:10.5pt'>設圖象為</span><sub><span
lang=ZH-CN style='font-size:10.5pt;font-family:"Times New Roman"'> </span></sub><sub><span
style='font-size:10.5pt;font-family:"Times New Roman"'><!--[if gte vml 1]><v:shape
id="_x0000_i1036" type="#_x0000_t75" alt="" style='width:1in;height:1in'>
<v:imagedata src="./chp3.files/image011.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap03.files/image022.gif"/>
</v:shape><![endif]--><![if !vml]><img width=96 height=96
src="./chp3.files/image011.gif" v:shapes="_x0000_i1036"><![endif]></span></sub><span
lang=ZH-CN style='font-size:10.5pt'>,經過</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>(3.2)</span><span lang=ZH-CN style='font-size:
10.5pt'>式處理后變為</span><sub><span lang=ZH-CN style='font-size:10.5pt;font-family:
"Times New Roman"'> </span></sub><sub><span style='font-size:10.5pt;font-family:
"Times New Roman"'><!--[if gte vml 1]><v:shape id="_x0000_i1037" type="#_x0000_t75"
alt="" style='width:102pt;height:1in'>
<v:imagedata src="./chp3.files/image012.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap03.files/image024.gif"/>
</v:shape><![endif]--><![if !vml]><img width=136 height=96
src="./chp3.files/image012.gif" v:shapes="_x0000_i1037"><![endif]></span></sub><span
lang=ZH-CN style='font-size:10.5pt'>,經過</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>(3.3)</span><span lang=ZH-CN style='font-size:
10.5pt'>式處理后變為</span><sub><span lang=ZH-CN style='font-size:10.5pt;font-family:
"Times New Roman"'> </span></sub><sub><span style='font-size:10.5pt;font-family:
"Times New Roman"'><!--[if gte vml 1]><v:shape id="_x0000_i1038" type="#_x0000_t75"
alt="" style='width:102pt;height:1in'>
<v:imagedata src="./chp3.files/image012.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap03.files/image026.gif"/>
</v:shape><![endif]--><![if !vml]><img width=136 height=96
src="./chp3.files/image012.gif" v:shapes="_x0000_i1038"><![endif]></span></sub><span
lang=ZH-CN style='font-size:10.5pt'>,兩者完全一樣。如果計算時不考慮周圍一圈的象素,前者做了</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>4</span><span
lang=ZH-CN style='font-size:10.5pt'>×</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>(9</span><span lang=ZH-CN style='font-size:10.5pt'>個乘法,</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>8</span><span
lang=ZH-CN style='font-size:10.5pt'>個加法,</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>1</span><span lang=ZH-CN style='font-size:10.5pt'>個除法</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>)</span><span
lang=ZH-CN style='font-size:10.5pt'>,共</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>36</span><span lang=ZH-CN style='font-size:10.5pt'>個乘法,</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>32</span><span
lang=ZH-CN style='font-size:10.5pt'>個加法,</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>4</span><span lang=ZH-CN style='font-size:10.5pt'>個除法;后者做了</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>4</span><span
lang=ZH-CN style='font-size:10.5pt'>×</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>(3</span><span lang=ZH-CN style='font-size:10.5pt'>個乘法,</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>2</span><span
lang=ZH-CN style='font-size:10.5pt'>個加法</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>)+4</span><span lang=ZH-CN style='font-size:
10.5pt'>×</span><span style='font-size:10.5pt;font-family:"Times New Roman"'>(3</span><span
lang=ZH-CN style='font-size:10.5pt'>個乘法,</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>2</span><span lang=ZH-CN style='font-size:10.5pt'>個加法</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>)+4</span><span
lang=ZH-CN style='font-size:10.5pt'>個除法,共</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>24</span><span lang=ZH-CN style='font-size:10.5pt'>個乘法,</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>16</span><span
lang=ZH-CN style='font-size:10.5pt'>個加法,</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>4</span><span lang=ZH-CN style='font-size:10.5pt'>個除法,運算簡化了不少,如果是大圖,效率的提高將是非常客觀的。</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'><o:p></o:p></span></p>
<p style='margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:
inter-ideograph;line-height:18.0pt'><span lang=ZH-CN style='font-size:10.5pt'>平滑模板的思想是通過將一點和周圍</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>8</span><span
lang=ZH-CN style='font-size:10.5pt'>個點作平均,從而去除突然變化的點,濾掉噪聲,其代價是圖象有一定程度的模糊。上面提到的模板</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>(3.1)</span><span
lang=ZH-CN style='font-size:10.5pt'>,就是一種平滑模板,稱之為</span><span style='font-size:
10.5pt;font-family:"Times New Roman"'>Box</span><span lang=ZH-CN
style='font-size:10.5pt'>模板。</span><span style='font-size:10.5pt;font-family:
"Times New Roman"'>Box</span><span lang=ZH-CN style='font-size:10.5pt'>模板雖然考慮了鄰域點的作用,但并沒有考慮各點位置的影響,對于所有的</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>9</span><span
lang=ZH-CN style='font-size:10.5pt'>個點都一視同仁,所以平滑的效果并不理想。實際上我們可以想象,離某點越近的點對該點的影響應該越大,為此,我們引入了加權系數,將原來的模板改造成</span><sub><span
lang=ZH-CN style='font-size:10.5pt;font-family:"Times New Roman"'> </span></sub><sub><span
style='font-size:10.5pt;font-family:"Times New Roman"'><!--[if gte vml 1]><v:shape
id="_x0000_i1039" type="#_x0000_t75" alt="" style='width:80.25pt;height:56.25pt'>
<v:imagedata src="./chp3.files/image007.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap03.files/image027.gif"/>
</v:shape><![endif]--><![if !vml]><img width=107 height=75
src="./chp3.files/image007.gif" v:shapes="_x0000_i1039"><![endif]></span></sub><span
lang=ZH-CN style='font-size:10.5pt'>,可以看出,距離越近的點,加權系數越大。</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'><o:p></o:p></span></p>
<p style='margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:
inter-ideograph;line-height:18.0pt'><span lang=ZH-CN style='font-size:10.5pt'>新的模板也是一個常用的平滑模板,稱為高斯</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>(Gauss)</span><span
lang=ZH-CN style='font-size:10.5pt'>模板。為什么叫這個名字,這是因為這個模板是通過采樣</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>2</span><span
lang=ZH-CN style='font-size:10.5pt'>維高斯函數得到的。</span><span style='font-size:
10.5pt;font-family:"Times New Roman"'><o:p></o:p></span></p>
<p style='margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:
inter-ideograph;line-height:18.0pt'><span lang=ZH-CN style='font-size:10.5pt'>設圖象為</span><sub><span
lang=ZH-CN style='font-size:10.5pt;font-family:"Times New Roman"'> </span></sub><sub><span
style='font-size:10.5pt;font-family:"Times New Roman"'><!--[if gte vml 1]><v:shape
id="_x0000_i1040" type="#_x0000_t75" alt="" style='width:1in;height:1in'>
<v:imagedata src="./chp3.files/image011.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap03.files/image028.gif"/>
</v:shape><![endif]--><![if !vml]><img width=96 height=96
src="./chp3.files/image011.gif" v:shapes="_x0000_i1040"><![endif]></span></sub><span
lang=ZH-CN style='font-size:10.5pt'>,分別用兩種平滑模板處理</span><span style='font-size:
10.5pt;font-family:"Times New Roman"'>(</span><span lang=ZH-CN
style='font-size:10.5pt'>周圍一圈象素直接從原圖拷貝</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>)</span><span lang=ZH-CN style='font-size:10.5pt'>。采用</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>Box</span><span
lang=ZH-CN style='font-size:10.5pt'>模板的結果為</span><sub><span lang=ZH-CN
style='font-size:10.5pt;font-family:"Times New Roman"'> </span></sub><sub><span
style='font-size:10.5pt;font-family:"Times New Roman"'><!--[if gte vml 1]><v:shape
id="_x0000_i1041" type="#_x0000_t75" alt="" style='width:101.25pt;height:1in'>
<v:imagedata src="./chp3.files/image013.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap03.files/image030.gif"/>
</v:shape><![endif]--><![if !vml]><img width=135 height=96
src="./chp3.files/image013.gif" v:shapes="_x0000_i1041"><![endif]></span></sub><span
lang=ZH-CN style='font-size:10.5pt'>,采用高斯模板的結果為</span><sub><span lang=ZH-CN
style='font-size:10.5pt;font-family:"Times New Roman"'> </span></sub><sub><span
style='font-size:10.5pt;font-family:"Times New Roman"'><!--[if gte vml 1]><v:shape
id="_x0000_i1042" type="#_x0000_t75" alt="" style='width:102pt;height:1in'>
<v:imagedata src="./chp3.files/image014.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap03.files/image032.gif"/>
</v:shape><![endif]--><![if !vml]><img width=136 height=96
src="./chp3.files/image014.gif" v:shapes="_x0000_i1042"><![endif]></span></sub><span
lang=ZH-CN style='font-size:10.5pt'>。</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'><o:p></o:p></span></p>
<p style='margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:
inter-ideograph;line-height:18.0pt'><span lang=ZH-CN style='font-size:10.5pt'>可以看到,原圖中出現噪聲的區域是第</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>2</span><span
lang=ZH-CN style='font-size:10.5pt'>行第</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>2</span><span lang=ZH-CN style='font-size:10.5pt'>列和第</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>3</span><span
lang=ZH-CN style='font-size:10.5pt'>行第</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>2</span><span lang=ZH-CN style='font-size:10.5pt'>列,灰度從</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>2</span><span
lang=ZH-CN style='font-size:10.5pt'>一下子跳到了</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>6</span><span lang=ZH-CN style='font-size:10.5pt'>,用</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>Box</span><span
lang=ZH-CN style='font-size:10.5pt'>模板處理后,灰度從</span><span style='font-size:
10.5pt;font-family:"Times New Roman"'>3.11</span><span lang=ZH-CN
style='font-size:10.5pt'>跳到</span><span style='font-size:10.5pt;font-family:
"Times New Roman"'>4.33</span><span lang=ZH-CN style='font-size:10.5pt'>;用高斯模板處理后,灰度從</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>3.</span><span
lang=ZH-CN style='font-size:10.5pt'>跳到</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>4.56,</span><span lang=ZH-CN style='font-size:
10.5pt'>都緩和了跳變的幅度,從這一點上看,兩者都達到了平滑的目的。但是,原圖中的第</span><span style='font-size:
10.5pt;font-family:"Times New Roman"'>3</span><span lang=ZH-CN
style='font-size:10.5pt'>,第</span><span style='font-size:10.5pt;font-family:
"Times New Roman"'>4</span><span lang=ZH-CN style='font-size:10.5pt'>行總的來說,灰度值是比較高的,經模板</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>1</span><span
lang=ZH-CN style='font-size:10.5pt'>處理后,第</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>3</span><span lang=ZH-CN style='font-size:10.5pt'>行第</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>2</span><span
lang=ZH-CN style='font-size:10.5pt'>列元素的灰度變成了</span><span style='font-size:
10.5pt;font-family:"Times New Roman"'>4.33</span><span lang=ZH-CN
style='font-size:10.5pt'>,與第</span><span style='font-size:10.5pt;font-family:
"Times New Roman"'>3</span><span lang=ZH-CN style='font-size:10.5pt'>,第</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>4</span><span
lang=ZH-CN style='font-size:10.5pt'>行的總體灰度相比偏小,另外,原圖中第</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>3</span><span
lang=ZH-CN style='font-size:10.5pt'>行第</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>2</span><span lang=ZH-CN style='font-size:10.5pt'>列元素的灰度為</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>6</span><span
lang=ZH-CN style='font-size:10.5pt'>,第</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>3</span><span lang=ZH-CN style='font-size:10.5pt'>行第</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>3</span><span
lang=ZH-CN style='font-size:10.5pt'>列元素的灰度為</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>4</span><span lang=ZH-CN style='font-size:10.5pt'>,變換后,后者</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>4.56</span><span
lang=ZH-CN style='font-size:10.5pt'>反而比前者</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>4.33</span><span lang=ZH-CN style='font-size:
10.5pt'>大了。而采用高斯模板沒有出現這些問題,究其原因,就是因為它考慮了位置的影響。</span><span style='font-size:
10.5pt;font-family:"Times New Roman"'><o:p></o:p></span></p>
<p style='margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:
inter-ideograph;line-height:18.0pt'><span lang=ZH-CN style='font-size:10.5pt'>舉個實際的例子:下圖中,從左到右分別是原圖,用高斯模板處理的圖,用</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>Box</span><span
lang=ZH-CN style='font-size:10.5pt'>模板處理的圖,可以看出,采用高斯模板,在實現平滑效果的同時,要比</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>Box</span><span
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -