OpenCV安裝、讀圖
OpenGL貼圖設定
範例:轉動的地球
學習設定openCV專案
1. 到網站下載以下壓縮檔:data、windows、glut32、source,並解壓縮。2. 把data資料夾及glut32.dll放入windows資料夾,以成功執行檔案。
3. google keyword "opencv 2.1",下載OpenCV-2.1.0-win32-vs2008.exe
(可在moodle找到),看連結安裝說明並安裝。
4. 選擇第3個選項
路徑不用改變
5. 安裝完openCV後,codeblocks開新專案。
file -> new -> project -> console application
6. 貼上以下程式碼
7. 下載earth.jpg圖片,並存在專案資料夾。

8. 在codeblocks左方專案名稱上方按右鍵->Build options->Search directories做設定。
Search directories->Compiler->Add directory : c:\opencv2.1\include
Search directories->Linker->Add directory : c:\opencv2.1\lib
Linker setting->Add library : cv210
Linker setting->Add library : cxcore210
Linker setting->Add library : highgui210
9. 此時執行檔案,便可成功展示圖片。

1. 開新GLUT專案,重複上述步驟8做設定,即可成功於此撰寫openCV程式。
2. 把earth.jpg也存到freeglut->bin當中。
老師的程式碼:
3. (參考moodle上老師的專案)
沒有留言:
張貼留言