As we did in other recipes, our objective was to create a class that encapsulates the common functionalities of a video-processing algorithm. As you might expect, the class includes several member variables that control the different aspects of the video frame processing:
class VideoProcessor { private: // the OpenCV video capture object cv::VideoCapture capture; // the callback function to be called // for the processing of each frame void (*process)(cv::Mat&, cv::Mat&); // a bool to determine if the // process callback will be called bool callIt; // Input display window name std::string windowNameInput; // Output display window name std::string windowNameOutput; // delay between each frame processing int delay; // number ...