Week10
本次以複習為主軸
Work01-開啟地球旋轉圖
第一步:先下載openCV 2.1版本
第二步:安裝openCV,在Install Options選擇 Add OpenCV to the system PATH
第三步:將myearth and freeglut 解壓縮於桌面後,
將C:\Users\USER\Desktop\freeglut\bin中的freeglut.dll 放入myearth的資料夾中
Work02-從程式中開啟地球旋轉圖
第一步:開啟myEarth.cbp

第二步:於左方專案中,按右鍵開啟Build Option

第三步:設定找尋openCV與freeglut的位置及檔案
注意:請選擇絕對位置,不要選相對位置
3-1
Linker settings中加入
cv210
cxcore210
highgui210

第二步:於左方專案中,按右鍵開啟Build Option

第三步:設定找尋openCV與freeglut的位置及檔案
注意:請選擇絕對位置,不要選相對位置
3-1
Linker settings中加入
cv210
cxcore210
highgui210
3-2
在Search directories的Compiler中加入
openCV中include資料夾的位置
freeglut中include資料夾的位置
在Search directories的Compiler中加入
openCV中include資料夾的位置
freeglut中include資料夾的位置
3-3
在Search directories的Linker中加入
openCV中lib資料夾的位置
freeglut中lib資料夾的位置
在Search directories的Linker中加入
openCV中lib資料夾的位置
freeglut中lib資料夾的位置
第四步:按Build建置
接下來會有兩種啟動方式
方式一:將位於myEarth資料夾中bin/Debug/myEarth.exe拉出到與myEarth.cbp相同平面的資料夾
方式一:將位於myEarth資料夾中bin/Debug/myEarth.exe拉出到與myEarth.cbp相同平面的資料夾
方式二:
先將image.jpg放置於freeglut/bin資料夾中
第二步:選擇C++
第三步:將新專案中位於main,cpp的程式碼刪除,將原本位於myEarth的程式碼複製到新專案的main,cpp中

這時,如果直接執行的話,會因為找不到freeglut與openCV的檔案,而無法執行
因此接下來要將檔案位置與名稱告訴他
第四步:於左方專案中,按右鍵開啟Build Option
設定找尋openCV與freeglut的位置及檔案
注意:請選擇絕對位置,不要選相對位置

3-1
Linker settings中加入
cv210
cxcore210
highgui210
freeglut
glu32
gdi32
winmm
opengl32
上述7個加入於Link libraries

3-2
在Search directories的Compiler中加入
openCV中include資料夾的位置
freeglut中include資料夾的位置

3-3
在Search directories的Linker中加入
openCV中lib資料夾的位置
freeglut中lib資料夾的位置

第四步:新增檔案於指定位置
可以看到圖中說明找不到freeglut
所以將freeglut/bin/freeglut.dll複製到下方所提供的索引位置

最終步:將freeglut.dll放置到索引位置後再執行一次即可達成成果看到地球了

這時,如果直接執行的話,會因為找不到freeglut與openCV的檔案,而無法執行
因此接下來要將檔案位置與名稱告訴他
第四步:於左方專案中,按右鍵開啟Build Option
設定找尋openCV與freeglut的位置及檔案
注意:請選擇絕對位置,不要選相對位置

3-1
Linker settings中加入
cv210
cxcore210
highgui210
freeglut
glu32
gdi32
winmm
opengl32
上述7個加入於Link libraries

3-2
在Search directories的Compiler中加入
openCV中include資料夾的位置
freeglut中include資料夾的位置

3-3
在Search directories的Linker中加入
openCV中lib資料夾的位置
freeglut中lib資料夾的位置

第四步:新增檔案於指定位置
可以看到圖中說明找不到freeglut
所以將freeglut/bin/freeglut.dll複製到下方所提供的索引位置

最終步:將freeglut.dll放置到索引位置後再執行一次即可達成成果看到地球了

















沒有留言:
張貼留言