#include"ac.h" extern "C" void filter(cv::Mat &frame) { static constexpr int MAX = 8; static ac::MatrixCollection<MAX> collection; if(collection.empty()) collection.shiftFrames(frame); collection.shiftFrames(frame); cv::Mat diff; absdiff(collection.frames[0], collection.frames[1], diff); for(int z = 0; z < frame.rows; ++z) { for(int i = 0; i < frame.cols; ++i) { cv::Vec3b &pixel = ac::pixelAt(frame, z, i); cv::Vec3b pix = diff.at<cv::Vec3b>(z, i); if(pix[0]+pix[1]+pix[2] > 15) { pixel[0] = 255; pixel[1] = 255; pixel[2] = 255; } } } }