opt_nm33_viewer.cpp
Go to the documentation of this file.
00001 #include "opt_nm33_camera.h"
00002 #include <highgui.h>
00003 
00004 int main(int argc, char *argv[]) {
00005   int camera_index = 1;
00006   OptNM3xCamera *camera;
00007   IplImage *frame;
00008   CvMat subframe;
00009   int count = 0;
00010 
00011   if ( argc > 1 ) {
00012     camera_index = atoi(argv[1]);
00013     fprintf(stderr, "set camera_index to %d\n", camera_index);
00014   }
00015 
00016   camera = new OptNM3xCamera(camera_index);
00017   camera->setSmallHemisphere(1);
00018   camera->setLocationAbsolute(0, 0, 0, 0,   0);
00019   camera->setLocationAbsolute(1, 0, 0, 0,  40);
00020   camera->setLocationAbsolute(2, 0, 0, 0, 120);
00021 
00022   cvNamedWindow("Opt NM33 Camera 0", CV_WINDOW_AUTOSIZE);
00023   cvNamedWindow("Opt NM33 Camera 1", CV_WINDOW_AUTOSIZE);
00024   cvNamedWindow("Opt NM33 Camera 2", CV_WINDOW_AUTOSIZE);
00025   cvNamedWindow("Opt NM33 Camera 3", CV_WINDOW_AUTOSIZE);
00026 
00027   //cvSetMouseCallback ("Opt NM33 Camera 0", on_mouse);
00028 
00029   while (1)  {
00030     frame = camera->queryFrame();
00031     fprintf(stderr, "get frame: channels=%d, depth=%d, width=%d, height=%d\n",
00032             frame->nChannels, frame->depth, frame->width, frame->height);
00033 
00034     cvShowImage ("Opt NM33 Camera 0", camera->queryOmniFrame());
00035 
00036     cvShowImage ("Opt NM33 Camera 1", camera->queryWideFrame());
00037 
00038     cvShowImage ("Opt NM33 Camera 2", camera->queryMiddleFrame());
00039 
00040     cvShowImage ("Opt NM33 Camera 3", camera->queryNarrowFrame());
00041 
00042     float f = (float)count/20.0;
00043     camera->setLocationAbsolute(2, 180*sin(f), 45*sin(f+M_PI/3)+45, 180*sin(f+M_PI/2), 50*sin(f*2)+100);
00044 
00045     char c = cvWaitKey (2);
00046     if (c == '\x1b')
00047       break;
00048     count++;
00049   }
00050 }


opt_camera
Author(s): Kei Okada
autogenerated on Mon Oct 6 2014 10:58:46