﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-polly study cs</title><link>http://www.cppblog.com/polly-yang/</link><description /><language>zh-cn</language><lastBuildDate>Sun, 12 Apr 2026 08:01:41 GMT</lastBuildDate><pubDate>Sun, 12 Apr 2026 08:01:41 GMT</pubDate><ttl>60</ttl><item><title>DSP包含的图像算法库</title><link>http://www.cppblog.com/polly-yang/archive/2012/09/18/191141.html</link><dc:creator>polly</dc:creator><author>polly</author><pubDate>Tue, 18 Sep 2012 11:19:00 GMT</pubDate><guid>http://www.cppblog.com/polly-yang/archive/2012/09/18/191141.html</guid><wfw:comment>http://www.cppblog.com/polly-yang/comments/191141.html</wfw:comment><comments>http://www.cppblog.com/polly-yang/archive/2012/09/18/191141.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/polly-yang/comments/commentRss/191141.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/polly-yang/services/trackbacks/191141.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;&nbsp;<a href='http://www.cppblog.com/polly-yang/archive/2012/09/18/191141.html'>阅读全文</a><img src ="http://www.cppblog.com/polly-yang/aggbug/191141.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/polly-yang/" target="_blank">polly</a> 2012-09-18 19:19 <a href="http://www.cppblog.com/polly-yang/archive/2012/09/18/191141.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转载】在Ubuntu下安装Python科学计算环境</title><link>http://www.cppblog.com/polly-yang/archive/2012/09/18/191093.html</link><dc:creator>polly</dc:creator><author>polly</author><pubDate>Tue, 18 Sep 2012 05:02:00 GMT</pubDate><guid>http://www.cppblog.com/polly-yang/archive/2012/09/18/191093.html</guid><wfw:comment>http://www.cppblog.com/polly-yang/comments/191093.html</wfw:comment><comments>http://www.cppblog.com/polly-yang/archive/2012/09/18/191093.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/polly-yang/comments/commentRss/191093.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/polly-yang/services/trackbacks/191093.html</trackback:ping><description><![CDATA[<p style="font-size: 12px" class="reprint"><strong>原文地址</strong>：<a href="http://blog.chinaunix.net/uid-23100982-id-3252291.html" target="_blank">在Ubuntu中安装Python科学计算环境</a> <strong>作者</strong>：<a href="http://blog.chinaunix.net/uid/23100982.html" target="_blank">HyryStudio</a></p><br />
<div style="line-height: 1.3" id="detail" class="detail">
<p>
<p style="text-align: justify; line-height: 21px; background-color: rgb(255,255,255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif">在Ubuntu下安装Python模块通常可以使用apt-get和pip命令。apt-get命令是Ubuntu自带的包管理命令，而pip则是Python安装扩展模块的工具，通常pip会下载扩展模块的源代码并编译安装。</p>
<p style="text-align: justify; line-height: 21px; background-color: rgb(255,255,255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif">Ubuntu 12.04中缺省安装了Python2.7.3，首先通过下面的命令安装pip，pip是Python的一个安装和管理扩展库的工具。</p>
<div style="line-height: 21px; background-color: rgb(255,255,255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif">
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo apt-get install python-pip<br /></pre></div></div>
<p style="text-align: justify; line-height: 21px; background-color: rgb(255,255,255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif">安装Python开发环境，方便今后编译其他扩展库，占用空间92.8M：</p>
<div style="line-height: 21px; background-color: rgb(255,255,255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif">
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo apt-get install python-dev<br /></pre></div></div>
<div style="line-height: 21px; background-color: rgb(255,255,255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif" id="ipython">
<h1 style="line-height: 50px; font-family: Georgia, 'Times New Roman', Helvetica, Arial, sans-serif; color: rgb(24,24,24); font-weight: normal"><font size="4">IPython</font><a style="outline-width: 0px; display: inline; visibility: hidden; color: rgb(0,105,214)" title="Permalink to this headline" href="http://hyry.dip.jp/tech/slice/slice.html/24#ipython" target="_blank"></a></h1>
<p style="text-align: justify">为了安装最新版的IPython 0.13beta，需要下载IPython源代码，并执行安装命令。在IPython 0.13beta中提供了改进版本的IPython notebook。下面的命令首先安装版本管理软件git，然后通过git命令从IPython的开发代码库中下载最新版本的IPython源代码，并执行安装命令：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre><span style="color: rgb(0,112,32)">cd</span><br />sudo apt-get install git<br />git clone https://github.com/ipython/ipython.git<br /><span style="color: rgb(0,112,32)">cd </span>ipython<br />sudo python setup.py install<br /></pre></div></div>
<p style="text-align: justify">如果安装目前的最新稳定版本，可以输入:</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo apt-get install ipython<br /></pre></div></div>
<p style="text-align: justify">安装完毕之后，请输入ipython命令测试是否能正常启动。</p>
<p style="text-align: justify">为了让IPython notebook工作，还还需要安装tornado和pyzmq：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo pip install tornado<br />sudo apt-get install libzmq-dev<br />sudo pip install pyzmq<br />sudo pip install pygments<br /></pre></div></div>
<p style="text-align: justify">下面测试IPython：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre><span style="color: rgb(0,112,32)">cd</span><br />mkdir notebook<br /><span style="color: rgb(0,112,32)">cd </span>notebook<br />ipython notebook<br /></pre></div></div>
<p style="text-align: justify">为了在IPython中离线使用LaTeX数学公式，需要安装mathjax，首先输入下面的命令启动ipython notebook：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo ipython notebook<br /></pre></div></div>
<p style="text-align: justify">在IPython notebook界面中输入：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre><span style="color: rgb(0,112,32); font-weight: bold">from</span> <span style="color: rgb(14,132,181); font-weight: bold">IPython.external.mathjax</span> <span style="color: rgb(0,112,32); font-weight: bold">import</span> <span>install_mathjax</span><br /><span>install_mathjax</span><span>()</span><br /></pre></div></div></div>
<div style="line-height: 21px; background-color: rgb(255,255,255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif" id="numpy-scipymatplotlib">
<h1 style="line-height: 50px; font-family: Georgia, 'Times New Roman', Helvetica, Arial, sans-serif; color: rgb(24,24,24); font-weight: normal"><font size="4">NumPy，SciPy和matplotlib</font><a style="outline-width: 0px; display: inline; visibility: hidden; color: rgb(0,105,214)" title="Permalink to this headline" href="http://hyry.dip.jp/tech/slice/slice.html/24#numpy-scipymatplotlib" target="_blank"></a></h1>
<p style="text-align: justify">通过apt-get命令可以快速安装这三个库：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo apt-get install python-numpy<br />sudo apt-get install python-scipy<br />sudo apt-get install python-matplotlib<br /></pre></div></div>
<p style="text-align: justify">如果需要通过pip编译安装，可以先用apt-get命令安装所有编译所需的库：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo apt-get build-dep python-numpy<br />sudo apt-get build-dep python-scipy<br /></pre></div></div>
<p style="text-align: justify">然后通过pip命令安装：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo pip install numpy<br />sudo pip install scipy<br /></pre></div></div>
<div style="background-image: url(http://hyry.dip.jp/tech/static/_static/warning.png); border-bottom: rgb(119,119,119) 1px solid; border-left: rgb(119,119,119) 1px solid; padding-bottom: 4px; background-color: rgb(238,238,238); margin: 5px; min-height: 25px; padding-left: 40px; padding-right: 4px; background-position: 5px 50%; vertical-align: baseline; border-top: rgb(119,119,119) 1px solid; border-right: rgb(119,119,119) 1px solid; padding-top: 4px">通过build-dep会安装很多库，包括Python 3.2。</div></div>
<div style="line-height: 21px; background-color: rgb(255,255,255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif" id="pyqt4spyder">
<h1 style="line-height: 50px; font-family: Georgia, 'Times New Roman', Helvetica, Arial, sans-serif; color: rgb(24,24,24); font-weight: normal"><font size="4">PyQt4和Spyder</font><a style="outline-width: 0px; display: inline; visibility: hidden; color: rgb(0,105,214)" title="Permalink to this headline" href="http://hyry.dip.jp/tech/slice/slice.html/24#pyqt4spyder" target="_blank"></a></h1>
<p style="text-align: justify">下面的命令安装PyQt4，Qt界面设计器，PyQt4的开发工具以及文档：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo apt-get install python-qt4<br />sudo apt-get install qt4-designer<br />sudo apt-get install pyqt4-dev-tools<br />sudo apt-get install python-qt4-doc<br /></pre></div></div>
<p style="text-align: justify">安装完毕之后，文档位于：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>/usr/share/doc/python-qt4-doc<br /></pre></div></div>
<p style="text-align: justify">安装好PyQt4之后通过下面的命令安装Spyder：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo apt-get install spyder<br /></pre></div></div>
<p style="text-align: justify">由于Spyder经常更新，通过下面的命令可以安装最新版：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo pip install spyder --upgrade<br /></pre></div></div></div>
<div style="line-height: 21px; background-color: rgb(255,255,255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif" id="cythonswig">
<h1 style="line-height: 50px; font-family: Georgia, 'Times New Roman', Helvetica, Arial, sans-serif; color: rgb(24,24,24); font-weight: normal"><font size="4">cython和SWIG</font><a style="outline-width: 0px; display: inline; visibility: hidden; color: rgb(0,105,214)" title="Permalink to this headline" href="http://hyry.dip.jp/tech/slice/slice.html/24#cythonswig" target="_blank"></a></h1>
<p style="text-align: justify">Cython和SWIG是编写Python扩展模块的工具：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo pip install cython<br />sudo apt-get install swig<br /></pre></div></div>
<p style="text-align: justify">输入 <tt style="padding-bottom: 0px; border-right-width: 0px; background-color: rgb(236,240,243); margin: 0px; padding-left: 3px; padding-right: 3px; border-top-width: 0px; border-bottom-width: 0px; vertical-align: baseline; border-left-width: 0px; padding-top: 0px"><span>cython</span> <span>--version</span></tt> 和 <tt style="padding-bottom: 0px; border-right-width: 0px; background-color: rgb(236,240,243); margin: 0px; padding-left: 3px; padding-right: 3px; border-top-width: 0px; border-bottom-width: 0px; vertical-align: baseline; border-left-width: 0px; padding-top: 0px"><span>swig</span> <span>-version</span></tt> 查看版本。</p></div>
<div style="line-height: 21px; background-color: rgb(255,255,255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif" id="ets">
<h1 style="line-height: 50px; font-family: Georgia, 'Times New Roman', Helvetica, Arial, sans-serif; color: rgb(24,24,24); font-weight: normal"><font size="4">ETS</font><a style="outline-width: 0px; display: inline; visibility: hidden; color: rgb(0,105,214)" title="Permalink to this headline" href="http://hyry.dip.jp/tech/slice/slice.html/24#ets" target="_blank"></a></h1>
<p style="text-align: justify">ETS是enthought公司开发的一套科学计算软件包，其中的Mayavi通过VTK实现数据的三维可视化。</p>
<p style="text-align: justify">首先通过下面的命令安装编译ETS所需的库：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo apt-get install python-dev libxtst-dev scons python-vtk  pyqt4-dev-tools python2.7-wxgtk2.8 python-configobj<br />sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev<br /></pre></div></div>
<p style="text-align: justify">创建ets目录，并在此目录下下载ets.py，运行ets.py可以复制最新版的ETS源程序，并安装：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>mkdir ets<br /><span style="color: rgb(0,112,32)">cd </span>ets<br />wget https://github.com/enthought/ets/raw/master/ets.py<br />python ets.py clone<br />sudo python ets.py develop<br /><span style="color: rgb(64,128,144)">#sudo python ets.py install    或者运行install安装</span><br /></pre></div></div>
<p style="text-align: justify">如果一切正常，那么输入 <tt style="padding-bottom: 0px; border-right-width: 0px; background-color: rgb(236,240,243); margin: 0px; padding-left: 3px; padding-right: 3px; border-top-width: 0px; border-bottom-width: 0px; vertical-align: baseline; border-left-width: 0px; padding-top: 0px"><span>mayavi2</span></tt> 命令则会启动mayavi。</p></div>
<div style="line-height: 21px; background-color: rgb(255,255,255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif" id="opencv">
<h1 style="line-height: 50px; font-family: Georgia, 'Times New Roman', Helvetica, Arial, sans-serif; color: rgb(24,24,24); font-weight: normal"><font size="4">OpenCV</font><a style="outline-width: 0px; display: inline; visibility: hidden; color: rgb(0,105,214)" title="Permalink to this headline" href="http://hyry.dip.jp/tech/slice/slice.html/24#opencv" target="_blank"></a></h1>
<p style="text-align: justify">为了编译OpenCV需要下载cmake编译工具，和一些依赖库：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>sudo apt-get install build-essential<br />sudo apt-get install cmake<br />sudo apt-get install cmake-gui<br />sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev<br />sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libjasper-dev<br /></pre></div></div>
<p style="text-align: justify">然后从 <a style="outline-width: 0px; display: inline; color: rgb(0,105,214)" href="http://sourceforge.net/projects/opencvlibrary/" target="_blank">http://sourceforge.net/projects/opencvlibrary/</a> 下载最新版的OpenCV源代码，并解压。然后创建编译用的目录release，并启动cmake-gui:</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre>mkdir release<br />cmake-gui<br /></pre></div></div>
<p style="text-align: justify">在界面中选择OpenCV源代码的目录，和编译输出目录release，然后按Configure按钮，并根据需要设置各个编译选项，最后点Generate按钮，退出cmake-gui界面。进入编译路径，执行下面的命令：</p>
<div>
<div style="border-bottom: rgb(221,221,221) 1px solid; border-left: rgb(221,221,221) 1px solid; padding-bottom: 6px; background-color: rgb(247,255,232); margin: 0px; padding-left: 6px; padding-right: 6px; font-family: Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace; vertical-align: baseline; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; padding-top: 6px"><pre><span style="color: rgb(0,112,32)">cd </span>release<br />make<br />sudo make install<br /></pre></div></div>
<p style="text-align: justify">安装完毕之后，启动IPython，并输入 <tt style="padding-bottom: 0px; border-right-width: 0px; background-color: rgb(236,240,243); margin: 0px; padding-left: 3px; padding-right: 3px; border-top-width: 0px; border-bottom-width: 0px; vertical-align: baseline; border-left-width: 0px; padding-top: 0px"><span>import</span> <span>cv2</span></tt> 测试OpenCV是否能正常载入。</p></div>
<p>&nbsp;</p></div><img src ="http://www.cppblog.com/polly-yang/aggbug/191093.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/polly-yang/" target="_blank">polly</a> 2012-09-18 13:02 <a href="http://www.cppblog.com/polly-yang/archive/2012/09/18/191093.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Python登陆人人网并抓取新鲜事</title><link>http://www.cppblog.com/polly-yang/archive/2012/09/17/190975.html</link><dc:creator>polly</dc:creator><author>polly</author><pubDate>Mon, 17 Sep 2012 06:20:00 GMT</pubDate><guid>http://www.cppblog.com/polly-yang/archive/2012/09/17/190975.html</guid><wfw:comment>http://www.cppblog.com/polly-yang/comments/190975.html</wfw:comment><comments>http://www.cppblog.com/polly-yang/archive/2012/09/17/190975.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/polly-yang/comments/commentRss/190975.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/polly-yang/services/trackbacks/190975.html</trackback:ping><description><![CDATA[<p>&nbsp;</p>
<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><img id="Code_Closed_Image_141844" onclick="this.style.display='none'; Code_Closed_Text_141844.style.display='none'; Code_Open_Image_141844.style.display='inline'; Code_Open_Text_141844.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" width="11" height="16"><img style="display: none" id="Code_Open_Image_141844" onclick="this.style.display='none'; Code_Open_Text_141844.style.display='none'; Code_Closed_Image_141844.style.display='inline'; Code_Closed_Text_141844.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" height="16"><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Code_Closed_Text_141844"></span><span style="display: none" id="Code_Open_Text_141844"><br /><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080">&nbsp;1</span><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><span style="color: #0000ff">from</span><span style="color: #000000">&nbsp;sgmllib&nbsp;</span><span style="color: #0000ff">import</span><span style="color: #000000">&nbsp;SGMLParser<br /></span><span style="color: #008080">&nbsp;2</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000">&nbsp;sys,urllib2,urllib,cookielib<br /></span><span style="color: #008080">&nbsp;3</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #0000ff">class</span><span style="color: #000000">&nbsp;spider(SGMLParser):<br /></span><span style="color: #008080">&nbsp;4</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">def</span><span style="color: #000000">&nbsp;</span><span style="color: #800080">__init__</span><span style="color: #000000">(self,email,password):<br /></span><span style="color: #008080">&nbsp;5</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SGMLParser.</span><span style="color: #800080">__init__</span><span style="color: #000000">(self)<br /></span><span style="color: #008080">&nbsp;6</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.h3</span><span style="color: #000000">=</span><span style="color: #000000">False<br /></span><span style="color: #008080">&nbsp;7</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.h3_is_ready</span><span style="color: #000000">=</span><span style="color: #000000">False<br /></span><span style="color: #008080">&nbsp;8</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.div</span><span style="color: #000000">=</span><span style="color: #000000">False<br /></span><span style="color: #008080">&nbsp;9</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.h3_and_div</span><span style="color: #000000">=</span><span style="color: #000000">False<br /></span><span style="color: #008080">10</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.a</span><span style="color: #000000">=</span><span style="color: #000000">False<br /></span><span style="color: #008080">11</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.depth</span><span style="color: #000000">=</span><span style="color: #000000">0<br /></span><span style="color: #008080">12</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.names</span><span style="color: #000000">=</span><span style="color: #800000">""</span><span style="color: #000000"><br /></span><span style="color: #008080">13</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.dic</span><span style="color: #000000">=</span><span style="color: #000000">{}&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #008080">14</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #008080">15</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.email</span><span style="color: #000000">=</span><span style="color: #000000">email<br /></span><span style="color: #008080">16</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.password</span><span style="color: #000000">=</span><span style="color: #000000">password<br /></span><span style="color: #008080">17</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.domain</span><span style="color: #000000">=</span><span style="color: #800000">'</span><span style="color: #800000">renren.com</span><span style="color: #800000">'</span><span style="color: #000000"><br /></span><span style="color: #008080">18</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">try</span><span style="color: #000000">:<br /></span><span style="color: #008080">19</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie</span><span style="color: #000000">=</span><span style="color: #000000">cookielib.CookieJar()<br /></span><span style="color: #008080">20</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookieProc</span><span style="color: #000000">=</span><span style="color: #000000">urllib2.HTTPCookieProcessor(cookie)<br /></span><span style="color: #008080">21</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">except</span><span style="color: #000000">:<br /></span><span style="color: #008080">22</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">raise</span><span style="color: #000000"><br /></span><span style="color: #008080">23</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">else</span><span style="color: #000000">:<br /></span><span style="color: #008080">24</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opener</span><span style="color: #000000">=</span><span style="color: #000000">urllib2.build_opener(cookieProc)<br /></span><span style="color: #008080">25</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;urllib2.install_opener(opener)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #008080">26</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><br /></span><span style="color: #008080">27</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">def</span><span style="color: #000000">&nbsp;login(self):<br /></span><span style="color: #008080">28</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url</span><span style="color: #000000">=</span><span style="color: #800000">'</span><span style="color: #800000">http://www.renren.com/PLogin.do</span><span style="color: #800000">'</span><span style="color: #000000"><br /></span><span style="color: #008080">29</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;postdata</span><span style="color: #000000">=</span><span style="color: #000000">{<br /></span><span style="color: #008080">30</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800000">'</span><span style="color: #800000">email</span><span style="color: #800000">'</span><span style="color: #000000">:self.email,<br /></span><span style="color: #008080">31</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800000">'</span><span style="color: #800000">password</span><span style="color: #800000">'</span><span style="color: #000000">:self.password,<br /></span><span style="color: #008080">32</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800000">'</span><span style="color: #800000">domain</span><span style="color: #800000">'</span><span style="color: #000000">:self.domain&nbsp;&nbsp;<br /></span><span style="color: #008080">33</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /></span><span style="color: #008080">34</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;req</span><span style="color: #000000">=</span><span style="color: #000000">urllib2.Request(<br /></span><span style="color: #008080">35</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&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;&nbsp;url,<br /></span><span style="color: #008080">36</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&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;&nbsp;urllib.urlencode(postdata)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #008080">37</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&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;&nbsp;)<br /></span><span style="color: #008080">38</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #008080">39</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.file</span><span style="color: #000000">=</span><span style="color: #000000">urllib2.urlopen(req).read()<br /></span><span style="color: #008080">40</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">#</span><span style="color: #008000">print&nbsp;self.file</span><span style="color: #008000"><br /></span><span style="color: #008080">41</span><span style="color: #008000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">def</span><span style="color: #000000">&nbsp;start_h3(self,attrs):<br /></span><span style="color: #008080">42</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.h3&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;True<br /></span><span style="color: #008080">43</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">def</span><span style="color: #000000">&nbsp;end_h3(self):<br /></span><span style="color: #008080">44</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.h3</span><span style="color: #000000">=</span><span style="color: #000000">False<br /></span><span style="color: #008080">45</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.h3_is_ready</span><span style="color: #000000">=</span><span style="color: #000000">True<br /></span><span style="color: #008080">46</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #008080">47</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">def</span><span style="color: #000000">&nbsp;start_a(self,attrs):<br /></span><span style="color: #008080">48</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;self.h3&nbsp;</span><span style="color: #0000ff">or</span><span style="color: #000000">&nbsp;self.div:<br /></span><span style="color: #008080">49</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.a</span><span style="color: #000000">=</span><span style="color: #000000">True<br /></span><span style="color: #008080">50</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">def</span><span style="color: #000000">&nbsp;end_a(self):<br /></span><span style="color: #008080">51</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.a</span><span style="color: #000000">=</span><span style="color: #000000">False<br /></span><span style="color: #008080">52</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #008080">53</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">def</span><span style="color: #000000">&nbsp;start_div(self,attrs):<br /></span><span style="color: #008080">54</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;self.h3_is_ready&nbsp;</span><span style="color: #000000">==</span><span style="color: #000000">&nbsp;False:<br /></span><span style="color: #008080">55</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000"><br /></span><span style="color: #008080">56</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;self.div</span><span style="color: #000000">==</span><span style="color: #000000">True:<br /></span><span style="color: #008080">57</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.depth&nbsp;</span><span style="color: #000000">+=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">1</span><span style="color: #000000"><br /></span><span style="color: #008080">58</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #008080">59</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">&nbsp;k,v&nbsp;</span><span style="color: #0000ff">in</span><span style="color: #000000">&nbsp;attrs:<br /></span><span style="color: #008080">60</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;k&nbsp;</span><span style="color: #000000">==</span><span style="color: #000000">&nbsp;</span><span style="color: #800000">'</span><span style="color: #800000">class</span><span style="color: #800000">'</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">and</span><span style="color: #000000">&nbsp;v&nbsp;</span><span style="color: #000000">==</span><span style="color: #000000">&nbsp;</span><span style="color: #800000">'</span><span style="color: #800000">content</span><span style="color: #800000">'</span><span style="color: #000000">:<br /></span><span style="color: #008080">61</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.div</span><span style="color: #000000">=</span><span style="color: #000000">True;<br /></span><span style="color: #008080">62</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.h3_and_div</span><span style="color: #000000">=</span><span style="color: #000000">True&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">#</span><span style="color: #008000">h3&nbsp;and&nbsp;div&nbsp;is&nbsp;connected</span><span style="color: #008000"><br /></span><span style="color: #008080">63</span><span style="color: #008000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">def</span><span style="color: #000000">&nbsp;end_div(self):<br /></span><span style="color: #008080">64</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;self.depth&nbsp;</span><span style="color: #000000">==</span><span style="color: #000000">&nbsp;0:<br /></span><span style="color: #008080">65</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.div</span><span style="color: #000000">=</span><span style="color: #000000">False<br /></span><span style="color: #008080">66</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.h3_and_div</span><span style="color: #000000">=</span><span style="color: #000000">False<br /></span><span style="color: #008080">67</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.h3_is_ready</span><span style="color: #000000">=</span><span style="color: #000000">False<br /></span><span style="color: #008080">68</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.names</span><span style="color: #000000">=</span><span style="color: #800000">""</span><span style="color: #000000"><br /></span><span style="color: #008080">69</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;self.div&nbsp;</span><span style="color: #000000">==</span><span style="color: #000000">&nbsp;True:<br /></span><span style="color: #008080">70</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.depth</span><span style="color: #000000">-=</span><span style="color: #000000">1</span><span style="color: #000000"><br /></span><span style="color: #008080">71</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">def</span><span style="color: #000000">&nbsp;handle_data(self,text):<br /></span><span style="color: #008080">72</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">#</span><span style="color: #008000">record&nbsp;the&nbsp;name</span><span style="color: #008000"><br /></span><span style="color: #008080">73</span><span style="color: #008000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;self.h3&nbsp;</span><span style="color: #0000ff">and</span><span style="color: #000000">&nbsp;self.a:<br /></span><span style="color: #008080">74</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.names</span><span style="color: #000000">+=</span><span style="color: #000000">text<br /></span><span style="color: #008080">75</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">#</span><span style="color: #008000">record&nbsp;says</span><span style="color: #008000"><br /></span><span style="color: #008080">76</span><span style="color: #008000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;self.h3&nbsp;</span><span style="color: #0000ff">and</span><span style="color: #000000">&nbsp;(self.a</span><span style="color: #000000">==</span><span style="color: #000000">False):<br /></span><span style="color: #008080">77</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">not</span><span style="color: #000000">&nbsp;text:</span><span style="color: #0000ff">pass</span><span style="color: #000000"><br /></span><span style="color: #008080">78</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">else</span><span style="color: #000000">:&nbsp;self.dic.setdefault(self.names,[]).append(text)<br /></span><span style="color: #008080">79</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;<br /></span><span style="color: #008080">80</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;self.h3_and_div:<br /></span><span style="color: #008080">81</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.dic.setdefault(self.names,[]).append(text)<br /></span><span style="color: #008080">82</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #008080">83</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">def</span><span style="color: #000000">&nbsp;show(self):<br /></span><span style="color: #008080">84</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;sys.getfilesystemencoding()<br /></span><span style="color: #008080">85</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">&nbsp;key&nbsp;</span><span style="color: #0000ff">in</span><span style="color: #000000">&nbsp;self.dic:<br /></span><span style="color: #008080">86</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">print</span><span style="color: #000000">&nbsp;(&nbsp;(</span><span style="color: #800000">''</span><span style="color: #000000">.join(key)).replace(</span><span style="color: #800000">'</span><span style="color: #800000">&nbsp;</span><span style="color: #800000">'</span><span style="color: #000000">,</span><span style="color: #800000">''</span><span style="color: #000000">)).decode(</span><span style="color: #800000">'</span><span style="color: #800000">utf-8</span><span style="color: #800000">'</span><span style="color: #000000">).encode(type),&nbsp;\<br /></span><span style="color: #008080">87</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&nbsp;(</span><span style="color: #800000">''</span><span style="color: #000000">.join(self.dic[key])).replace(</span><span style="color: #800000">'</span><span style="color: #800000">&nbsp;</span><span style="color: #800000">'</span><span style="color: #000000">,</span><span style="color: #800000">''</span><span style="color: #000000">)).decode(</span><span style="color: #800000">'</span><span style="color: #800000">utf-8</span><span style="color: #800000">'</span><span style="color: #000000">).encode(type)<br /></span><span style="color: #008080">88</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><br /></span><span style="color: #008080">89</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />&nbsp;<br /></span><span style="color: #008080">90</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><br /></span><span style="color: #008080">91</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><br /></span><span style="color: #008080">92</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />renrenspider</span><span style="color: #000000">=</span><span style="color: #000000">spider(</span><span style="color: #800000">'</span><span style="color: #800000">your&nbsp;email</span><span style="color: #800000">'</span><span style="color: #000000">,</span><span style="color: #800000">'</span><span style="color: #800000">your&nbsp;password</span><span style="color: #800000">'</span><span style="color: #000000">)<br /></span><span style="color: #008080">93</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />renrenspider.login()<br /></span><span style="color: #008080">94</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />renrenspider.feed(renrenspider.file)<br /></span><span style="color: #008080">95</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />renrenspider.show()<br /></span><span style="color: #008080">96</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span></span></div>
<p>&nbsp;</p> <img src ="http://www.cppblog.com/polly-yang/aggbug/190975.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/polly-yang/" target="_blank">polly</a> 2012-09-17 14:20 <a href="http://www.cppblog.com/polly-yang/archive/2012/09/17/190975.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>美国航空母舰在 Google Earth上的坐标</title><link>http://www.cppblog.com/polly-yang/archive/2012/08/19/187652.html</link><dc:creator>polly</dc:creator><author>polly</author><pubDate>Sun, 19 Aug 2012 02:34:00 GMT</pubDate><guid>http://www.cppblog.com/polly-yang/archive/2012/08/19/187652.html</guid><wfw:comment>http://www.cppblog.com/polly-yang/comments/187652.html</wfw:comment><comments>http://www.cppblog.com/polly-yang/archive/2012/08/19/187652.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/polly-yang/comments/commentRss/187652.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/polly-yang/services/trackbacks/187652.html</trackback:ping><description><![CDATA[<h2 class="post-title">Google Earth坐标－美国航空母舰坐标</h2>
<div class="post-body">
<p>　　这里罗列了已经发现的所有美国现役和退役的航空母舰。其中包括：</p>
<p>　　&#8220;小鹰&#8221;号 CV63　 35&#176;17'29.66"N,139&#176;39'43.67"E</p>
<p>　　&#8220;肯尼迪&#8221;号 CVN67　 30&#176;23'50.91"N, 81&#176;24'14.86"W</p>
<p>　　&#8220;尼米兹&#8221;号 CVN68　 32&#176;42'47.88"N,117&#176;11'22.49"W</p>
<p>　　&#8220;艾森豪威尔&#8221;号 CVN69　 36&#176;57'27.13"N, 76&#176;19'46.35"W</p>
<p>　　&#8220;林肯&#8221; 号 CVN72 　 47&#176;58'53.54"N,122&#176;13'42.94"W</p>
<p>　　&#8220;华盛顿&#8221;号 CVN73　 36&#176;57'32.90"N, 76&#176;19'45.10"W</p>
<p>　　&#8220;杜鲁门&#8221;号 CVN75　　36&#176;48'53.25"N,76&#176;17'49.29"W</p>
<p>　　&#8220;无畏&#8221;号 CV-11　　 40&#176;45'53.88"N,74&#176; 0'4.22"W</p>
<p>　　&#8220;莱克星顿&#8221;号 CV-2　　27&#176;48'54.13"N,97&#176;23'19.65"W</p>
<p>　　&#8220;星座&#8221;号 47&#176;33'11.30"N,122&#176;39'17.24"W</p>
<p>　　&#8220;独立&#8221;号 47&#176;33'7.53"N,122&#176;39'30.13"W</p>
<p>　　&#8220;游骑兵&#8221;号 47&#176;33'10.63"N,122&#176;39'9.53"W</p>
<p>　　&#8220;佛瑞斯特&#8221;号和&#8220;萨拉托加&#8221;号　41&#176;31'39.59"N,71&#176;18'58.70"W</p>
<p>　　&#8220;美利坚&#8221;号　39&#176;53'6.36"N,75&#176;10'45.55"W</p></div><img src ="http://www.cppblog.com/polly-yang/aggbug/187652.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/polly-yang/" target="_blank">polly</a> 2012-08-19 10:34 <a href="http://www.cppblog.com/polly-yang/archive/2012/08/19/187652.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>美国海军航空母舰列表</title><link>http://www.cppblog.com/polly-yang/archive/2012/08/19/187651.html</link><dc:creator>polly</dc:creator><author>polly</author><pubDate>Sun, 19 Aug 2012 02:33:00 GMT</pubDate><guid>http://www.cppblog.com/polly-yang/archive/2012/08/19/187651.html</guid><wfw:comment>http://www.cppblog.com/polly-yang/comments/187651.html</wfw:comment><comments>http://www.cppblog.com/polly-yang/archive/2012/08/19/187651.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/polly-yang/comments/commentRss/187651.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/polly-yang/services/trackbacks/187651.html</trackback:ping><description><![CDATA[<p>本列表收录了<strong><a title="美国海军" href="http://zh.wikipedia.org/wiki/%E7%BE%8E%E5%9C%8B%E6%B5%B7%E8%BB%8D">美国海军</a></strong>己退役或现役中的<strong><a class="mw-redirect" title="航空母舰" href="http://zh.wikipedia.org/wiki/%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">航空母舰</a></strong>，包括<a class="mw-redirect" title="美国海军舰体编号" href="http://zh.wikipedia.org/wiki/%E7%BE%8E%E5%9C%8B%E6%B5%B7%E8%BB%8D%E8%89%A6%E9%AB%94%E7%B7%A8%E8%99%9F">船级</a>属于CV、CVA、CVB、CVL或CVN的全部舰只。编号在CVA-58之后的都属于<a title="超级航空母舰" href="http://zh.wikipedia.org/wiki/%E8%B6%85%E7%B4%9A%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">超级航空母舰</a>（<a title="排水量" href="http://zh.wikipedia.org/wiki/%E6%8E%92%E6%B0%B4%E9%87%8F">排水量</a>超过75,000吨），CVN-65和CVN-68以后的都属于<a class="new" title="核动力航空母舰（页面不存在）" href="http://zh.wikipedia.org/w/index.php?title=%E6%A0%B8%E5%8B%95%E5%8A%9B%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6&amp;action=edit&amp;redlink=1">核动力航空母舰</a>。</p>
<p>排水量较小的<a class="mw-redirect" title="护卫航空母舰" href="http://zh.wikipedia.org/wiki/%E8%AD%B7%E8%A1%9B%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">护航航空母舰</a>（Escort Aircraft Carriers，CVE），则另行收录于<a title="美国海军护航航空母舰列表" href="http://zh.wikipedia.org/wiki/%E7%BE%8E%E5%9C%8B%E6%B5%B7%E8%BB%8D%E8%AD%B7%E8%88%AA%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6%E5%88%97%E8%A1%A8">美国海军护航航空母舰列表</a>中。</p>
<table class="wikitable">
<tbody>
<tr>
<th>船舰编号</th>
<th colspan="2" align="center">舰名</th>
<th align="center">级别</th>
<th align="center">附注</th></tr>
<tr>
<td bgcolor="#f0f0f0">CV-1</td>
<td align="center">Langley</td>
<td align="center"><a title="兰利号航空母舰 (CV-1)" href="http://zh.wikipedia.org/wiki/%E8%98%AD%E5%88%A9%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-1)">兰利号</a></td>
<td bgcolor="#f0f0f0" align="center"></td>
<td align="center">以运煤舰朱比特号（USS Jupiter）改造而成</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-2</td>
<td align="center">Lexington</td>
<td align="center"><a title="列克星敦号航空母舰 (CV-2)" href="http://zh.wikipedia.org/wiki/%E5%88%97%E6%98%9F%E9%A0%93%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-2)">列克星敦号</a></td>
<td bgcolor="#f0f0f0" align="center"><a title="列克星敦级航空母舰" href="http://zh.wikipedia.org/wiki/%E5%88%97%E5%85%8B%E6%98%9F%E6%95%A6%E7%BA%A7%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%88%B0">列克星敦级</a></td>
<td align="center"><a title="1942年" href="http://zh.wikipedia.org/wiki/1942%E5%B9%B4">1942年</a><a title="5月8日" href="http://zh.wikipedia.org/wiki/5%E6%9C%888%E6%97%A5">5月8日</a><a title="珊瑚海海战" href="http://zh.wikipedia.org/wiki/%E7%8F%8A%E7%91%9A%E6%B5%B7%E6%B5%B7%E6%88%98">珊瑚海海战</a>受到重创沉没</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-3</td>
<td align="center">Saratoga</td>
<td align="center"><a title="萨拉托加号航空母舰 (CV-3)" href="http://zh.wikipedia.org/wiki/%E8%96%A9%E6%8B%89%E6%89%98%E5%8A%A0%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-3)">萨拉托加号</a></td>
<td bgcolor="#f0f0f0" align="center">列克星敦级</td>
<td align="center"><a title="1946年" href="http://zh.wikipedia.org/wiki/1946%E5%B9%B4">1946年</a><a title="7月25日" href="http://zh.wikipedia.org/wiki/7%E6%9C%8825%E6%97%A5">7月25日</a>在<a title="比基尼环礁" href="http://zh.wikipedia.org/wiki/%E6%AF%94%E5%9F%BA%E5%B0%BC%E7%8E%AF%E7%A4%81">比基尼环礁</a>的核子武器试验中沉没</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-4</td>
<td align="center">Ranger</td>
<td align="center"><a title="突击者号航空母舰 (CV-4)" href="http://zh.wikipedia.org/wiki/%E9%81%8A%E9%A8%8E%E5%85%B5%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-4)">突击者号</a></td>
<td bgcolor="#f0f0f0" align="center">突击者级</td>
<td align="center"><a title="1946年" href="http://zh.wikipedia.org/wiki/1946%E5%B9%B4">1946年</a><a title="10月18日" href="http://zh.wikipedia.org/wiki/10%E6%9C%8818%E6%97%A5">10月18日</a>退役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-5</td>
<td align="center">Yorktown</td>
<td align="center"><a title="约克城号航空母舰 (CV-5)" href="http://zh.wikipedia.org/wiki/%E7%B4%84%E5%85%8B%E9%8E%AE%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-5)">约克城号</a></td>
<td bgcolor="#f0f0f0" align="center"><a title="约克城级航空母舰" href="http://zh.wikipedia.org/wiki/%E7%BA%A6%E5%85%8B%E5%9F%8E%E7%BA%A7%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%88%B0">约克城级</a></td>
<td align="center"><a title="1942年" href="http://zh.wikipedia.org/wiki/1942%E5%B9%B4">1942年</a><a title="6月7日" href="http://zh.wikipedia.org/wiki/6%E6%9C%887%E6%97%A5">6月7日</a>在<a title="中途岛海战" href="http://zh.wikipedia.org/wiki/%E4%B8%AD%E9%80%94%E5%B2%9B%E6%B5%B7%E6%88%98">中途岛海战</a>中沉没</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-6</td>
<td align="center">Enterprise</td>
<td align="center"><a title="企业号航空母舰 (CV-6)" href="http://zh.wikipedia.org/wiki/%E4%BC%81%E6%A5%AD%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-6)">企业号</a></td>
<td bgcolor="#f0f0f0" align="center">约克城级</td>
<td align="center"><a title="1947年" href="http://zh.wikipedia.org/wiki/1947%E5%B9%B4">1947年</a><a title="2月17日" href="http://zh.wikipedia.org/wiki/2%E6%9C%8817%E6%97%A5">2月17日</a>退役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-7</td>
<td align="center">Wasp</td>
<td align="center"><a title="胡蜂号航空母舰 (CV-7)" href="http://zh.wikipedia.org/wiki/%E8%83%A1%E8%9C%82%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-7)">胡蜂号</a></td>
<td bgcolor="#f0f0f0" align="center"><a class="mw-redirect" title="胡蜂级航空母舰" href="http://zh.wikipedia.org/wiki/%E8%83%A1%E8%9C%82%E7%B4%9A%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">胡蜂级</a></td>
<td align="center"><a title="1942年" href="http://zh.wikipedia.org/wiki/1942%E5%B9%B4">1942年</a><a title="9月15日" href="http://zh.wikipedia.org/wiki/9%E6%9C%8815%E6%97%A5">9月15日</a>被<a class="mw-redirect" title="日军" href="http://zh.wikipedia.org/wiki/%E6%97%A5%E5%86%9B">日军</a><a class="mw-redirect" title="潜艇" href="http://zh.wikipedia.org/wiki/%E6%BD%9C%E8%89%87">潜艇</a>击沉</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-8</td>
<td align="center">Hornet</td>
<td align="center"><a title="大黄蜂号航空母舰 (CV-8)" href="http://zh.wikipedia.org/wiki/%E5%A4%A7%E9%BB%83%E8%9C%82%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-8)">大黄蜂号</a></td>
<td bgcolor="#f0f0f0" align="center">约克城级</td>
<td align="center"><a title="1942年" href="http://zh.wikipedia.org/wiki/1942%E5%B9%B4">1942年</a><a title="10月27日" href="http://zh.wikipedia.org/wiki/10%E6%9C%8827%E6%97%A5">10月27日</a>在<a title="圣克鲁斯群岛战役" href="http://zh.wikipedia.org/wiki/%E8%81%96%E5%85%8B%E9%AD%AF%E6%96%AF%E7%BE%A4%E5%B3%B6%E6%88%B0%E5%BD%B9">圣克鲁斯群岛战役</a>中受重创沉没</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-9</td>
<td align="center">Essex</td>
<td align="center"><a title="埃塞克斯号航空母舰" href="http://zh.wikipedia.org/wiki/%E8%89%BE%E5%A1%9E%E5%85%8B%E6%96%AF%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">埃塞克斯号</a></td>
<td bgcolor="#f0f0f0" align="center"><a title="埃塞克斯级航空母舰" href="http://zh.wikipedia.org/wiki/%E8%89%BE%E5%A1%9E%E5%85%8B%E6%96%AF%E7%B4%9A%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">埃塞克斯级</a></td>
<td align="center"><a title="1969年" href="http://zh.wikipedia.org/wiki/1969%E5%B9%B4">1969年</a><a title="6月30日" href="http://zh.wikipedia.org/wiki/6%E6%9C%8830%E6%97%A5">6月30日</a>退役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-10</td>
<td align="center">Yorktown</td>
<td align="center"><a title="约克城号航空母舰 (CV-10)" href="http://zh.wikipedia.org/wiki/%E7%B4%84%E5%85%8B%E9%8E%AE%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-10)">约克城号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center"><a title="1970年" href="http://zh.wikipedia.org/wiki/1970%E5%B9%B4">1970年</a><a title="6月27日" href="http://zh.wikipedia.org/wiki/6%E6%9C%8827%E6%97%A5">6月27日</a>退役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-11</td>
<td align="center">Intrepid</td>
<td align="center"><a title="无畏号航空母舰" href="http://zh.wikipedia.org/wiki/%E7%84%A1%E7%95%8F%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">无畏号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center"><a title="1974年" href="http://zh.wikipedia.org/wiki/1974%E5%B9%B4">1974年</a><a title="3月15日" href="http://zh.wikipedia.org/wiki/3%E6%9C%8815%E6%97%A5">3月15日</a>退役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-12</td>
<td align="center">Hornet</td>
<td align="center"><a title="大黄蜂号航空母舰 (CV-12)" href="http://zh.wikipedia.org/wiki/%E5%A4%A7%E9%BB%83%E8%9C%82%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-12)">大黄蜂号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center"><a title="1970年" href="http://zh.wikipedia.org/wiki/1970%E5%B9%B4">1970年</a><a title="6月24日" href="http://zh.wikipedia.org/wiki/6%E6%9C%8824%E6%97%A5">6月24日</a>退役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-13</td>
<td align="center">Franklin</td>
<td align="center"><a title="富兰克林号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%AF%8C%E8%98%AD%E5%85%8B%E6%9E%97%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">富兰克林号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center"><a title="1947年" href="http://zh.wikipedia.org/wiki/1947%E5%B9%B4">1947年</a><a title="2月17日" href="http://zh.wikipedia.org/wiki/2%E6%9C%8817%E6%97%A5">2月17日</a>退役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-14</td>
<td align="center">Ticonderoga</td>
<td align="center"><a title="提康德罗加号航空母舰" href="http://zh.wikipedia.org/wiki/%E6%8F%90%E5%BA%B7%E5%BE%B7%E7%BE%85%E5%8A%A0%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">提康德罗加号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-15</td>
<td align="center">Randolph</td>
<td align="center"><a title="伦道夫号航空母舰" href="http://zh.wikipedia.org/wiki/%E8%98%AD%E9%81%93%E5%A4%AB%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">伦道夫号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-16</td>
<td align="center">Lexington</td>
<td align="center"><a title="列克星敦号航空母舰 (CV-16)" href="http://zh.wikipedia.org/wiki/%E5%88%97%E6%98%9F%E9%A0%93%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-16)">列克星敦号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center"><a title="1991年" href="http://zh.wikipedia.org/wiki/1991%E5%B9%B4">1991年</a><a title="11月8日" href="http://zh.wikipedia.org/wiki/11%E6%9C%888%E6%97%A5">11月8日</a>退役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-17</td>
<td align="center">Bunker Hill</td>
<td align="center"><a title="邦克山号航空母舰" href="http://zh.wikipedia.org/wiki/%E7%A2%89%E5%A0%A1%E5%B1%B1%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">邦克山号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center"><a title="1947年" href="http://zh.wikipedia.org/wiki/1947%E5%B9%B4">1947年</a><a title="1月9日" href="http://zh.wikipedia.org/wiki/1%E6%9C%889%E6%97%A5">1月9日</a>退役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-18</td>
<td align="center">Wasp</td>
<td align="center"><a title="胡蜂号航空母舰 (CV-18)" href="http://zh.wikipedia.org/wiki/%E8%83%A1%E8%9C%82%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-18)">胡蜂号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center"><a title="1972年" href="http://zh.wikipedia.org/wiki/1972%E5%B9%B4">1972年</a><a title="7月1日" href="http://zh.wikipedia.org/wiki/7%E6%9C%881%E6%97%A5">7月1日</a>退役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-19</td>
<td align="center">Hancock</td>
<td align="center"><a title="汉考克号航空母舰" href="http://zh.wikipedia.org/wiki/%E6%BC%A2%E8%80%83%E5%85%8B%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">汉考克号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-20</td>
<td align="center">Bennington</td>
<td align="center"><a title="本宁顿号航空母舰" href="http://zh.wikipedia.org/wiki/%E7%8F%AD%E5%AF%A7%E9%A0%93%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">本宁顿号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center"><a title="1970年" href="http://zh.wikipedia.org/wiki/1970%E5%B9%B4">1970年</a><a title="1月15日" href="http://zh.wikipedia.org/wiki/1%E6%9C%8815%E6%97%A5">1月15日</a>退役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-21</td>
<td align="center">Boxer</td>
<td align="center"><a title="拳师号航空母舰" href="http://zh.wikipedia.org/wiki/%E6%8B%B3%E5%B8%AB%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">拳师号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVL-22</td>
<td align="center">Independence</td>
<td align="center"><a title="独立号航空母舰 (CVL-22)" href="http://zh.wikipedia.org/wiki/%E7%8D%A8%E7%AB%8B%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CVL-22)">独立号</a></td>
<td bgcolor="#f0f0f0" align="center"><a title="独立级航空母舰" href="http://zh.wikipedia.org/wiki/%E7%8D%A8%E7%AB%8B%E7%B4%9A%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">独立级</a></td>
<td align="center">自&#8220;克里夫兰级轻巡洋舰&#8221;改装而成</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVL-23</td>
<td align="center">Princeton</td>
<td align="center"><a title="普林斯顿号航空母舰 (CVL-23)" href="http://zh.wikipedia.org/wiki/%E6%99%AE%E6%9E%97%E6%96%AF%E9%A0%93%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CVL-23)">普林斯顿号</a></td>
<td bgcolor="#f0f0f0" align="center">独立级</td>
<td align="center">自&#8220;克里夫兰级轻巡洋舰&#8221;改装而成</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVL-24</td>
<td align="center">Belleau Wood</td>
<td align="center"><a class="mw-redirect" title="贝劳森林号航空母舰" href="http://zh.wikipedia.org/wiki/%E8%B2%9D%E5%8B%92%E6%A3%AE%E6%9E%97%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">贝劳森林号</a></td>
<td bgcolor="#f0f0f0" align="center">独立级</td>
<td align="center">自&#8220;克里夫兰级轻巡洋舰&#8221;改装而成</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVL-25</td>
<td align="center">Cowpens</td>
<td align="center"><a title="科本斯号航空母舰" href="http://zh.wikipedia.org/wiki/%E7%A7%91%E6%9C%AC%E6%96%AF%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">科本斯号</a></td>
<td bgcolor="#f0f0f0" align="center">独立级</td>
<td align="center">自&#8220;克里夫兰级轻巡洋舰&#8221;改装而成</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVL-26</td>
<td align="center">Monterey</td>
<td align="center"><a title="蒙特利号航空母舰" href="http://zh.wikipedia.org/wiki/%E8%92%99%E7%89%B9%E5%88%A9%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">蒙特利号</a></td>
<td bgcolor="#f0f0f0" align="center">独立级</td>
<td align="center">自&#8220;克里夫兰级轻巡洋舰&#8221;改装而成</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVL-27</td>
<td align="center">Langley</td>
<td align="center"><a class="mw-redirect" title="兰利号 (CVL-27)航空母舰" href="http://zh.wikipedia.org/wiki/%E8%98%AD%E5%88%A9%E8%99%9F_(CVL-27)%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">兰利号</a></td>
<td bgcolor="#f0f0f0" align="center">独立级</td>
<td align="center">自&#8220;克里夫兰级轻巡洋舰&#8221;改装而成</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVL-28</td>
<td align="center">Cabot</td>
<td align="center"><a title="卡伯特号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%8D%A1%E4%BC%AF%E7%89%B9%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">卡伯特号</a></td>
<td bgcolor="#f0f0f0" align="center">独立级</td>
<td align="center">自&#8220;克里夫兰级轻巡洋舰&#8221;改装而成</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVL-29</td>
<td align="center">Bataan</td>
<td align="center"><a title="巴丹号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%B7%B4%E4%B8%B9%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">巴丹号</a></td>
<td bgcolor="#f0f0f0" align="center">独立级</td>
<td align="center">自&#8220;克里夫兰级轻巡洋舰&#8221;改装而成</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVL-30</td>
<td align="center">San Jacinto</td>
<td align="center"><a title="圣哈辛托号航空母舰" href="http://zh.wikipedia.org/wiki/%E8%81%96%E5%93%88%E8%BE%9B%E6%89%98%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">圣哈辛托号</a></td>
<td bgcolor="#f0f0f0" align="center">独立级</td>
<td align="center">自&#8220;克里夫兰级轻巡洋舰&#8221;改装而成</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-31</td>
<td align="center">Bon Homme Richard</td>
<td align="center"><a title="好人理查德号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%A5%BD%E4%BA%BA%E7%90%86%E6%9F%A5%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">好人理查德号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center"><a title="1971年" href="http://zh.wikipedia.org/wiki/1971%E5%B9%B4">1971年</a><a title="7月2日" href="http://zh.wikipedia.org/wiki/7%E6%9C%882%E6%97%A5">7月2日</a>退役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-32</td>
<td align="center">Leyte</td>
<td align="center"><a title="莱特号航空母舰" href="http://zh.wikipedia.org/wiki/%E9%9B%B7%E4%BC%8A%E6%B3%B0%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">莱特号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-33</td>
<td align="center">Kearsarge</td>
<td align="center"><a title="奇沙治号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%A5%87%E7%88%BE%E6%B2%99%E6%B2%BB%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">奇沙治号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-34</td>
<td align="center">Oriskany</td>
<td align="center"><a title="奥里斯卡尼号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%A5%A7%E9%87%8C%E6%96%AF%E5%8D%A1%E5%B0%BC%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">奥里斯卡尼号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0" height="12">CV-35</td>
<td height="12" align="center">Reprisal</td>
<td height="12" align="center"><a title="复仇号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%BE%A9%E4%BB%87%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">复仇号</a></td>
<td bgcolor="#f0f0f0" height="12" align="center">埃塞克斯级</td>
<td align="center">建造中途取消</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-36</td>
<td align="center">Antietam</td>
<td align="center"><a title="安提坦号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%AE%89%E6%8F%90%E9%A0%93%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">安提坦号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-37</td>
<td align="center">Princeton</td>
<td align="center"><a title="普林斯顿号航空母舰 (CV-37)" href="http://zh.wikipedia.org/wiki/%E6%99%AE%E6%9E%97%E6%96%AF%E9%A0%93%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-37)">普林斯顿号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-38</td>
<td align="center">Shangri-la</td>
<td align="center"><a title="香格里拉号航空母舰" href="http://zh.wikipedia.org/wiki/%E9%A6%99%E6%A0%BC%E9%87%8C%E6%8B%89%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">香格里拉号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-39</td>
<td align="center">Lake Champlain</td>
<td align="center"><a title="尚普兰湖号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%B0%9A%E6%99%AE%E8%98%AD%E6%B9%96%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">尚普兰湖号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-40</td>
<td align="center">Tarawa</td>
<td align="center"><a title="塔拉瓦号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%A1%94%E6%8B%89%E7%93%A6%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">塔拉瓦号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVB-41</td>
<td align="center">Midway</td>
<td align="center"><a title="中途岛号航空母舰" href="http://zh.wikipedia.org/wiki/%E4%B8%AD%E9%80%94%E5%B3%B6%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">中途岛号</a></td>
<td bgcolor="#f0f0f0" align="center"><a class="new" title="中途岛级航空母舰（页面不存在）" href="http://zh.wikipedia.org/w/index.php?title=%E4%B8%AD%E9%80%94%E5%B3%B6%E7%B4%9A%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6&amp;action=edit&amp;redlink=1">中途岛级</a></td>
<td align="center"><a title="1992年" href="http://zh.wikipedia.org/wiki/1992%E5%B9%B4">1992年</a><a title="4月11日" href="http://zh.wikipedia.org/wiki/4%E6%9C%8811%E6%97%A5">4月11日</a>退役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVB-42</td>
<td align="center">Franklin D. Roosevelt</td>
<td align="center"><a class="new" title="罗斯福号航空母舰 (CV-42)（页面不存在）" href="http://zh.wikipedia.org/w/index.php?title=%E7%BE%85%E6%96%AF%E7%A6%8F%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-42)&amp;action=edit&amp;redlink=1">罗斯福号</a></td>
<td bgcolor="#f0f0f0" align="center">中途岛级</td>
<td align="center"></td></tr>
<tr>
<td bgcolor="#f0f0f0">CVB-43</td>
<td align="center">Coral Sea</td>
<td align="center"><a class="new" title="珊瑚海号航空母舰（页面不存在）" href="http://zh.wikipedia.org/w/index.php?title=%E7%8F%8A%E7%91%9A%E6%B5%B7%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6&amp;action=edit&amp;redlink=1">珊瑚海号</a></td>
<td bgcolor="#f0f0f0" align="center">中途岛级</td>
<td align="center"></td></tr>
<tr>
<td bgcolor="#f0f0f0">CVB-44</td>
<td align="center"></td>
<td align="center">无</td>
<td bgcolor="#f0f0f0" align="center"></td>
<td align="center">建造计划取消</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-45</td>
<td align="center">Valley Forge</td>
<td align="center"><a title="福吉谷号航空母舰" href="http://zh.wikipedia.org/wiki/%E7%A6%8F%E6%B2%BB%E8%B0%B7%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">福吉谷号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-46</td>
<td align="center">Iwo Jima</td>
<td align="center"><a title="硫磺岛号航空母舰" href="http://zh.wikipedia.org/wiki/%E7%A1%AB%E7%A3%BA%E5%B3%B6%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">硫磺岛号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">建造计划取消</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-47</td>
<td align="center">Philippine Sea</td>
<td align="center"><a title="菲律宾海号航空母舰" href="http://zh.wikipedia.org/wiki/%E8%8F%B2%E5%BE%8B%E8%B3%93%E6%B5%B7%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">菲律宾海号</a></td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">长舰体埃塞克斯级（Long-hull Essex）</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVL-48</td>
<td align="center">Saipan</td>
<td align="center"><a class="new" title="塞班岛号航空母舰（页面不存在）" href="http://zh.wikipedia.org/w/index.php?title=%E5%A1%9E%E7%8F%AD%E5%B3%B6%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6&amp;action=edit&amp;redlink=1">塞班岛号</a></td>
<td bgcolor="#f0f0f0" align="center"><a class="new" title="塞班岛级航空母舰（页面不存在）" href="http://zh.wikipedia.org/w/index.php?title=%E5%A1%9E%E7%8F%AD%E5%B3%B6%E7%B4%9A%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6&amp;action=edit&amp;redlink=1">塞班岛级</a></td>
<td align="center"><a title="1970年" href="http://zh.wikipedia.org/wiki/1970%E5%B9%B4">1970年</a><a title="1月14日" href="http://zh.wikipedia.org/wiki/1%E6%9C%8814%E6%97%A5">1月14日</a> 正式除役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVL-49</td>
<td align="center">Wright</td>
<td align="center"><a class="new" title="莱特号航空母舰（页面不存在）" href="http://zh.wikipedia.org/w/index.php?title=%E8%90%8A%E7%89%B9%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6&amp;action=edit&amp;redlink=1">莱特号</a></td>
<td bgcolor="#f0f0f0" align="center">塞班岛级</td>
<td align="center"><a title="1970年" href="http://zh.wikipedia.org/wiki/1970%E5%B9%B4">1970年</a><a title="5月27日" href="http://zh.wikipedia.org/wiki/5%E6%9C%8827%E6%97%A5">5月27日</a> 正式除役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-50到CV-55</td>
<td align="center"></td>
<td align="center">无</td>
<td bgcolor="#f0f0f0" align="center">埃塞克斯级</td>
<td align="center">建造计划取消</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVB-56到CVB-57</td>
<td align="center"></td>
<td align="center">无</td>
<td bgcolor="#f0f0f0" align="center">中途岛级</td>
<td align="center">建造中途取消</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVA-58</td>
<td align="center">United States</td>
<td align="center"><a title="美国号航空母舰" href="http://zh.wikipedia.org/wiki/%E7%BE%8E%E5%9C%8B%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">美国号</a></td>
<td bgcolor="#f0f0f0" align="center"><a class="mw-redirect" title="美国级航空母舰" href="http://zh.wikipedia.org/wiki/%E7%BE%8E%E5%9C%8B%E7%B4%9A%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">美国级</a></td>
<td align="center">建造中途取消</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVA-59</td>
<td align="center">Forrestal</td>
<td align="center"><a title="福莱斯特号航空母舰" href="http://zh.wikipedia.org/wiki/%E7%A6%8F%E8%90%8A%E6%96%AF%E7%89%B9%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">福莱斯特号</a></td>
<td bgcolor="#f0f0f0" align="center"><a class="new" title="福莱斯特级（页面不存在）" href="http://zh.wikipedia.org/w/index.php?title=%E7%A6%8F%E8%8E%B1%E6%96%AF%E7%89%B9%E7%B4%9A&amp;action=edit&amp;redlink=1">福莱斯特级</a></td>
<td align="center"><a title="1993年" href="http://zh.wikipedia.org/wiki/1993%E5%B9%B4">1993年</a><a title="9月11日" href="http://zh.wikipedia.org/wiki/9%E6%9C%8811%E6%97%A5">9月11日</a> 正式除役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVA-60</td>
<td align="center">Saratoga</td>
<td align="center"><a class="new" title="萨拉托加号航空母舰 (CV-60)（页面不存在）" href="http://zh.wikipedia.org/w/index.php?title=%E8%96%A9%E6%8B%89%E6%89%98%E5%8A%A0%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-60)&amp;action=edit&amp;redlink=1">萨拉托加号</a></td>
<td bgcolor="#f0f0f0" align="center">福莱斯特级</td>
<td align="center"><a title="1994年" href="http://zh.wikipedia.org/wiki/1994%E5%B9%B4">1994年</a><a title="8月20日" href="http://zh.wikipedia.org/wiki/8%E6%9C%8820%E6%97%A5">8月20日</a> 正式除役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVA-61</td>
<td align="center">Ranger</td>
<td align="center"><a class="new" title="突击者号航空母舰 (CV-61)（页面不存在）" href="http://zh.wikipedia.org/w/index.php?title=%E9%81%8A%E9%A8%8E%E5%85%B5%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-61)&amp;action=edit&amp;redlink=1">突击者号</a></td>
<td bgcolor="#f0f0f0" align="center">福莱斯特级</td>
<td align="center"><a title="1993年" href="http://zh.wikipedia.org/wiki/1993%E5%B9%B4">1993年</a><a title="7月10日" href="http://zh.wikipedia.org/wiki/7%E6%9C%8810%E6%97%A5">7月10日</a> 正式除役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-62</td>
<td align="center">Independence</td>
<td align="center"><a class="new" title="独立号航空母舰 (CV-62)（页面不存在）" href="http://zh.wikipedia.org/w/index.php?title=%E7%8D%A8%E7%AB%8B%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-62)&amp;action=edit&amp;redlink=1">独立号</a></td>
<td bgcolor="#f0f0f0" align="center">福莱斯特级</td>
<td align="center"><a title="1998年" href="http://zh.wikipedia.org/wiki/1998%E5%B9%B4">1998年</a><a title="9月30日" href="http://zh.wikipedia.org/wiki/9%E6%9C%8830%E6%97%A5">9月30日</a> 正式除役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-63</td>
<td align="center">Kitty Hawk</td>
<td align="center"><a title="小鹰号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%B0%8F%E9%B7%B9%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">小鹰号</a></td>
<td bgcolor="#f0f0f0" align="center"><a title="小鹰级航空母舰" href="http://zh.wikipedia.org/wiki/%E5%B0%8F%E9%B7%B9%E7%B4%9A%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">小鹰级</a></td>
<td align="center"><a title="2009年" href="http://zh.wikipedia.org/wiki/2009%E5%B9%B4">2009年</a><a title="5月12日" href="http://zh.wikipedia.org/wiki/5%E6%9C%8812%E6%97%A5">5月12日</a> 正式除役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-64</td>
<td align="center">Constellation</td>
<td align="center"><a title="星座号航空母舰" href="http://zh.wikipedia.org/wiki/%E6%98%9F%E5%BA%A7%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">星座号</a></td>
<td bgcolor="#f0f0f0" align="center">小鹰级</td>
<td align="center"><a title="2003年" href="http://zh.wikipedia.org/wiki/2003%E5%B9%B4">2003年</a><a title="8月6日" href="http://zh.wikipedia.org/wiki/8%E6%9C%886%E6%97%A5">8月6日</a> 正式除役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-65</td>
<td align="center">Enterprise</td>
<td align="center"><a title="企业号航空母舰 (CVN-65)" href="http://zh.wikipedia.org/wiki/%E4%BC%81%E6%A5%AD%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CVN-65)">企业号</a></td>
<td bgcolor="#f0f0f0" align="center">企业级</td>
<td align="center">服役中</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVA-66</td>
<td align="center">America</td>
<td align="center"><a class="new" title="美利坚号航空母舰（页面不存在）" href="http://zh.wikipedia.org/w/index.php?title=%E7%BE%8E%E5%88%A9%E5%A0%85%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6&amp;action=edit&amp;redlink=1">美利坚号</a></td>
<td bgcolor="#f0f0f0" align="center">小鹰级</td>
<td align="center"><a title="1996年" href="http://zh.wikipedia.org/wiki/1996%E5%B9%B4">1996年</a><a title="8月9日" href="http://zh.wikipedia.org/wiki/8%E6%9C%889%E6%97%A5">8月9日</a> 正式除役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CV-67</td>
<td align="center">John F. Kennedy</td>
<td align="center"><a class="new" title="肯尼迪号航空母舰 (CV-67)（页面不存在）" href="http://zh.wikipedia.org/w/index.php?title=%E7%94%98%E8%BF%BA%E8%BF%AA%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CV-67)&amp;action=edit&amp;redlink=1">肯尼迪号</a></td>
<td bgcolor="#f0f0f0" align="center">（改良）小鹰级</td>
<td align="center"><a title="2007年" href="http://zh.wikipedia.org/wiki/2007%E5%B9%B4">2007年</a><a title="8月1日" href="http://zh.wikipedia.org/wiki/8%E6%9C%881%E6%97%A5">8月1日</a> 正式除役</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-68</td>
<td align="center">Nimitz</td>
<td align="center"><a title="尼米兹号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%B0%BC%E7%B1%B3%E8%8C%B2%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">尼米兹号</a></td>
<td bgcolor="#f0f0f0" align="center"><a title="尼米兹级核动力航空母舰" href="http://zh.wikipedia.org/wiki/%E5%B0%BC%E7%B1%B3%E8%8C%B2%E7%B4%9A%E6%A0%B8%E5%8B%95%E5%8A%9B%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">尼米兹级</a></td>
<td align="center">服役中</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-69</td>
<td align="center">Dwight D. Eisenhower</td>
<td align="center"><a class="mw-redirect" title="艾森豪威尔号航空母舰" href="http://zh.wikipedia.org/wiki/%E8%89%BE%E6%A3%AE%E8%B1%AA%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">艾森豪威尔号</a></td>
<td bgcolor="#f0f0f0" align="center">尼米兹级</td>
<td align="center">服役中</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-70</td>
<td align="center">Carl Vinson</td>
<td align="center"><a title="卡尔文森号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%8D%A1%E7%88%BE%E6%96%87%E6%A3%AE%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">卡尔文森号</a></td>
<td bgcolor="#f0f0f0" align="center">尼米兹级</td>
<td align="center">服役中</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-71</td>
<td align="center">Theodore Roosevelt</td>
<td align="center"><a class="mw-redirect" title="罗斯福号航空母舰 (CVN-71)" href="http://zh.wikipedia.org/wiki/%E7%BE%85%E6%96%AF%E7%A6%8F%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CVN-71)">罗斯福号</a></td>
<td bgcolor="#f0f0f0" align="center">尼米兹级</td>
<td align="center">服役中</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-72</td>
<td align="center">Abraham Lincoln</td>
<td align="center"><a class="mw-redirect" title="林肯号航空母舰" href="http://zh.wikipedia.org/wiki/%E6%9E%97%E8%82%AF%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">林肯号</a></td>
<td bgcolor="#f0f0f0" align="center">尼米兹级</td>
<td align="center">服役中</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-73</td>
<td align="center">George Washington</td>
<td align="center"><a class="mw-redirect" title="华盛顿号航空母舰" href="http://zh.wikipedia.org/wiki/%E8%8F%AF%E7%9B%9B%E9%A0%93%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">华盛顿号</a></td>
<td bgcolor="#f0f0f0" align="center">尼米兹级</td>
<td align="center">服役中</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-74</td>
<td align="center">John C. Stennis</td>
<td align="center"><a class="mw-redirect" title="斯坦尼斯号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%8F%B2%E5%9D%A6%E5%B0%BC%E6%96%AF%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">斯坦尼斯号</a></td>
<td bgcolor="#f0f0f0" align="center">尼米兹级</td>
<td align="center">服役中</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-75</td>
<td align="center">Harry S. Truman</td>
<td align="center"><a class="mw-redirect" title="杜鲁门号航空母舰" href="http://zh.wikipedia.org/wiki/%E6%9D%9C%E9%AD%AF%E9%96%80%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">杜鲁门号</a></td>
<td bgcolor="#f0f0f0" align="center">尼米兹级</td>
<td align="center">服役中</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-76</td>
<td align="center">Ronald Reagan</td>
<td align="center"><a class="mw-redirect" title="里根号航空母舰" href="http://zh.wikipedia.org/wiki/%E9%9B%B7%E6%A0%B9%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">里根号</a></td>
<td bgcolor="#f0f0f0" align="center">尼米兹级</td>
<td align="center">服役中</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-77</td>
<td align="center">George H. W. Bush</td>
<td align="center"><a class="mw-redirect" title="布什号航空母舰" href="http://zh.wikipedia.org/wiki/%E5%B8%83%E5%B8%8C%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">布什号</a></td>
<td bgcolor="#f0f0f0" align="center">尼米兹级</td>
<td align="center">服役中</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-78</td>
<td align="center">Gerald R. Ford</td>
<td align="center"><a title="福特号航空母舰" href="http://zh.wikipedia.org/wiki/%E7%A6%8F%E7%89%B9%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">福特号</a></td>
<td bgcolor="#f0f0f0" align="center"><a class="mw-redirect" title="福特级航空母舰" href="http://zh.wikipedia.org/wiki/%E7%A6%8F%E7%89%B9%E7%B4%9A%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6">福特级</a></td>
<td align="center">建造中</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-79</td>
<td align="center">John F. Kennedy</td>
<td align="center"><a class="mw-redirect" title="肯尼迪号航空母舰 (CVN-79)" href="http://zh.wikipedia.org/wiki/%E7%94%98%E8%BF%BA%E8%BF%AA%E8%99%9F%E8%88%AA%E7%A9%BA%E6%AF%8D%E8%89%A6_(CVN-79)">肯尼迪号</a></td>
<td bgcolor="#f0f0f0" align="center">福特级</td>
<td align="center">建造中</td></tr>
<tr>
<td bgcolor="#f0f0f0">CVN-80</td>
<td align="center"></td>
<td align="center"><a title="CVN-80" href="http://zh.wikipedia.org/wiki/CVN-80">未命名</a></td>
<td bgcolor="#f0f0f0" align="center">福特级</td>
<td align="center">计划中</td></tr></tbody></table><img src ="http://www.cppblog.com/polly-yang/aggbug/187651.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/polly-yang/" target="_blank">polly</a> 2012-08-19 10:33 <a href="http://www.cppblog.com/polly-yang/archive/2012/08/19/187651.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>高光谱，多光谱，超光谱</title><link>http://www.cppblog.com/polly-yang/archive/2012/08/10/186806.html</link><dc:creator>polly</dc:creator><author>polly</author><pubDate>Fri, 10 Aug 2012 02:42:00 GMT</pubDate><guid>http://www.cppblog.com/polly-yang/archive/2012/08/10/186806.html</guid><wfw:comment>http://www.cppblog.com/polly-yang/comments/186806.html</wfw:comment><comments>http://www.cppblog.com/polly-yang/archive/2012/08/10/186806.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/polly-yang/comments/commentRss/186806.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/polly-yang/services/trackbacks/186806.html</trackback:ping><description><![CDATA[<p align="left">高光谱成像是新一代光电检测技术，兴起于2O世纪8O年代，目前仍在迅猛发展巾。高光谱成像是相对多光谱成像而言，通过高光谱成像方法获得的高光谱图像与通过多光谱成像获取的多光谱图像相比具有更丰富的图像和光谱信息。如果根据传感器的光谱分辨率对光谱成像技术进行分类，光谱成像技术一般可分成3类。</p>
<p align="left">&nbsp;<wbr></p>
<p align="left">(1)&nbsp;<wbr> 多光谱成像&#8212;&#8212;光谱分辨率在 delta_lambda/lambda=0．1数量级，这样的传感器在可见光和近红外区域一般只有几个波段。</p>
<p align="left">&nbsp;<wbr></p>
<p align="left">(2)&nbsp;<wbr> 高光谱成像&#8212;&#8212; 光谱分辨率在 delta_lambda/lambda=0．01数量级，这样的传感器在可见光和近红外区域有几卜到数百个波段，光谱分辨率可达nm级。</p>
<p align="left">&nbsp;<wbr></p>
<p align="left">(3)&nbsp;<wbr> 超光谱成像&#8212;&#8212; 光谱分辨率在delta_lambda/lambda =O．001数量级，这样的传感器在可见光和近红外区域可达数千个波段。</p>
<p align="left">&nbsp;<wbr></p>
<p align="left">众所周知，光谱分析是自然科学中一种重要的研究手段，光谱技术能检测到被测物体的物理结构、化学成分等指标。光谱评价是基于点测量，而图像测量是基于空间特性变化，两者各有其优缺点。因此，可以说光谱成像技术是光谱分析技术和图像分析技术发展的必然结果，是二者完美结合的产物。光谱成像技术不仅具有光谱分辨能力，还具有图像分辨能力，利用光谱成像技术不仅可以对待检测物体进行定性和定量分析，而且还能进对其进行定位分析。</p>
<p align="left">&nbsp;<wbr></p>
<p align="left">高光谱成像系统的主要工作部件是成像光谱仪，它是一种新型传感器，2O世纪8O年代初正式开始研制，研制这类仪器的目的是为获取大量窄波段连续光谱图像数据，使每个像元具有几乎连续的光谱数据。它是一系列光波波长处的光学图像，通常包含数十到数百个波段，光谱分辨率一般为1～l0nm。由于高光谱成像所获得的高光谱图像能对图像中的每个像素提供一条几乎连续的光谱曲线，其在待测物上获得空间信息的同时又能获得比多光谱更为丰富光谱数据信息，这些数据信息可用来生成复杂模型，来进行判别、分类、识别图像中的材料。</p>
<p align="left">&nbsp;<wbr></p>
<p align="left">通过高光谱成像获取待测物的高光谱图像包含了待测物的丰富的空间、光谱和辐射三重信息。这些信息不仅表现了</p>
<p align="left">地物空间分布的影像特征，同时也可能以其中某一像元或像元组为目标获取它们的辐射强度以及光谱特征。影像、辐射与光谱是高光谱图像中的3个重要特征，这3个特征的有机结合就是高光谱图像。</p>
<p align="left">&nbsp;<wbr></p>
<p align="left">高光谱图像数据为数据立方体(cube)。通常图像像素的横坐标和纵坐标分别用z和Y来表示，光谱的波长信息以(Z即轴)表示。该数据立方体由沿着光谱轴的以一定光谱分辨率间隔的连续二维图像组成。</p><img src ="http://www.cppblog.com/polly-yang/aggbug/186806.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/polly-yang/" target="_blank">polly</a> 2012-08-10 10:42 <a href="http://www.cppblog.com/polly-yang/archive/2012/08/10/186806.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>vs + opencv 常见错误</title><link>http://www.cppblog.com/polly-yang/archive/2012/07/30/185613.html</link><dc:creator>polly</dc:creator><author>polly</author><pubDate>Mon, 30 Jul 2012 03:57:00 GMT</pubDate><guid>http://www.cppblog.com/polly-yang/archive/2012/07/30/185613.html</guid><wfw:comment>http://www.cppblog.com/polly-yang/comments/185613.html</wfw:comment><comments>http://www.cppblog.com/polly-yang/archive/2012/07/30/185613.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/polly-yang/comments/commentRss/185613.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/polly-yang/services/trackbacks/185613.html</trackback:ping><description><![CDATA[Q:Link Error 2019 无法解析的外部符号&nbsp; _cvCreateImage<br />A:应将解决方案平台改为win64。<br />工具栏上方的解决方案平台&#8212;》点击下拉菜单&#8212;》配置管理器&#8212;》活动解决方案平台&#8212;》新建&#8212;》键入获选着新平台&#8212;》x64<br />问题就解决啦！哈哈！ <br /><br /><br /><br />Q：Error C1189 Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]<br />A:Go to the project properties (Project menu, Properties).&nbsp; Set 'Use of MFC' to "Use MFC in a Shared DLL".&nbsp; You have to make this change for both the debug and release configurations<img src ="http://www.cppblog.com/polly-yang/aggbug/185613.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/polly-yang/" target="_blank">polly</a> 2012-07-30 11:57 <a href="http://www.cppblog.com/polly-yang/archive/2012/07/30/185613.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>舰船检测初步</title><link>http://www.cppblog.com/polly-yang/archive/2012/07/25/185048.html</link><dc:creator>polly</dc:creator><author>polly</author><pubDate>Wed, 25 Jul 2012 11:02:00 GMT</pubDate><guid>http://www.cppblog.com/polly-yang/archive/2012/07/25/185048.html</guid><wfw:comment>http://www.cppblog.com/polly-yang/comments/185048.html</wfw:comment><comments>http://www.cppblog.com/polly-yang/archive/2012/07/25/185048.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/polly-yang/comments/commentRss/185048.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/polly-yang/services/trackbacks/185048.html</trackback:ping><description><![CDATA[算法效率，先验特征，算法框架本周搞定。<img src ="http://www.cppblog.com/polly-yang/aggbug/185048.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/polly-yang/" target="_blank">polly</a> 2012-07-25 19:02 <a href="http://www.cppblog.com/polly-yang/archive/2012/07/25/185048.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Bilateral Filtering for Gray and Color Images</title><link>http://www.cppblog.com/polly-yang/archive/2012/07/24/184893.html</link><dc:creator>polly</dc:creator><author>polly</author><pubDate>Tue, 24 Jul 2012 12:39:00 GMT</pubDate><guid>http://www.cppblog.com/polly-yang/archive/2012/07/24/184893.html</guid><wfw:comment>http://www.cppblog.com/polly-yang/comments/184893.html</wfw:comment><comments>http://www.cppblog.com/polly-yang/archive/2012/07/24/184893.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/polly-yang/comments/commentRss/184893.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/polly-yang/services/trackbacks/184893.html</trackback:ping><description><![CDATA[<ol><li><font color="#000000" size="+1"><a name="Index"></a></font><font color="#000000" size="+1"><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#Introduction"><span style="font-family: Times New Roman">Introduction</span></a></font></li><li><font color="#000000" size="+1"><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#The Idea"><span style="font-family: Times New Roman">The Idea</span></a></font></li><li><font color="#000000" size="+1"><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#The Gaussian Case"><span style="font-family: Times New Roman">The Gaussian Case</span></a></font></li><li><font color="#000000" size="+1"><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#Experiments1"><span style="font-family: Times New Roman">Experiments with Black-and-White Images</span></a></font></li><li><font color="#000000" size="+1"><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#Experiments2"><span style="font-family: Times New Roman">Experiments with Color Images</span></a></font></li><li><font color="#000000" size="+1"><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#References"><span style="font-family: Times New Roman">References</span></a></font> </li></ol>
<h3><font size="+1"><a name="Introduction"></a><span style="font-family: Times New Roman">Introduction</span></font> </h3>
<p><font size="+1"><span style="font-family: Times New Roman">Filtering is perhaps the most fundamental operation of image processing and computer vision. In the broadest sense of the term "filtering", the value of the filtered image at a given location is a function of the values of the input image in a small neighborhood of the same location. For example, Gaussian low-pass filtering computes a weighted average of pixel values in the neighborhood, in which the weights decrease with distance from the neighborhood center. Although formal and quantitative explanations of this weight fall-off can be given, the intuition is that images typically vary slowly over space, so near pixels are likely to have similar values, and it is therefore appropriate to average them together. The noise values that corrupt these nearby pixels are mutually less correlated than the signal values, so noise is averaged away while signal is preserved.</span><br /><span style="font-family: Times New Roman">The assumption of slow spatial variations fails at edges, which are consequently blurred by linear low-pass filtering. How can we prevent averaging across edges, while still averaging within smooth regions? </span></font><font size="+1"><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#References"><span style="font-family: Times New Roman">Many efforts</span></a></font><font size="+1"><span style="font-family: Times New Roman"> have been devoted to reducing this undesired effect. </span></font><font size="+1"><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#[1]"><span style="font-family: Times New Roman">Bilateral filtering</span></a></font><font size="+1"><span style="font-family: Times New Roman"> is a simple, non-iterative scheme for </span></font><em><font size="+1"><span style="font-family: Times New Roman">edge-preserving smoothing</span></font></em><font size="+1"><span style="font-family: Times New Roman">.</span><br /><br /></font><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#Index"><span style="font-family: Times New Roman">Back to Index</span></a></p>
<h3><font size="+1"><a name="The Idea"></a><span style="font-family: Times New Roman">The Idea</span></font></h3>
<p><font size="+1"><span style="font-family: Times New Roman">The basic idea underlying bilateral filtering is to do in the range of an image what traditional filters do in its domain. Two pixels can be </span></font><em><font size="+1"><span style="font-family: Times New Roman">close</span></font></em><font size="+1"><span style="font-family: Times New Roman"> to one another, that is, occupy nearby spatial location, or they can be </span></font><em><font size="+1"><span style="font-family: Times New Roman">similar</span></font></em><font size="+1"><span style="font-family: Times New Roman"> to one another, that is, have nearby values, possibly in a perceptually meaningful fashion.</span><br /><span style="font-family: Times New Roman">Consider a shift-invariant low-pass domain filter applied to an image:</span><br /><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/image514.gif" width="323" height="55"  alt="" /><br /><span style="font-family: Times New Roman">The bold font for </span></font><strong><font size="+1"><span style="font-family: Times New Roman">f</span></font></strong><font size="+1"><span style="font-family: Times New Roman"> and </span></font><strong><font size="+1"><span style="font-family: Times New Roman">h</span></font></strong><font size="+1"><span style="font-family: Times New Roman"> emphasizes the fact that both input and output images may be multi-band. In order to preserve the DC component, it must be</span><br /><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/image746.gif" width="181" height="49"  alt="" /><br /><span style="font-family: Times New Roman">Range filtering is similarly defined:</span><br /><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/image397.gif" width="424" height="56"  alt="" /><br /><span style="font-family: Times New Roman">In this case, the kernel measures the </span></font><em><font size="+1"><span style="font-family: Times New Roman">photometric</span></font></em><font size="+1"><span style="font-family: Times New Roman"> similarity between pixels. The normalization constant in this case is</span><br /><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/image053.gif" width="298" height="53"  alt="" /><br /><span style="font-family: Times New Roman">The spatial distribution of image intensities plays no role in range filtering taken by itself. Combining intensities from the entire image, however, makes little sense, since the distribution of image values far away from </span></font><strong><font size="+1"><span style="font-family: Times New Roman">x</span></font></strong><font size="+1"><span style="font-family: Times New Roman"> ought not to affect the final value at </span></font><strong><font size="+1"><span style="font-family: Times New Roman">x</span></font></strong><font size="+1"><span style="font-family: Times New Roman">. In addition, one can show that range filtering without domain filtering merely changes the color map of an image, and is therefore of little use. The appropriate solution is to combine domain and range filtering, thereby enforcing both geometric and photometric locality. Combined filtering can be described as follows:</span><br /><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/image477.gif" width="435" height="58"  alt="" /><br /><span style="font-family: Times New Roman">with the normalization</span><br /><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/image788.gif" width="381" height="52"  alt="" /><br /><span style="font-family: Times New Roman">Combined domain and range filtering will be denoted as </span></font><em><font size="+1"><span style="font-family: Times New Roman">bilateral filtering</span></font></em><font size="+1"><span style="font-family: Times New Roman">. It replaces the pixel value at </span></font><strong><font size="+1"><span style="font-family: Times New Roman">x</span></font></strong><font size="+1"><span style="font-family: Times New Roman"> with an average of similar and nearby pixel values. In smooth regions, pixel values in a small neighborhood are similar to each other, and the bilateral filter acts essentially as a standard domain filter, averaging away the small, weakly correlated differences between pixel values caused by noise. Consider now a sharp boundary between a dark and a bright region, as in figure 1(a).</span><br /></font>
<table border="0">
<tbody>
<tr>
<td>
<p>
<center><font size="+1"><img border="1" align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/step-orig.gif" width="256" height="174"  alt="" /></font></center></td>
<td>
<p>
<center><font size="+1"><img border="1" align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/step-sim.gif" width="256" height="174"  alt="" /></font></center></td>
<td>
<p><font size="+1"><img border="1" align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/step-filt.gif" width="256" height="174"  alt="" /></font> </p></td></tr>
<tr>
<td>
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(a)</span></font></strong></center></td>
<td>
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(b)</span></font></strong></center></td>
<td>
<p>
<center><strong style="font-family: Times New Roman">(c)</strong></center></td></tr>
<tr>
<td>
</td>
<td>
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">Figure 1</span></font></strong></center></td>
<td>
</td></tr></tbody></table><font size="+1"><br /><span style="font-family: Times New Roman">When the bilateral filter is centered, say, on a pixel on the bright side of the boundary, the similarity function </span></font><em><font size="+1"><span style="font-family: Times New Roman">s</span></font></em><font size="+1"><span style="font-family: Times New Roman"> assumes values close to one for pixels on the same side, and values close to zero for pixels on the dark side. The similarity function is shown in figure 1(b) for a 23x23 filter support centered two pixels to the right of the step in figure 1(a). The normalization term </span></font><em><font size="+1"><span style="font-family: Times New Roman">k(</span></font></em><strong><em><font size="+1"><span style="font-family: Times New Roman">x</span></font></em></strong><em><font size="+1"><span style="font-family: Times New Roman">) </span></font></em><font size="+1"><span style="font-family: Times New Roman">ensures that the weights for all the pixels add up to one. As a result, the filter replaces the bright pixel at the center by an average of the bright pixels in its vicinity, and essentially ignores the dark pixels. Conversely, when the filter is centered on a dark pixel, the bright pixels are ignored instead. Thus, as shown in figure 1(c), good filtering behavior is achieved at the boundaries, thanks to the domain component of the filter, and crisp edges are preserved at the same time, thanks to the range component.</span><br /><br /></font><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#Index"><span style="font-family: Times New Roman">Back to Index</span></a></p>
<h3><font size="+1"><a name="The Gaussian Case"></a><span style="font-family: Times New Roman">The Gaussian Case</span></font></h3>
<p><font size="+1"><span style="font-family: Times New Roman">A simple and important case of bilateral filtering is shift-invariant Gaussian filtering, in which both the closeness function </span></font><em><font size="+1"><span style="font-family: Times New Roman">c</span></font></em><font size="+1"><span style="font-family: Times New Roman"> and the similarity function </span></font><em><font size="+1"><span style="font-family: Times New Roman">s</span></font></em><font size="+1"><span style="font-family: Times New Roman"> are Gaussian functions of the Euclidean distance between their arguments. More specifically, </span></font><em><font size="+1"><span style="font-family: Times New Roman">c</span></font></em><font size="+1"><span style="font-family: Times New Roman"> is radially symmetric:</span><br /><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/image548.gif" width="212" height="76"  alt="" /><br /><span style="font-family: Times New Roman">where</span><br /><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/image710.gif" width="169" height="40"  alt="" /><br /><span style="font-family: Times New Roman">is the Euclidean distance. The similarity function </span></font><em><font size="+1"><span style="font-family: Times New Roman">s</span></font></em><font size="+1"><span style="font-family: Times New Roman"> is perfectly analogous to </span></font><em><font size="+1"><span style="font-family: Times New Roman">c</span></font></em><font size="+1"><span style="font-family: Times New Roman"> :</span><br /><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/image865.gif" width="276" height="78"  alt="" /><br /><span style="font-family: Times New Roman">where</span><br /><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/image347.gif" width="304" height="34"  alt="" /><br /><span style="font-family: Times New Roman">is a suitable measure of distance in intensity space. In the scalar case, this may be simply the absolute difference of the pixel difference or, since noise increases with image intensity, an intensity-dependent version of it. Just as this form of domain filtering is shift-invariant, the Gaussian range filter introduced above is insensitive to overall additive changes of image intensity. Of course, the range filter is shift-invariant as well.</span><br /><br /></font><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#Index"><span style="font-family: Times New Roman">Back to Index</span></a><br /></p>
<h3><font size="+1"><a name="Experiments1"></a><span style="font-family: Times New Roman">Experiments with Black-and-White Images</span></font></h3>
<p><font size="+1"><span style="font-family: Times New Roman">Figure 2 (a) and (b) show the potential of bilateral filtering for the removal of texture. The picture "simplification" illustrated by figure 2 (b) can be useful for data reduction without loss of overall shape features in applications such as image transmission, picture editing and manipulation, image description for retrieval.</span><br /></font></p>
<p>
<table border="0" width="62%">
<tbody>
<tr>
<td height="259" width="232">
<p><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/kitten-orig.gif" width="223" height="244"  alt="" /> </p></td>
<td height="259" width="123">
</td>
<td height="259">
<p><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/kitten-filt.gif" width="223" height="244"  alt="" /> </p></td></tr>
<tr>
<td width="232">
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(a)</span></font></strong></center></td>
<td width="123">
</td>
<td>
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(b)</span></font></strong></center></td></tr>
<tr>
<td width="232">
</td>
<td width="123">
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">Figure 2</span></font></strong></center></td>
<td>
</td></tr></tbody></table><font size="+1"><br /></font></p>
<p><font size="+1"><span style="font-family: Times New Roman">Bilateral filtering with parameters </span></font><font size="+2" face="Symbol"><span style="font-family: Times New Roman">s</span></font><span style="font-family: Times New Roman">d</span><font size="+1"><span style="font-family: Times New Roman"> =3 pixels and </span></font><font size="+2" face="Symbol"><span style="font-family: Times New Roman">s</span></font><span style="font-family: Times New Roman">r</span><font size="+1"><span style="font-family: Times New Roman"> =50 intensity values is applied to the image in figure 3 (a) to yield the image in figure 3 (b). Notice that most of the fine texture has been filtered away, and yet all contours are as crisp as in the original image. Figure 3 (c) shows a detail of figure 3 (a), and figure 3 (d) shows the corresponding filtered version. The two onions have assumed a graphics-like appearance, and the fine texture has gone. However, the overall shading is preserved, because it is well within the band of the domain filter and is almost unaffected by the range filter. Also, the boundaries of the onions are preserved.</span><br /></font>
<table border="0" width="85%">
<tbody>
<tr>
<td width="340">
<p>
<center><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/snack-orig.gif" width="333" height="222"  alt="" /></center></td>
<td width="128">
</td>
<td>
<p>
<center><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/snack-filt.gif" width="333" height="222"  alt="" /></center></td></tr>
<tr>
<td width="340">
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(a)</span></font></strong></center></td>
<td width="128">
</td>
<td>
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(b)</span></font></strong></center></td></tr>
<tr>
<td height="286" width="340">
<p>
<center><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/onions-orig.gif" width="333" height="273"  alt="" /></center>
<p>&nbsp;</p>
<p>
<center>&nbsp;</center></td>
<td height="286" width="128">
</td>
<td height="286">
<p>
<center><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/onions-filt.gif" width="333" height="273"  alt="" /></center>
<p>&nbsp;</p>
<p>
<center>&nbsp;</center></td></tr>
<tr>
<td width="340">
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(c)</span></font></strong></center></td>
<td width="128">
</td>
<td>
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(d)</span></font></strong></center></td></tr>
<tr>
<td width="340">
</td>
<td width="128">
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">Figure 3</span></font></strong></center></td>
<td>
</td></tr></tbody></table><font size="+1"><br /></font><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#Index"><span style="font-family: Times New Roman">Back to Index</span></a><br /></p>
<h3><font size="+1"><a name="Experiments2"></a><span style="font-family: Times New Roman">Experiments with Color Images</span></font></h3>
<p><font size="+1"><span style="font-family: Times New Roman">For black-and-white images, intensities between any two gray levels are still gray levels. As a consequence, when smoothing black-and-white images with a standard low-pass filter, intermediate levels of gray are produced across edges, thereby producing blurred images. With color images, an additional complication arises from the fact that between any two colors there are other, often rather different colors. For instance, between blue and red there are various shades of pink and purple. Thus, disturbing color bands may be produced when smoothing across color edges. The smoothed image does not just look blurred, it also exhibits odd-looking, colored auras around objects.</span><br /></font>
<table border="0">
<tbody>
<tr>
<td width="110">
<p>
<center><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/jacket.gif" width="100" height="100" X-SAS-UseImageWidth X-SAS-UseImageHeight  alt="" /> </center></td>
<td width="97">
</td>
<td width="109">
<p>
<center><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/jacket_smooth_sep.gif" width="100" height="100" X-SAS-UseImageWidth X-SAS-UseImageHeight  alt="" /></center></td></tr>
<tr>
<td width="110">
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(a)</span></font></strong></center></td>
<td width="97">
</td>
<td width="109">
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(b)</span></font></strong></center></td></tr>
<tr>
<td width="110">
<p>
<center><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/jacket_sharp_sep.gif" width="100" height="100" X-SAS-UseImageWidth X-SAS-UseImageHeight  alt="" /></center></td>
<td width="97">
</td>
<td width="109">
<p>
<center><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/jacket_sharp.gif" width="100" height="100" X-SAS-UseImageWidth X-SAS-UseImageHeight  alt="" /> </center></td></tr>
<tr>
<td width="110">
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(c)</span></font></strong></center></td>
<td width="97">
</td>
<td width="109">
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(d)</span></font></strong></center></td></tr>
<tr>
<td width="110">
</td>
<td width="97">
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">Figure 4</span></font></strong></center></td>
<td width="109">
</td></tr></tbody></table><font size="+1"><br /><span style="font-family: Times New Roman">Figure 4 (a) shows a detail from a picture with a red jacket against a blue sky. Even in this unblurred picture, a thin pink-purple line is visible, and is caused by a combination of lens blurring and pixel averaging. In fact, pixels along the boundary, when projected back into the scene, intersect both red jacket and blue sky, and the resulting color is the pink average of red and blue. When smoothing, this effect is emphasized, as the broad, blurred pink-purple area in figure 4 (b) shows.</span><br /><span style="font-family: Times New Roman">To address this difficulty, edge-preserving smoothing could be applied to the red, green, and blue components of the image separately. However, the intensity profiles across the edge in the three color bands are in general different. Smoothing the three color bands separately results in an even more pronounced pink and purple band than in the original, as shown in figure 4 (c). The pink-purple band, however, is not widened as in the standard-blurred version of figure 4 (b).</span><br /><span style="font-family: Times New Roman">A much better result can be obtained with bilateral filtering. In fact, a bilateral filter allows combining the three color bands appropriately, and measuring photometric distances between pixels in the combined space. Moreover, this combined distance can be made to correspond closely to perceived dissimilarity by using Euclidean distance in the </span></font><font size="+1"><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#[16]"><span style="font-family: Times New Roman">CIE-Lab color space</span></a></font><font size="+1"><span style="font-family: Times New Roman">. This color space is based on a large body of psychophysical data concerning color-matching experiments performed by human observers. In this space, small Euclidean distances are designed to correlate strongly with the perception of color discrepancy as experienced by an "average" color-normal human observer. Thus, in a sense, bilateral filtering performed in the CIE-Lab color space is the most natural type of filtering for color images: only perceptually similar colors are averaged together, and only perceptually important edges are preserved. Figure 4 (d) shows the image resulting from bilateral smoothing of the image in figure 4 (a). The pink band has shrunk considerably, and no extraneous colors appear.</span><br /></font>
<table border="0">
<tbody>
<tr>
<td>
<p>
<center><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/luca.gif" width="320" height="243" X-SAS-UseImageWidth X-SAS-UseImageHeight  alt="" /> </center></td>
<td>
<p>
<center><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/luca_one.gif" width="320" height="243" X-SAS-UseImageWidth X-SAS-UseImageHeight  alt="" /> </center></td>
<td>
<p>
<center><img align="bottom" src="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/luca_five.gif" width="320" height="243" X-SAS-UseImageWidth X-SAS-UseImageHeight  alt="" /> </center></td></tr>
<tr>
<td>
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(a)</span></font></strong></center></td>
<td>
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(b)</span></font></strong></center></td>
<td>
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">(c)</span></font></strong></center></td></tr>
<tr>
<td>
</td>
<td>
<p>
<center><strong><font size="+1"><span style="font-family: Times New Roman">Figure 5</span></font></strong></center></td>
<td>
</td></tr></tbody></table><font size="+1"><br /><span style="font-family: Times New Roman">Figure 5 (c) shows the result of five iterations of bilateral filtering of the image in figure 5 (a). While a single iteration produces a much cleaner image (figure 5 (b)) than the original, and is probably sufficient for most image processing needs, multiple iterations have the effect of flattening the colors in an image considerably, but without blurring edges. The resulting image has a much smaller color map, and the effects of bilateral filtering are easier to see when displayed on a printed page. Notice the cartoon-like appearance of figure 5 (c). All shadows and edges are preserved, but most of the shading is gone, and no "new" colors are introduced by filtering.</span><br /><br /></font><a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html#Index"><span style="font-family: Times New Roman">Back to Index</span></a><br /></p>
<h3><font size="+1"><a name="References"></a><span style="font-family: Times New Roman">References</span></font></h3>
<p><font size="+1"><a name="[1]"></a><span style="font-family: Times New Roman">[1] C. Tomasi and R. Manduchi, "Bilateral Filtering for Gray and Color Images", </span></font><em><font size="+1"><span style="font-family: Times New Roman">Proceedings of the 1998 IEEE International Conference on Computer Vision</span></font></em><font size="+1"><span style="font-family: Times New Roman">, Bombay, India.</span><br /><span style="font-family: Times New Roman">[2] T. Boult, R.A. Melter, F. Skorina, and I. Stojmenovic,"G-neighbors", </span></font><em><font size="+1"><span style="font-family: Times New Roman">Proceedings of the SPIE Conference on Vision Geometry II</span></font></em><font size="+1"><span style="font-family: Times New Roman">, pages 96-109, 1993.</span><br /><span style="font-family: Times New Roman">[3] R.T. Chin and C.L. Yeh, "Quantitative evaluation of some edge-preserving noise-smoothing techniques", </span></font><em><font size="+1"><span style="font-family: Times New Roman">Computer Vision, Graphics, and Image Processing</span></font></em><font size="+1"><span style="font-family: Times New Roman">, 23:67-91, 1983.</span><br /><span style="font-family: Times New Roman">[4] L.S. Davis and A. Rosenfeld, "Noise cleaning by iterated local averaging", </span></font><em><font size="+1"><span style="font-family: Times New Roman">IEEE Transactions on Systems, Man, and Cybernetics</span></font></em><font size="+1"><span style="font-family: Times New Roman">, 8:705-710, 1978.</span><br /><span style="font-family: Times New Roman">[5] R.E. Graham, "Snow-removal - a noise-stripping process for picture signals", </span></font><em><font size="+1"><span style="font-family: Times New Roman">IRE Transactions on Information Theory</span></font></em><font size="+1"><span style="font-family: Times New Roman">, 8:129-144, 1961.</span><br /><span style="font-family: Times New Roman">[6] N. Himayat and S.A. Kassam, "Approximate performance analysis of edge preserving filters", </span></font><em><font size="+1"><span style="font-family: Times New Roman">IEEE Transactions on Signal Processing</span></font></em><font size="+1"><span style="font-family: Times New Roman">, 41(9):2764-77, 1993.</span><br /><span style="font-family: Times New Roman">[7] T.S. Huang, G.J. Yang, and G.Y. Tang, "A fast two-dimensional median filtering algorithm", </span></font><em><font size="+1"><span style="font-family: Times New Roman">IEEE Transactions on Acoustics, Speech, and Signal Processing</span></font></em><font size="+1"><span style="font-family: Times New Roman">, 27(1):13-18, 1979.</span><br /><span style="font-family: Times New Roman">[8] J.S. Lee, "Digital image enhancement and noise filtering by use of local statistics", </span></font><em><font size="+1"><span style="font-family: Times New Roman">IEEE Transactions on Pattern Analysis and Machine Intelligence</span></font></em><font size="+1"><span style="font-family: Times New Roman">, 2(2):165-168, 1980.</span><br /><span style="font-family: Times New Roman">[9] M. Nagao and T. Matsuyama, "Edge preserving smoothing", </span></font><em><font size="+1"><span style="font-family: Times New Roman">Computer Graphics and Image Processing</span></font></em><font size="+1"><span style="font-family: Times New Roman">, 9:394-407, 1979.</span><br /><span style="font-family: Times New Roman">[10] P.M. Narendra, "A separable median filter for image noise smoothing", </span></font><em><font size="+1"><span style="font-family: Times New Roman">IEEE Transactions on Pattern Analysis and Machine Intelligence</span></font></em><font size="+1"><span style="font-family: Times New Roman">, 3(1):20-29, 1981.</span><br /><span style="font-family: Times New Roman">[11] K.J. Overton and T.E. Weymouth, "A noise reducing preprocessing algorithm",</span></font><em><font size="+1"><span style="font-family: Times New Roman">Proceedings of the IEEE Computer Science Conference on Pattern Recognition and Image Processing</span></font></em><font size="+1"><span style="font-family: Times New Roman">, pages 498-507, Chicago, IL, 1979.</span><br /><span style="font-family: Times New Roman">[12] P. Perona and J. Malik, "Scale-space and edge detection using anisotropic diffusion", </span></font><em><font size="+1"><span style="font-family: Times New Roman">IEEE Transactions on Pattern Analysis and Machine Intelligence</span></font></em><font size="+1"><span style="font-family: Times New Roman">, 12(7):629-639, 1990.</span><br /><span style="font-family: Times New Roman">[13] G. Ramponi, "A rational edge-preserving smoother", </span></font><em><font size="+1"><span style="font-family: Times New Roman">Proceedings of the International Conference on Image Processing</span></font></em><font size="+1"><span style="font-family: Times New Roman">, volume 1, pages 151-154, Washington, DC, 1995.</span><br /><span style="font-family: Times New Roman">[14] G. Sapiro and D.L. Ringach, "Anisotropic diffusion of color images", </span></font><em><font size="+1"><span style="font-family: Times New Roman">Proceedings of the SPIE</span></font></em><font size="+1"><span style="font-family: Times New Roman">, volume 2657, pages 471-382, 1996.</span><br /><span style="font-family: Times New Roman">[15] D.C.C. Wang, A.H. Vagnucci, and C.C. Li, "A gradient inverse weighted smoothing scheme and the evaluation of its performance", </span></font><em><font size="+1"><span style="font-family: Times New Roman">Computer Vision, Graphics, and Image Processing</span></font></em><font size="+1"><span style="font-family: Times New Roman">, 15:167-181, 1981.</span><br /><a name="[16]"></a><span style="font-family: Times New Roman">[16] G. Wyszecki and W. S. Styles, </span></font><em><font size="+1"><span style="font-family: Times New Roman">Color Science: Concepts and Methods, Quantitative Data and Formulae</span></font></em><font size="+1"><span style="font-family: Times New Roman">, John Wiley and Sons, New York, NY, 1982.</span><br /><span style="font-family: Times New Roman">[17] L. Yin, R. Yang, M. Gabbouj, and Y. Neuvo, "Weighted median filters: a tutorial",IEEE </span></font><em><font size="+1"><span style="font-family: Times New Roman">Transactions on Circuits and Systems II: Analog and Digital Signal Processing</span></font></em><font size="+1"><span style="font-family: Times New Roman">, 43(3):155-192, 1996.</span><br /></font></p> <img src ="http://www.cppblog.com/polly-yang/aggbug/184893.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/polly-yang/" target="_blank">polly</a> 2012-07-24 20:39 <a href="http://www.cppblog.com/polly-yang/archive/2012/07/24/184893.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CString 、 string  、 const char*、int、double之间的相互转换</title><link>http://www.cppblog.com/polly-yang/archive/2012/07/24/184890.html</link><dc:creator>polly</dc:creator><author>polly</author><pubDate>Tue, 24 Jul 2012 12:34:00 GMT</pubDate><guid>http://www.cppblog.com/polly-yang/archive/2012/07/24/184890.html</guid><wfw:comment>http://www.cppblog.com/polly-yang/comments/184890.html</wfw:comment><comments>http://www.cppblog.com/polly-yang/archive/2012/07/24/184890.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/polly-yang/comments/commentRss/184890.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/polly-yang/services/trackbacks/184890.html</trackback:ping><description><![CDATA[<p><span style="font-family: Times New Roman; font-size: 14pt">我们在写程序时，常常会遇到类型转换的问题。现总结一些常见的类型转换。</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">1，const char*（C风格字符串）与string之间转换：</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（1） const char*可以直接对string类型赋值，例如：</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const char* pchar = "qwerasdf";</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stringstr = pchar;</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; （2） string通过c_str()函数转换为C风格字符串，例如：</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string str = "qwerasdf";</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const char* pchar = str.c_str();</span></p>
<p><span style="font-size: 18px"></span>&nbsp;</p>
<p><span style="font-family: Times New Roman; font-size: 14pt">2，const char*类型可以直接给CString类型赋值，例如：</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const char* pchar = "qwerasdf";</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CString str = pchar;</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">3，string类型变量转为为Cstring类型变量</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CString类型变量可以直接给string类型变量赋值，但是string类型不能对CString类型直接赋值。通过前两类</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;转换我们可以得到，</span><span style="font-family: Times New Roman; font-size: 14pt">string类型变量转换为const char*类型，然后再直接赋值就可以了。例如：</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CString cstr；</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sring str = &#8220;asdasd&#8221;；</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cstr = str.c_str();</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;同理，CStrng类型变量先转换为string类型在调用c_str()函数就可以完成向</span><span style="font-family: Times New Roman; font-size: 14pt">const char*类型的转换。例如：</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CString cStr = "adsad";</span><span style="font-size: 18px">&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string str = cStr;&nbsp;&nbsp;</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const char* pchar = str.c_str();<br /></span><span style="font-family: Times New Roman; font-size: 14pt">4，double，int转string<br /></span></p>
<p><span style="font-size: 18px"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-family: Times New Roman; font-size: 14pt">double temp;</span><br />&nbsp;&nbsp;&nbsp;<span style="font-family: Times New Roman; font-size: 14pt">stringstream strStream;</span><br />&nbsp;&nbsp;&nbsp;<span style="font-family: Times New Roman; font-size: 14pt">strStream&lt;&lt;temp;</span><br />&nbsp;&nbsp;&nbsp;<span style="font-family: Times New Roman; font-size: 14pt">string ss = strStream.str()</span>&nbsp;<br /><br /><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;string 转double，int&nbsp;</span><br /><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;string.atoi&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;&nbsp;string.atof</span></p>
<p><span style="font-family: Times New Roman; font-size: 14pt">&nbsp;&nbsp;&nbsp;&nbsp; 从上面我们可以上面看出，通过类型之间的相互转化，会使本来要通过复杂的函数来完成的类型转换变得简单易懂。</span></p><img src ="http://www.cppblog.com/polly-yang/aggbug/184890.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/polly-yang/" target="_blank">polly</a> 2012-07-24 20:34 <a href="http://www.cppblog.com/polly-yang/archive/2012/07/24/184890.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>