2016年4月11日 星期一

野比大雄的翻花繩教室week08

課堂作業1:

下載OpenCV 2.1 vs2008.exe
安裝並勾選Add OpenCV to the system PATH for all user




打開GLUT專案main.cpp
打上以下程式

------------------------------------今日程式------------------------------------


#include <opencv/highgui.h>

int main()

{

    IplImage * img=cvLoadImage("c:\\Users\\Public\\Pictures\\Sample Pictures\\tulips.jpg");

    cvNamedWindow("opencv");

    cvShowImage("opencv",img);

    cvWaitKey(0);

}

// IplImage 為IPLIMAGE

-------------------------------------------------------------------------------------


點專案右鍵

選取Bulid  options...

點Linker Setting
加入 cv210 cxcore210 highgui210 三個"咒語"


再點Search directories
裡頭的Compiler 和 Linker
分別加入兩個路徑
....OpenCV2.1\include
....OpenCV2.1\lib 


記得重新開啟CodeBlocks
才能展現


課堂作業2:

貼上老師給的程式碼展示地球
記得要把圖檔 earth1.jpg 丟到 freeglut 裡的bin資料夾

沒有留言:

張貼留言