把一个通用视频模块注册到视频输入模块
为了获得视频缓冲区,您必须先订阅至VIM,提供进程所需的图像格式。
// First you have to choose a name for your GVM string GVM_name = "tutorial_GVM"; // Then specify the resolution among : kVGA ( 640 * 480 ), kQVGA ( 320 * 240 ), // kQQVGA ( 160 * 120 ). // (For definitions, have a look at alvisiondefinitions.h and alimage.h) int resolution = kVGA; // Then specify the color space desired among : kYuvColorSpace, kYUVColorSpace, // kYUV422InterlacedColorSpace, kRGBColorSpace. int colorSpace = kRGBColorSpace; // Finally, select the minimal number of frames per second (fps) that your // vision module required among : 5, 10, 15, and 30 fps. // (note: this field has no effect right now but will be implemented in a future version) int fps = 15; // You only have to call the "subscribe" function with those parameters and the // VIM will be responsible for driver initialisation and buffer's management. GVM_name = cameraProxy->call<std::string>( "subscribe", GVM_name, resolution, colorSpace, fps );