
分隔線
------------------------------------------------------------------------------------------------------
以下正文
今天的主題是「貼圖」
照慣例的要從老師給的網址
[http://www.cmlab.csie.ntu.edu.tw/~jsyeh/3dcg10/]
下載3個東西
[win32][glut32.dll][data]
下載OpenCV 2.1.0 的檔案
選第一個網頁中名子最長的exe檔
以下附上連結
[https://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.1/OpenCV-2.1.0-win32-vs2008.exe/download]
安裝時要注意在選擇要勾選
[add opencv to the system PATH for all user]
以上選項
以下是主要程式碼
#include <opencv/highgui.h>
int main()
{
IplImage*img=cvLoadImage("image.jpg");
cvShowImage("opencv Window",img);
cvWaitKey(0);
}
要在codeblock中設定opencv的bin以及include
方法如下
在專案上點擊右鍵
選擇Build Options
進入視窗後
在Search directories中設定Compiler
加入c:\opencv2.1\include
在Search directories中設定Linker
加入c:\opencv2.1\lib
在Linker settings中加入三個要素
cv210
cxcore210
highgui210
設定完成後
再去下載圖檔
名字要設定成image.jpg才能運行程式碼
接著,開第二個專案
這次使用glut的開發環境
要去下載transmissionzero下載
[https://www.transmissionzero.co.uk/files/software/development/GLUT/freeglut-MinGW.zip]
之後在設定環境開發時也需要像上面的專案一樣進行設定
之後就能跑出一張圖片跟一個茶壺的檔案
後來因為上課時間到了的關係
小葉老師有直接給我們完成品的程式碼
以下連結
[https://ppt.cc/fnjUhx]
下課ㄌ
大家ㄅㄅ

小葉老師的英文時間
texture---貼圖
coordinate---座標
沒有留言:
張貼留言