2024年3月18日 星期一

week05.0313

#week05

##OpenCV

1. 安裝 OpenCV 2.1

2. 記得安裝第三步,add openCV to system PATH

3. 目錄不要改,用預設的 C:\OpenCV2.1

4. 檔案總管檢查 C:\ 多了 OpenCV2.1 目錄裡面有 include 有 lib 有 bin

5. 關閉 CodeBlocks 再開,才會認識OpenCV

接下來要做CodeBlocks的設定

1. Setting-Compiler, 目錄 compiler 要加入 include 目錄

2. Setting-Compiler, 目錄 linker 要加入 lib 

3. Setting-Compiler Setting, linker setting 要加入 

cv210  cxcore210  highgui210 三個檔名


要寫OpenCV的程式,只要在 CodeBlocks新增空白檔案就好


##week05-1_opencv.cpp


##課本範例-貼圖

連上網站 https://jsyeh.org/3dcg10/ 下載 data win32

windows.zip 下載 windows\Texture.exe

data.zip 下載 windows\一堆圖檔

跑範例,觀察

cpp

glBegin(...);

    glTexCoord2f (tx, ty); glVertex2f (x, y);

    glTexCoord2f (tx2, ty2); glVertex2f (x2, y2);

    glTexCoord2f (tx3, ty3); glVertex2f (x3, y3);

    glTexCoord2f (tx4, ty4); glVertex2f (x4, y4);

glEnd();


##week05-1_texture_opencv_cvLoadImage

安裝 freeglut 開專案

##week05-2_texture_teapot_earth

##week05-3_texture_polygon










##week05-4_texture_earth_rotating

















沒有留言:

張貼留言