?? faq.cn.htm
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=GBK"><title>OpenCV 文檔 (draft)</title>
</head><body>
<center><table cellspacing=0 cellpadding=5 width="90%" bgcolor="#6a9bed" nosave >
<tr nosave>
<td nosave>
<center><i><font color="#000000"><font size=+4>
常見問題及解決方法
</font></font></i></center>
</td>
</tr>
</table></center>
<p>中文翻譯者:
<ul>
<li><a href="mailto:yushiqi@yahoo.com.cn">于仕琪</a>,<a href="http://fsa.ia.ac.cn">中科院自動化所自由軟件協會</a>
<li>HUNNISH,<a href="http://www.assuredigit.com">阿須數碼</a>
</ul>
</p>
<hr>
<h1>一般性問題</h1>
<hr><h3>如何正確安裝 OpenCV ?</h3>
<p>閱讀<a href="../INSTALL">安裝指南</a>
<hr><h3>如何快速認識 OpenCV ?</h3>
<p>
<ol><li>參考<a href="../samples/c/">例子</a>。
<li>在 Visual Studio 中加載 <a href="../_make/">OpenCV workspace</a>:
<ul>
<li>Microsoft Visual Studio 6.0 使用 opencv.dsw
<li>Miscrosoft Visual Studio .NET 2003 使用 opencv.sln
<li>Borland C++ BuilderX 使用 cbuilderx/opencv.bpgr
</ul>
選擇 <code>cvsample</code>
項目,編譯并運行。閱讀代碼并且按照自己的想法更改它。
<li>>也可通讀<a href="index.htm#ref">參考手冊</a> - 里面也包含一些例子代碼。
<li>
在<a href="http://groups.yahoo.com/group/OpenCV">http://groups.yahoo.com/group/OpenCV</a>OpenCV archives
搜索你感興趣的主題。
<li>
從 <a href="#devstudio_project">scratch</a>
創建新的項目,或者修改現有的 <code>cvsample</code>。
有專門為 Microsoft Visual Studio 設計的 application wizard 用來創建 OpenCV-aware 項目;
它們從 <a href="http://groups.yahoo.com/group/OpenCV">http://groups.yahoo.com/group/OpenCV</a>
(Files section - 你必須注冊為 OpenCV@yahoogroups.com 用戶)
查找到。
</ol>
</p>
<hr><h3>哪里可以報告OPENCV的BUG?</h3>
<p>發送郵件到 <a href="mailto:OpenCV@yahoogroups.com">OpenCV@yahoogroups.com</a> ;
主題:BUG <....your title...>;</p>
<hr><h3>怎么報告 Intel® Ingegrated Performance Primitives 的BUG?</h3>
<p>發送有件到 <a href="mailto:developer_support@intel.com">developer_support@intel.com</a></p>
<hr><h3>怎么加入 OpenCV 論壇?</h3>
<p>發送郵件到 <a href="mailto:OpenCV-subscribe@yahoogroups.com">OpenCV-subscribe@yahoogroups.com</a>,
成為成員后并登錄后,你可以在
<a href="http://groups.yahoo.com/group/OpenCV">http://groups.yahoo.com/group/OpenCV</a>閱讀內容。</p>
<p>譯者注:<a href="http://www.assuredigit.com">阿須數碼技術有限公司</a>
設立了一個<a href="http://www.assuredigit.com/forum">中文OPENCV論壇</a>,可以在那里找到很多有用資料。</p>
<hr><h3>怎么修改用戶組設置使得不再收到大量郵件?</h3>
<p>
想實時獲得郵件,或者一天只接收一次郵件摘要,
可以訪問<a href="http://groups.yahoo.com/mygroups" target="_top">http://groups.yahoo.com/mygroups</a>
可以從OpenCV的下拉選單中選擇你的設置。</p>
<hr><h3>好,我發現用戶組一點沒用。如何退掉我訂閱的郵件列表?</h3>
<p>發送標題為<b>[OpenCV]</b>的郵件到
<a href="mailto:OpenCV-unsubscribe@yahoogroups.com">OpenCV-unsubscribe@yahoogroups.com</a>
郵件體內容可以任意。</p>
<hr><h3>當同時使用 OpenCV 和 IPL,發生編譯錯誤。怎么解決這個問題?</h3>
<p>
為了完全獨立于 IPL (INTEL的圖像處理庫), OpenCV 復制了 IplImage
和其它一些結構變量的聲明。 在 OpenCV 頭前面定義 HAVE_IPL
或者將語句 "#include <ipl.h>" 放置于 OpenCV
頭文件的前面,可以解決這個沖突。</p>
<hr><h3>OpenCV 可以工作在其它處理器下嗎?</h3>
<p>
是的,OpenCV 本身是開放源代碼的,而且非常便于移植(特別是在32位平臺上)。
從另外一方面看,如果采用 INTEL 處理器,那么依靠 <a href="index.htm#ipp">IPP</a> ,OpenCV
可以運行得更快。</p>
<hr><h1>Windows® 操作系統的相關問題:</h1>
<hr>
<h3>
當我試圖編譯其中的應用程序時,得到錯誤:streams.h not found.</h3>
<p>你需要 DirectShow SDK ,它是 DirectX SDK 的一部分。</p>
<ol>
<li>
從 msdn.microsoft.com/directx/ 下載 DirectX,(文件很大,但是可以只下載部分)。
如果不能正常工作,考慮一下 HighGUI,它利用 VFW 或 MIL 來撲捉視頻序列。
<li>>帶例子安裝。
<li>打開項目 <DirectXSDKInstallFolder>\samples\C++\DirectShow\BaseClasses\baseclasses.{dsw|sln}.
如果沒有這個文件,要么是你沒有下載樣例,要么是路徑不對。
如果是后者,尋找 streams.h 并在同一個文件夾下打開一個 workspace 文件。
<li>編譯建立庫的 Release 和 Debug 版本。
<li>將產生的庫 (在 DirectX 9.x 中,分別叫 strmbase.lib 和
strmbasd.lib) 拷貝到目錄 <DirectXSDKInstallFolder>\lib 下。
<li>在 Developer Studio 添加路徑:<p>
<DirectXSDKInstallFolder>\include<br>
<DirectXSDKInstallFolder>\samples\C++\DirectShow\BaseClasses<br>
</p>
<p>到 includes' 搜索路徑中 (在 Developer Studio 6.0 情況下是 Tools->Options->Directories->Include files)</p>
<p>添加 <DirectXSDKInstallFolder>\lib 到庫搜索路徑中 (在 Developer Studio 6.0 情況下是 Tools->Options->Directories->Library files)
</p>
<p><b>注意:將上面增加的東東添加到最頂端,否則還會出現編譯或鏈接錯誤。
因為 Developer Studio 6.0 包含了一些老版本的 DirectX 頭文件和庫文件,它們與新版本有沖突。</b></p>
<li>大功告成!
</ol>
<hr><h3>安裝了 DirectX SDK 后,仍然有鏈接錯誤,提示:undefined
or redefined "TransInPlace" filter class constructors etc.</h3>
<p>閱讀前面的示范,特別注意搜索目錄的次序。</p>
<hr><h3>當我試圖使用 cvcam 時, 程序崩潰</h3>
<p>請確認是否已經注冊了 ProxyTrans.ax 和 SyncFilter.ax</p>
<!-- <hr><h3>CamShiftDemo can not be run</h3>
<p>Make sure, you registered CamShift.ax and you have DirectShow-compatible camera</p> -->
<hr><h3>怎么注冊 *.ax (DirectShow filter)?</h3>
<p>在“資源管理器”中用regsvr32.exe打開這個文件。
在 Win2000 中可以通過右鍵點擊Open with->Choose Program...->Browse...->c:\windows\system32\regsvr32.exe
(路徑可能有所差別)。
你可以讓計算機記住*.ax跟regsvr32.exe的聯系,以后雙擊*.ax則可。</p>
<hr><h3>Filter 不能被注冊 (regsvr32 報告錯誤)</h3>
<p>最可能的原因是 filter 需要的一些 DLLs
不在路徑中。這種情況下,請確認 <OpenInstallFolder>\bin 在路徑中。<p>
<!-- <hr><h3>LKDemo / HMMDemo reports an error during startup and no the view is completely black</h3>
<p>To run either of these apps you will need VFW-compatible camera.
At startup the programs iterate through registered video capture devices.
It might be that they could not find one. Try to select the camera manually
by pressing "tune capture parameters" (camera) toolbar button. Then, try to
setup video format (the button on the left from camera) to make the camera work.
</p> -->
<hr><h3>cxcore096d.dll 或 cxcored.lib 好像丟失了</h3>
<p>cxcore096d.dll 是 cxcore DLL 的 DEBUG 版本,cxcored.lib 是
cxcore096d.dll 的輸入庫。打開Open <a href="../_make/">OpenCV workspace</a>,
選擇 "cxcore" 作為 active project,并且選擇 "Win32 Debug"
的配置. 編譯建立庫,這樣就得到 bin\cxcore096d.dll 和
lib\cxcored.lib。 同樣步驟可以生成其它所有的 OpenCV 組件。加 <em>d</em>
表示 Debug 版本。</p>
<hr><h3>當我編譯 HighGUI ,得到錯誤 "mil.h is not found"</h3>
mil.h 是 Matrox Imaging Library (MIL) 的一個部分,提供
Matrox (或兼容) 視頻采集卡,如 Meteor, Meteor II 等
<ul>
<li>如果你安裝了一個這樣的采集卡和MIL,添加 mil\include 和 mil\lib
到 Developer Studio 的搜索路徑中(菜單 Tools->Options->Directories)。
<li>如果你沒有 MIL,忽略這個錯誤則可,文件 mil.h 只是用來編譯
帶有 MIL 的 HighGUI "Win32 MIL Debug" 或者 "Win32 MIL Release"。
選擇HighGUI的 "Win32 Debug" 或者 "Win32 Release" 的配置
(菜單 Build->Set Active Configuration...)來代替,
這兩個版本的HighGUI仍然能夠通過 VFW 借口采集視頻,處理 AVI 文件和靜態圖像。
</ul>
<hr><h3>如何調試 DirectShow filter?</h3>
<p><ul>
<li>打開帶 FILTER 的 workspace (e.g. opencv.dsw),
<li>選擇 filter 作為活動項目,在 debug 配置下編譯它,
<li>切換到“資源管理器”,注冊 filter 的 debug 版本
(例如 regsvr32 camshiftd.ax)(當 debug/release 版本切換的時候,只需要做一次就可以了,注冊表里僅保存
filter 的名字),
<li>回到 Developer Studio 然后開始 debugging 過程 (F5)。
在提示 “do you want to run to debug the
module”下,選擇 camshiftdemo 通過 camshift.ax 和
DirectX SDK 工具圖形編輯器 graphedit 來調試 DirectShow filter。
<li>在 graphedit 中建立 filter 圖 (即 camera->camshift->renderer)
<li>保存 graph (下次只要打開就可以了)
<li>在filter中的 Transform 方法或其它位置設置斷點。
<li> 運行 filter,好好體會吧。
</ul>
<hr><h3><a name="devstudio_project">怎么創建一個 DeveloperStudio 項目來開始玩 OpenCV</a></h3>
<p>(注意:這是一個很羅嗦的解答)</p>
<p>為了在 Developer Studio
下創建基于 OpenCV 的項目,按如下步驟進行:</p>
<ol>
<li>在 Developer Studio 中創建新的應用程序:
<ol>
<li>選擇菜單 "File"->"New..."->"Projects" 標簽。
選擇 "Win32 Application" 或者 "Win32 console application" -
后者是簡單的方法,例程都采用這種類型。
<li>鍵入項目名稱,并且選擇保存位置。
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -