You mean you are having some problems with using OpenCv in your code, or just thinking how to do that nicely ? If its the latter, then I'd create a wrapper class(es) with nice interface, which will hide all the OpenCV stuff from client classes. What I mean is something like:
class VideoReader
: public QObject{Q_OBJECT
public:
VideoReader
( const QString
& file,
QObject * parent
= NULL );
... /// information
int frameCount() const;
... // other methods, like video fps etc
/// capture methods
QImage getFrame
( int frameNumber
) const;
// or return QPixmap, or your own Image class ...
};
class VideoReader : public QObject{
Q_OBJECT
public:
VideoReader( const QString& file, QObject * parent = NULL );
... /// information
int frameCount() const;
QSize frameSize() const;
... // other methods, like video fps etc
/// capture methods
QImage getFrame( int frameNumber ) const; // or return QPixmap, or your own Image class
...
};
To copy to clipboard, switch view to plain text mode
It's always better to have class with good interface, than C-style OpenCv api calls all over the code. I think you get the idea.
Bookmarks