Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Background Subtraction using running average in opencv !!!

Hi, everybody ! i need sourecode c++.. please help me.. thank you so much !!

Background Subtraction using running average in opencv !!!

Hi, everybody ! i need sourecode c++.. please help me.. 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);

    // Scale it to 8-bit unsigned
    convertScaleAbs(accumulator, scaled);

    imshow("Original", frame);

    imshow("Weighted Average", scaled);

    waitKey(1);
}

}

Background Subtraction using running average in opencv !!!

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);
0.5); //error in hereeeeee!

    // Scale it to 8-bit unsigned
    convertScaleAbs(accumulator, scaled);

    imshow("Original", frame);

    imshow("Weighted Average", scaled);

    waitKey(1);
}

}

Background Subtraction using running average in opencv !!!

Hi, everybody ! i used Background Subtraction using running average, but i can't runnn ! thank you so much !!

include "opencv2/opencv.hpp"

#include "opencv2/opencv.hpp"
  

using namespace cv;

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);
}

}

Background Subtraction using running average in opencv !!!opencv

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);
}

}

}