Texturer 貼圖
Coordinate 座標

--------------------------------------------------------------
搜尋:OpenCV 2.1
點 OpenCV - Browse /opencv-win/2.1 at SourceForge.net

下載 OpenCV-2.1.0-win32-vs2008.exe

選擇 Add OpenCV to the system PATH for all uers

開啟 Codeblock 的 Console application 專案

打入程式碼↓↓↓↓↓
#include <opencv/highgui.h>///使用OpenCV的HIGH GUI介面
int main()
{
IplImage * img=cvLoadImage("image.jpg");///讀圖檔
cvShowImage("opencv Window", img);///秀圖
cvWaitKey(0);///等你 按鍵
}

Week08_OpenCV 右鍵 > Buid options...

點 Search directories > Compiler > Add > c:\OpenCV2.1\include

點 Search directories > Linker > Add > c:\OpenCV2.1\lib

點 Search directories > Linker settings > Add > cv210 , cxcore210 , highgui210

把要的圖片存到 Week08_OpenCV

執行結果↓↓↓↓↓

--------------------------------------------------------------
開啟新的 GLUT 專案
打入程式碼↓↓↓↓↓
#include <GL/glut.h>
#include <opencv/highgui.h>///貼圖texture
void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutSolidTeapot(0.3);
glutSwapBuffers();
}
int main(int argc, char ** argv)
{
IplImage * img = cvLoadImage("earth.jpg");///貼圖texture
cvShowImage("another window", img);///貼圖texture
cvWaitKey(0);///貼圖texture
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("week08 texture");
glutDisplayFunc(display);
glutMainLoop();
}

Week08_texture 右鍵 > Buid options...

點 Search directories > Compiler > Add > c:\OpenCV2.1\include
點 Search directories > Linker > Add > c:\OpenCV2.1\lib
點 Search directories > Linker settings > Add > cv210 , cxcore210 , highgui210
把要的圖片存到 freeglut > bin 裡
執行結果↓↓↓↓↓
沒有留言:
張貼留言