#include #include #include #include #include #include "tsai.h" #include "gl.h" /*************************************************************/ /** Main */ int main( void ) { CvPoint2D32f corners[48]; int resp; int corners_count; int flags=CV_CALIB_CB_ADAPTIVE_THRESH; int pattern_was_found=0; CvArr* FrameSaida; int a,i,j,z; double f; double T[3]; double r[9]; double pr[16]; double mv[16]; double pontos_mundo_x[48]; double pontos_mundo_y[48]; double pontos_tabuleiro_x[48]; double pontos_tabuleiro_y[48]; IplImage* Frame = NULL; CvCapture* capture = NULL; cvNamedWindow( "Video Inicial", CV_WINDOW_AUTOSIZE ); cvNamedWindow( "Video Final", CV_WINDOW_AUTOSIZE ); capture = cvCaptureFromAVI("c:\users\gattass\publichtml\ra\videos\videosTeoricamenteMelhores1.avi"); if( !capture ) { fprintf(stderr,"Could not initialize capturing...\n"); return -1; } while(1) { Frame = cvQueryFrame( capture ); FrameSaida = cvCloneImage(Frame); resp = cvFindChessboardCorners(Frame, cvSize(8,6),&corners[0], &corners_count,flags); cvDrawChessboardCorners(FrameSaida,cvSize(8,6),corners,corners_count,pattern_was_found); cvShowImage("Video Inicial", Frame ); cvShowImage("Video Final", FrameSaida ); if(cvWaitKey(1) >= 0) break; } /***********************************************************/ cvReleaseCapture( &capture ); cvDestroyWindow("Video Inicial"); cvDestroyWindow("Video Final"); return 0; }