Please note that it is not included in Python and Java versions of OpenRTM-aist. On Linux, build and install it according toOpenCV Sample Code Build Procedure
By starting ImageSubtraction component, the background image is extracted from the input image, the foreground image part is output as a mask image and the background image is output. Used with OpenCVCamera and CameraViewer component. (Note that this component currently does not work properly in a Windows environment, so please use it in Linux (Ubuntu 18.04) environment.)
ImageSubtraction is a component for extracting the background image from the input image. Here, it is used together with OpenCVCamera for capturing images from USB Camera and CameraViewer component for displaying processed images.
$ cd ImageProcessing/opencv/bin $ ./CameraViewerComp
$ cd ImageProcessing/opencv/bin $ ./OpenCVCameraComp
$ cd ImageProcessing/opencv/bin $ ./ImageSubtractionComp
Parameter name | meaning |
control_mode | b and m can be selected. In the case of b, the background image is captured according to the key event. In the case of m, the mode switches between DYNAMIC_MODE, which determines the threshold a pixel by a pixel, and CONSTANT_MODE, which uses one threshold for the entire screen. |
image_height | Specifies the number of pixels in the vertical direction, but does not work in this sample. |
image_width | Specifies the number of pixels in the horizontal direction, but does not work in this sample. |
threshold_coefficient | Coefficient used in DYNAMIC_MODE |
constant_threshold | Threshold used in CONSTANT_MODE |