2019年4月11日 星期四

Week08-04160453

1.主題;貼圖Texture

下載windows3個檔案打開Texture檔案

2.實作:OpenCV

去網站:https://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.1/

並且安裝好


#include <stdio.h>
#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("earth.png");
    cvShowImage("opencv Window",img);
    cvWaitKey(0);

    glutInit(&argc,argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
    glutCreateWindow("week08");

    glutDisplayFunc(display);
    glutMainLoop();
}

右鍵點Build options
Search drectones>Add>C:\OpenCV2.1\include
Link>Add>C:OpenCV2.1\lib
Linker settings>Add>cv210      
                                   cxcore210
                                   highgui210




沒有留言:

張貼留言