Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Background Subtraction using running average in opencv

$
0
0
Hi, everybody ! i used Background Subtraction using running average, but i can't runnn ! thank you so much !! #include "opencv2/opencv.hpp" using namespace cv; int main() { VideoCapture cap(0); // open the default camera if (!cap.isOpened()) // check if we succeeded return -1; // Variables Mat frame; Mat accumulator; Mat scaled; // Initialize the accumulator matrix accumulator = Mat::zeros(frame.size(), CV_32FC3); while (1) { // Capture frame cap >> frame; // Get 50% of the new frame and add it to 50% of the accumulator accumulateWeighted(frame, accumulator, 0.5); //error in hereeeeee! // Scale it to 8-bit unsigned convertScaleAbs(accumulator, scaled); imshow("Original", frame); imshow("Weighted Average", scaled); waitKey(1); } }

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>