📄 chp4.htm
字号:
<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:shapetype
id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t"
path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" alt="" style='width:194.25pt;
height:42pt'>
<v:imagedata src="./chp4.files/image001.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap04.files/image001.gif"/>
</v:shape><![endif]--><![if !vml]><img width=259 height=56
src="./chp4.files/image001.gif" v:shapes="_x0000_i1025"><![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"'>4.1 </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"'>4.1</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"'>(halftone)</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>
<h2 style='text-align:justify;text-justify:inter-ideograph'><span
style='font-family:"Times New Roman"'>4.1 </span><span lang=ZH-CN
style='mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman"'>图案法</span><span
style='font-family:"Times New Roman"'><o:p></o:p></span></h2>
<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"'>(patterning)</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"'>dpi(dot per inch)</span><span
lang=ZH-CN style='font-size:10.5pt'>,即每英寸点数,点数越多,分辨率就越高,图象就越清晰。让我们来计算一下,计算机显示器的分辨率有多高。设显示器为</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>15</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"'>)</span><span
lang=ZH-CN style='font-size:10.5pt'>,最多显示</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>1280</span><span lang=ZH-CN style='font-size:
10.5pt'>×</span><span style='font-size:10.5pt;font-family:"Times New Roman"'>1024</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"'>12</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"'>106dpi</span><span
lang=ZH-CN style='font-size:10.5pt'>,垂直分辨率为</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>113.8dpi</span><span lang=ZH-CN
style='font-size:10.5pt'>。一般的激光打印机的分辨率有</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>300dpi</span><span lang=ZH-CN style='font-size:
10.5pt'>×</span><span style='font-size:10.5pt;font-family:"Times New Roman"'>300dpi</span><span
lang=ZH-CN style='font-size:10.5pt'>,</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>600dpi</span><span lang=ZH-CN style='font-size:
10.5pt'>×</span><span style='font-size:10.5pt;font-family:"Times New Roman"'>600dpi</span><span
lang=ZH-CN style='font-size:10.5pt'>,</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>720dpi</span><span lang=ZH-CN style='font-size:
10.5pt'>×</span><span style='font-size:10.5pt;font-family:"Times New Roman"'>720dpi</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"'>240</span><span
lang=ZH-CN style='font-size:10.5pt'>×</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>180</span><span lang=ZH-CN style='font-size:
10.5pt'>×</span><span style='font-size:10.5pt;font-family:"Times New Roman"'>8bit</span><span
lang=ZH-CN style='font-size:10.5pt'>的灰度图,当用分辨率为</span><span style='font-size:
10.5pt;font-family:"Times New Roman"'>300dpi</span><span lang=ZH-CN
style='font-size:10.5pt'>×</span><span style='font-size:10.5pt;font-family:
"Times New Roman"'>300dpi</span><span lang=ZH-CN style='font-size:10.5pt'>的激光打印机将其打印到</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>12.8</span><span
lang=ZH-CN style='font-size:10.5pt'>×</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>9.6</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"'>(300</span><span
lang=ZH-CN style='font-size:10.5pt'>×</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>12.8) </span><span lang=ZH-CN style='font-size:
10.5pt'>×</span><span style='font-size:10.5pt;font-family:"Times New Roman"'>(300</span><span
lang=ZH-CN style='font-size:10.5pt'>×</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>9.6)=3840</span><span lang=ZH-CN
style='font-size:10.5pt'>×</span><span style='font-size:10.5pt;font-family:
"Times New Roman"'>2880</span><span lang=ZH-CN style='font-size:10.5pt'>个点,所以每个象素可以用</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>(3840/240)</span><span
lang=ZH-CN style='font-size:10.5pt'>×</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>(2880/180)=16</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"'>256</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"'>16</span><span
lang=ZH-CN style='font-size:10.5pt'>的方块中一个黑点也没有,就可以表示灰度</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>256</span><span
lang=ZH-CN style='font-size:10.5pt'>;有一个黑点,就表示灰度</span><span style='font-size:
10.5pt;font-family:"Times New Roman"'>255</span><span lang=ZH-CN
style='font-size:10.5pt'>;依次类推,当都是黑点时,表示灰度</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>0</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"'>16</span><span lang=ZH-CN style='font-size:10.5pt'>的方块可以表示</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>257</span><span
lang=ZH-CN style='font-size:10.5pt'>级灰度,比要求的</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>8bit</span><span lang=ZH-CN style='font-size:
10.5pt'>共</span><span style='font-size:10.5pt;font-family:"Times New Roman"'>256</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"'>16</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"'><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"'>4.1</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"'>5</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"'>4.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>
<div align=center>
<table border=0 cellspacing=0 cellpadding=0 style='mso-cellspacing:0cm;
mso-padding-alt:0cm 0cm 0cm 0cm'>
<tr>
<td width=276 valign=bottom style='width:207.0pt;padding:0cm 0cm 0cm 0cm'>
<p align=center style='text-align:center;line-height:18.0pt'><b><span
style='font-size:10.5pt;font-family:"Times New Roman"'><!--[if gte vml 1]><v:shape
id="_x0000_i1026" type="#_x0000_t75" alt="" style='width:237pt;height:66.75pt'>
<v:imagedata src="./chp4.files/image002.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap04.files/image002.gif"/>
</v:shape><![endif]--><![if !vml]><img width=316 height=89
src="./chp4.files/image002.gif" v:shapes="_x0000_i1026"><![endif]></span></b><span
style='font-size:10.5pt;font-family:"Times New Roman"'><o:p></o:p></span></p>
<p align=center style='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"'>4.2 2</span></b><b><span
lang=ZH-CN style='font-size:10.5pt'>×</span></b><b><span style='font-size:
10.5pt;font-family:"Times New Roman"'>2</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>
</td>
<td width=276 valign=bottom style='width:207.0pt;padding:0cm 0cm 0cm 0cm'>
<p align=center style='text-align:center;line-height:18.0pt'><b><span
style='font-size:10.5pt;font-family:"Times New Roman"'><!--[if gte vml 1]><v:shape
id="_x0000_i1027" type="#_x0000_t75" alt="" style='width:121.5pt;height:73.5pt'>
<v:imagedata src="./chp4.files/image003.gif" o:href="http://www-scf.usc.edu/~flv/ipbook/chap04.files/image003.gif"/>
</v:shape><![endif]--><![if !vml]><img width=162 height=98
src="./chp4.files/image003.gif" v:shapes="_x0000_i1027"><![endif]></span></b><span
style='font-size:10.5pt;font-family:"Times New Roman"'><o:p></o:p></span></p>
<p align=center style='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"'>4.3 </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>
</td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -