Skip to content

Create Your Own Input Class

Andrés Solís Montero edited this page Oct 18, 2015 · 1 revision

The Input class is an abstract class defined in the "input.h" header. To create an input compatible with the vivalib framework you need to create a derived class from Input and implement the bool getFrame(Mat &image) method.

The Input Class:

 class Input
    {
    protected:
        Size _size;
        bool _convert;
        int _conversionFlag;
        
    public:
        Input(const Size &size = Size(-1, -1), int conversionFlag = -1):
                _size(size), _convert(false), _conversionFlag(conversionFlag)
        {
            if (_conversionFlag != -1)
                _convert = true;
        }
        
        virtual bool  getFrame(Mat &image) = 0;
        
        virtual ~Input(){}
        
    };

Clone this wiki locally