opt_nm33_viewer.cpp
Go to the documentation of this file.
1 #include "opt_nm33_camera.h"
2 #include <highgui.h>
3 
4 int main(int argc, char *argv[]) {
5  int camera_index = 1;
6  OptNM3xCamera *camera;
7  IplImage *frame;
8  CvMat subframe;
9  int count = 0;
10 
11  if ( argc > 1 ) {
12  camera_index = atoi(argv[1]);
13  fprintf(stderr, "set camera_index to %d\n", camera_index);
14  }
15 
16  camera = new OptNM3xCamera(camera_index);
17  camera->setSmallHemisphere(1);
18  camera->setLocationAbsolute(0, 0, 0, 0, 0);
19  camera->setLocationAbsolute(1, 0, 0, 0, 40);
20  camera->setLocationAbsolute(2, 0, 0, 0, 120);
21 
22  cvNamedWindow("Opt NM33 Camera 0", CV_WINDOW_AUTOSIZE);
23  cvNamedWindow("Opt NM33 Camera 1", CV_WINDOW_AUTOSIZE);
24  cvNamedWindow("Opt NM33 Camera 2", CV_WINDOW_AUTOSIZE);
25  cvNamedWindow("Opt NM33 Camera 3", CV_WINDOW_AUTOSIZE);
26 
27  //cvSetMouseCallback ("Opt NM33 Camera 0", on_mouse);
28 
29  while (1) {
30  frame = camera->queryFrame();
31  fprintf(stderr, "get frame: channels=%d, depth=%d, width=%d, height=%d\n",
32  frame->nChannels, frame->depth, frame->width, frame->height);
33 
34  cvShowImage ("Opt NM33 Camera 0", camera->queryOmniFrame());
35 
36  cvShowImage ("Opt NM33 Camera 1", camera->queryWideFrame());
37 
38  cvShowImage ("Opt NM33 Camera 2", camera->queryMiddleFrame());
39 
40  cvShowImage ("Opt NM33 Camera 3", camera->queryNarrowFrame());
41 
42  float f = (float)count/20.0;
43  camera->setLocationAbsolute(2, 180*sin(f), 45*sin(f+M_PI/3)+45, 180*sin(f+M_PI/2), 50*sin(f*2)+100);
44 
45  char c = cvWaitKey (2);
46  if (c == '\x1b')
47  break;
48  count++;
49  }
50 }
IplImage * queryFrame()
IplImage * queryOmniFrame()
IplImage * queryWideFrame()
f
IplImage * queryNarrowFrame()
int main(int argc, char *argv[])
bool setLocationAbsolute(int no, int pan, int tilt, int roll, int zoom)
bool setSmallHemisphere(char value)
IplImage * queryMiddleFrame()


opt_camera
Author(s): Kei Okada
autogenerated on Tue May 11 2021 02:55:43