⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chp6.htm

📁 数字图象处理入门,非常好的书!!!!推荐!
💻 HTM
📖 第 1 页 / 共 5 页
字号:
src="./chp6.files/image009.jpg" v:shapes="_x0000_i1035"><![endif]>B</span><span
lang=ZH-CN style='font-size:10.5pt'>,如图</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>6.8</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 align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;
line-height:18.0pt'><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:228pt;height:204.75pt'>
 <v:imagedata src="./chp6.files/image010.jpg" o:href="http://www-scf.usc.edu/~flv/ipbook/chap06.files/image023.jpg"/>
</v:shape><![endif]--><![if !vml]><img width=304 height=273
src="./chp6.files/image010.jpg" v:shapes="_x0000_i1036"><![endif]><o:p></o:p></span></p>

<p align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;
line-height:18.0pt'><b><span lang=ZH-CN style='font-size:10.5pt'>图</span></b><b><span
style='font-size:10.5pt;font-family:"Times New Roman"'>6.8&nbsp;&nbsp;&nbsp;&nbsp;
</span></b><b><span lang=ZH-CN style='font-size:10.5pt'>腐蚀的示意图</span></b><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"'>6.8</span><span
lang=ZH-CN style='font-size:10.5pt'>中</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>X</span><span lang=ZH-CN style='font-size:10.5pt'>是被处理的对象,</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>B</span><span
lang=ZH-CN style='font-size:10.5pt'>是结构元素。不难知道,对于任意一个在阴影部分的点</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>a</span><span
lang=ZH-CN style='font-size:10.5pt'>,</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>B<sub>a</sub> </span><span lang=ZH-CN
style='font-size:10.5pt'>包含于</span><span style='font-size:10.5pt;font-family:
"Times New Roman"'>X</span><span lang=ZH-CN style='font-size:10.5pt'>,所以</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>X</span><span
lang=ZH-CN style='font-size:10.5pt'>被</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>B</span><span lang=ZH-CN style='font-size:10.5pt'>腐蚀的结果就是那个阴影部分。阴影部分在</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>X</span><span
lang=ZH-CN style='font-size:10.5pt'>的范围之内,且比</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>X</span><span lang=ZH-CN style='font-size:10.5pt'>小,就象</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>X</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"'>B</span><span
lang=ZH-CN style='font-size:10.5pt'>是对称的,即</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>B</span><span lang=ZH-CN style='font-size:10.5pt'>的对称集</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>B<sup>v</sup>=B</span><span
lang=ZH-CN style='font-size:10.5pt'>,所以</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>X</span><span lang=ZH-CN style='font-size:10.5pt'>被</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>B</span><span
lang=ZH-CN style='font-size:10.5pt'>腐蚀的结果和</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>X</span><span lang=ZH-CN style='font-size:10.5pt'>被</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'> B<sup>v</sup></span><span
lang=ZH-CN style='font-size:10.5pt'>腐蚀的结果是一样的。如果</span><span style='font-size:
10.5pt;font-family:"Times New Roman"'>B</span><span lang=ZH-CN
style='font-size:10.5pt'>不是对称的,让我们看看图</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>6.9</span><span lang=ZH-CN style='font-size:
10.5pt'>,就会发现</span><span style='font-size:10.5pt;font-family:"Times New Roman"'>X</span><span
lang=ZH-CN style='font-size:10.5pt'>被</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>B</span><span lang=ZH-CN style='font-size:10.5pt'>腐蚀的结果和</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>X</span><span
lang=ZH-CN style='font-size:10.5pt'>被</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'> B<sup>v</sup></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 align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;
line-height:18.0pt'><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:299.25pt;height:212.25pt'>
 <v:imagedata src="./chp6.files/image011.jpg" o:href="http://www-scf.usc.edu/~flv/ipbook/chap06.files/image025.jpg"/>
</v:shape><![endif]--><![if !vml]><img width=399 height=283
src="./chp6.files/image011.jpg" v:shapes="_x0000_i1037"><![endif]><o:p></o:p></span></p>

<p align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;
line-height:18.0pt'><b><span lang=ZH-CN style='font-size:10.5pt'>图</span></b><b><span
style='font-size:10.5pt;font-family:"Times New Roman"'>6.9&nbsp;&nbsp;&nbsp;&nbsp;
</span></b><b><span lang=ZH-CN style='font-size:10.5pt'>结构元素非对称时,腐蚀的结果不同</span></b><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"'>6.8</span><span
lang=ZH-CN style='font-size:10.5pt'>和图</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>6.9</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"'>6.10</span><span
lang=ZH-CN style='font-size:10.5pt'>中,左边是被处理的图象</span><span style='font-size:
10.5pt;font-family:"Times New Roman"'>X(</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"'>B</span><span
lang=ZH-CN style='font-size:10.5pt'>,那个标有</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>origin</span><span lang=ZH-CN style='font-size:
10.5pt'>的点是中心点,即当前处理元素的位置,我们在介绍模板操作时也有过类似的概念。腐蚀的方法是,拿</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>B</span><span
lang=ZH-CN style='font-size:10.5pt'>的中心点和</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>X</span><span lang=ZH-CN style='font-size:10.5pt'>上的点一个一个地对比,如果</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>B</span><span
lang=ZH-CN style='font-size:10.5pt'>上的所有点都在</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>X</span><span lang=ZH-CN style='font-size:10.5pt'>的范围内,则该点保留,否则将该点去掉;右边是腐蚀后的结果。可以看出,它仍在原来</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>X</span><span
lang=ZH-CN style='font-size:10.5pt'>的范围内,且比</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>X</span><span lang=ZH-CN style='font-size:10.5pt'>包含的点要少,就象</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>X</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 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:402pt;height:156.75pt'>
 <v:imagedata src="./chp6.files/image012.jpg" o:href="http://www-scf.usc.edu/~flv/ipbook/chap06.files/image027.jpg"/>
</v:shape><![endif]--><![if !vml]><img width=536 height=209
src="./chp6.files/image012.jpg" v:shapes="_x0000_i1038"><![endif]><o:p></o:p></span></p>

<p align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;
line-height:18.0pt'><b><span lang=ZH-CN style='font-size:10.5pt'>图</span></b><b><span
style='font-size:10.5pt;font-family:"Times New Roman"'>6.10&nbsp;&nbsp; </span></b><b><span
lang=ZH-CN style='font-size:10.5pt'>腐蚀运算</span></b><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"'>6.11</span><span
lang=ZH-CN style='font-size:10.5pt'>为原图,图</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>6.12</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 align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;
line-height:18.0pt'><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:240pt;height:70.5pt'>
 <v:imagedata src="./chp6.files/image013.jpg" o:href="http://www-scf.usc.edu/~flv/ipbook/chap06.files/image029.jpg"/>
</v:shape><![endif]--><![if !vml]><img width=320 height=94
src="./chp6.files/image013.jpg" v:shapes="_x0000_i1039"><![endif]><o:p></o:p></span></p>

<p align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;
line-height:18.0pt'><b><span lang=ZH-CN style='font-size:10.5pt'>图</span></b><b><span
style='font-size:10.5pt;font-family:"Times New Roman"'>6.11&nbsp;&nbsp;&nbsp; </span></b><b><span
lang=ZH-CN style='font-size:10.5pt'>原图</span></b><span style='font-size:10.5pt;
font-family:"Times New Roman"'><o:p></o:p></span></p>

<p align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;
line-height:18.0pt'><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:239.25pt;height:71.25pt'>
 <v:imagedata src="./chp6.files/image014.jpg" o:href="http://www-scf.usc.edu/~flv/ipbook/chap06.files/image031.jpg"/>
</v:shape><![endif]--><![if !vml]><img width=319 height=95
src="./chp6.files/image014.jpg" v:shapes="_x0000_i1040"><![endif]><o:p></o:p></span></p>

<p align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;
line-height:18.0pt'><b><span lang=ZH-CN style='font-size:10.5pt'>图</span></b><b><span
style='font-size:10.5pt;font-family:"Times New Roman"'>6.12&nbsp;&nbsp; </span></b><b><span
lang=ZH-CN style='font-size:10.5pt'>腐蚀后的结果图</span></b><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"'>BOOL</span><span
lang=ZH-CN style='font-size:10.5pt'>变量,为真时,表示在水平方向进行腐蚀运算,即结构元素</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>B</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:47.25pt;height:17.25pt'>
 <v:imagedata src="./chp6.files/image015.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap06.files/image033.gif"/>
</v:shape><![endif]--><![if !vml]><img width=63 height=23
src="./chp6.files/image015.gif" v:shapes="_x0000_i1041"><![endif]></span></sub><span
lang=ZH-CN style='font-size:10.5pt'>;否则在垂直方向上进行腐蚀运算,即结构元素</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>B</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_i1042" type="#_x0000_t75" alt="" style='width:21pt;height:56.25pt'>
 <v:imagedata src="./chp6.files/image016.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap06.files/image035.gif"/>
</v:shape><![endif]--><![if !vml]><img width=28 height=75
src="./chp6.files/image016.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 style='font-size:10.5pt;font-family:
"Times New Roman"'>BOOL Erosion(HWND hWnd,BOOL Hori)<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 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 style='font-size:10.5pt;font-family:
"Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
DWORD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OffBits,BufSize;<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 style='font-size:10.5pt;font-family:
"Times New Roman"'>LPBITMAPINFOHEADER&nbsp;&nbsp;&nbsp; lpImgData;<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 style='font-size:10.5pt;font-family:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -