Example #1
0
int find_guide()
{
    Planet *g;
    
    g = new Planet();
   
    printf("x1\n"); 
    ui_setup();
    hack_gain_upd(g);
    printf("x2\n"); 
    startCapture();
   
    FILE *out;

    char buf[512];
	
    //sprintf(buf, "/media/benoit/18A6395AA6393A18/video/bias_%ld.ser", time(0));
    //out = fopen(buf, "wb"); 
    //write_header(out, g->width, g->height, 1000);
    int cnt = 0;

    Mat resized;
    printf("x3\n"); 
    
    while(1) {
	g->GetFrame();

	ushort *src;

	src = (ushort*)g->image.ptr<uchar>(0);
	
	cnt++;	
        

	float scale = 1.0;	
	if (g->frame % 1 == 0) { 
		g->MinDev();	
        	center(g->image);	
		resize(g->image, resized, Size(0, 0), scale, scale, INTER_AREA);
		center(resized); 
		cv::imshow("video",  resized);
        	char c = cvWaitKey(1);
        	hack_gain_upd(g);
        
		if (c == 27) {
			stopCapture();
            		closeCamera();
	    		return 0; 
        	}
   	} 
    }	
}