今天老師教了一個單字:Texture(貼圖)
下載OpenCV
https://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.1/
安裝 勾選第二個
建立專案(Console application)
打好程式碼
#include <opencv/highgui.h>
int main()
{
IplImage * img=cvLoadImage("image.jpg");///讀圖檔
cvShowImage("opencv Window", img);///秀圖
cvWaitKey(0);///
}
開啟GLUT專案 (前置作業之前的PO文都有)
打程式碼
#include <GL/glut.h>
#include <opencv/highgui.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutSolidTeapot(0.3);
glutSwapBuffers();
}
int main(int argc, char ** argv)
{
IplImage * img=cvLoadImage("image.jpg");///讀圖檔
cvShowImage("opencv Window", img);///秀圖
cvWaitKey(0);///
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("week08_texture");
glutDisplayFunc(display);
glutMainLoop();
}
沒有留言:
張貼留言