Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vfdev-5/ocv_pipeline

OpenCV filters are managed using a pipeline for webcam image processsing; VideoInput library is used
https://github.com/vfdev-5/ocv_pipeline

Last synced: 11 days ago
JSON representation

OpenCV filters are managed using a pipeline for webcam image processsing; VideoInput library is used

Awesome Lists containing this project

README

        

OCV_pipeline
============

OpenCV filters are managed using a pipeline for webcam image processsing. VideoInput library is used for camera configuration.

Idea is to use a wrapper over OpenCV functionalities as a chain of filters:
Example:

// camera handling choice:
CameraCapture_VideoInput cameraCapture;

// filters:
ImageAbstractFilter * motionDetectionFilter = new MotionDetectionFilter();
ImageAbstractFilter * histMotionDetectionFilter = new HistMotionDetectionFilter();
ImageAbstractFilter * logicalAND = new MathBinaryOpFilter(MathBinaryOpFilter::AND);
ImageAbstractFilter * morphoClose = new MorphoFilter(3, MORPH_ELLIPSE, MORPH_CLOSE);
ImageAbstractFilter * morphoOpen = new MorphoFilter(3, MORPH_ELLIPSE, MORPH_OPEN);

// Pipeline:
Pipeline pipeline;

pipeline.addSplit(1);
pipeline.addFilter(1, motionDetectionFilter);
pipeline.addFilter(2, histMotionDetectionFilter);

PipelineInput in(1,2);
pipeline.addFilter(in, logicalAND);

pipeline.addFilter(1, morphoOpen);
pipeline.addFilter(1, morphoClose);

// Set keyboard handler:
KeyboardHandle keyHandler;
string path = "data/";
keyHandler.addKey('p', KeyboardHandle::SAVE_MATRIXDATA_ON_DISK, 0, path + "template_image.yml");
keyHandler.addKey('p', KeyboardHandle::SAVE_IMAGE_ON_DISK, 0, path + "template_image.jpg");
keyHandler.addKey('p', KeyboardHandle::SAVE_MATRIXDATA_IN_BUFFER, 0, "templ");
keyHandler.addKey('l', KeyboardHandle::LOAD_MATRIXDATA_FROM_DISK_INTO_BUFFER, "templ", path + "template_image.yml");

// Run camera capture:
cameraCapture.setPipeline(&pipeline);
cameraCapture.setKeyboardHandler(&keyHandler);
cameraCapture.run();