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

📄 chp1.htm

📁 数字图象处理入门,非常好的书!!!!推荐!
💻 HTM
📖 第 1 页 / 共 5 页
字号:
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>0<o:p></o:p></span></p>
  </td>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>255<o:p></o:p></span></p>
  </td>
 </tr>
 <tr>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;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>
  </td>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>0<o:p></o:p></span></p>
  </td>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>255<o:p></o:p></span></p>
  </td>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>255<o:p></o:p></span></p>
  </td>
 </tr>
 <tr>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;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>
  </td>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>255<o:p></o:p></span></p>
  </td>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>255<o:p></o:p></span></p>
  </td>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>255<o:p></o:p></span></p>
  </td>
 </tr>
 <tr>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;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>
  </td>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>0<o:p></o:p></span></p>
  </td>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>0<o:p></o:p></span></p>
  </td>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>0<o:p></o:p></span></p>
  </td>
 </tr>
 <tr>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;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>
  </td>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>128<o:p></o:p></span></p>
  </td>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>128<o:p></o:p></span></p>
  </td>
  <td width="25%" style='width:25.0%;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center;line-height:18.0pt'><span
  style='font-size:10.5pt;font-family:"Times New Roman"'>128<o:p></o:p></span></p>
  </td>
 </tr>
</table>

</div>

<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"'>RGB</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"'><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"'>200</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"'>R</span><span
lang=ZH-CN style='font-size:10.5pt'>、</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>G</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"'>256</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"'>(bit)</span><span
lang=ZH-CN style='font-size:10.5pt'>,即一个字节</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>(byte)</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"'>200×200×3</span><span lang=ZH-CN
style='font-size:10.5pt'>,约</span><span style='font-size:10.5pt;font-family:
"Times New Roman"'>120k</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"'>R</span><span
lang=ZH-CN style='font-size:10.5pt'>、</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>G</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"'>0</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"'>0(</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"'>0</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"'>4</span><span lang=ZH-CN style='font-size:10.5pt'>位</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>(bit)</span><span
lang=ZH-CN style='font-size:10.5pt'>表示,所以一个象素要用半个字节。整个图象要用</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>200×200×0.5</span><span
lang=ZH-CN style='font-size:10.5pt'>,约</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>20k</span><span lang=ZH-CN style='font-size:
10.5pt'>字节,再加上表占用的字节为</span><span style='font-size:10.5pt;font-family:"Times New Roman"'>3×16=48</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"'>1/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"'>R</span><span
lang=ZH-CN style='font-size:10.5pt'>、</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>G</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"'>(Palette)</span><span lang=ZH-CN
style='font-size:10.5pt'>,另一种叫法是颜色查找表</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>LUT(Look Up Table)</span><span lang=ZH-CN
style='font-size:10.5pt'>,似乎更确切一些。</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>Windows</span><span lang=ZH-CN style='font-size:
10.5pt'>位图中便用到了调色板技术。其实不光是</span><span style='font-size:10.5pt;font-family:
"Times New Roman"'>Windows</span><span lang=ZH-CN style='font-size:10.5pt'>位图,许多图象文件格式如</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>pcx</span><span
lang=ZH-CN style='font-size:10.5pt'>、</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>tif</span><span lang=ZH-CN style='font-size:
10.5pt'>、</span><span style='font-size:10.5pt;font-family:"Times New Roman"'>gif</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"'>256×256×256</span><span
lang=ZH-CN style='font-size:10.5pt'>种,也就是说包含我们上述提到的</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>R</span><span
lang=ZH-CN style='font-size:10.5pt'>、</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>G</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"'>(true color)</span><span
lang=ZH-CN style='font-size:10.5pt'>。真彩色图并不是说一幅图包含了所有的颜色,而是说它具有显示所有颜色的能力,即最多可以包含所有的颜色。表示真彩色图时,每个象素直接用</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>R</span><span
lang=ZH-CN style='font-size:10.5pt'>、</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>G</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"'>24</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"'>(</span><span lang=ZH-CN style='font-size:10.5pt'>因为总共有</span><span
style='font-size:10.5pt;font-family:"Times New Roman"'>2<sup>24</sup></span><span
lang=ZH-CN style='font-size:10.5pt'>种颜色,即调色板有</span><span style='font-size:
10.5pt;font-family:"Times New Roman"'>2<sup>24</sup></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"'>R</span><span
lang=ZH-CN style='font-size:10.5pt'>,</span><span style='font-size:10.5pt;
font-family:"Times New Roman"'>G</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"'>256×256×256×3</span><span

⌨️ 快捷键说明

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