一.下載OpenCV2.1 vs2008.exe
https://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.1/
下載第二個


安裝C://OpenCV2.1,要勾PATH

開GLUT專案
打上
include <openCV/highgui.h>
int main(){
IplImage * img=cvLoadImage("C:\\Users\\Public\\Pictures\\Sample Pictures\\tulips.jpg");//圖片所在位址,可改
cvNamedWindow("opencv");
cvShowImage("opencv",img);
cvWaitKey(0);
}
檔案右鍵選擇Build options

選擇Search drectiones→ Compiler→ Add→ 選擇OpenCV2.1裡include資料夾路徑→ OK


Search drectiones→Linkerr→ Add→ 選擇OpenCV2.1裡lib資料夾路徑→ OK


Linker settings→ Linker libraries→ Add

新增cv210

新增cxcore210

新增highgui210

儲存重新開啟此檔案
Run
圖片就會被叫出來了

老師補充:地球自轉

沒有留言:
張貼留言