Vision System for Industrial Robots

9. Software: Camera_Image and Camera_Configuration modules
Update #10191  |  13 Apr 2015

Camera_Image application

This is a core class responsible for cycling taking image from camera. Basic application of module is allow to display and process image by other classes.


Methodology - how does Camera_Image class works?

Class VideoCapture [1] from OpenCV libraries deliver all functions to work with camera. With open(0) function I initialize device in constructor and then read image in public slot function. Method that read frame is connected with QTimer [2] and both are placed in separate QThread [3] for best application performance. This approach allow to use all processor power and keep program running smooth. When in some other module is need for actual image, I just simply pass address of Camera_Image object and call function that return value from variable that is responsible for keeping image.


Camera_Configuration application

This class is needed because auto calibration options give very poor results and can change image colors in time what is unacceptable. Thanks to this module camera can be adjusted to specific environment and achieve very good stable image quality. Module deliver save option so configuration can be done once and after system will be restarted all settings will be automatically retrieved. Module have its own window with live preview that allow to see effect of changes.


Camera Configuration user interface


Methodology - how does Camera Configuration class works?

Communication between camera settings controller and application is possible thanks to QProcess [4] that after user hit “Calibrate” button start parametrized v4l2-ctl [5] program that can directly communicate with camera and change settings. The most common issue  when interacting with camera by changing its settings is that camera can stuck and don’t respond. To get rid of this issue whole application is starting and closing with few seconds delay. Idea is to wait for camera hardware to start before sending information about new parameters and allow Camera_Configuration reset settings to default when system is turning down.