Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

sum a sequence of frames using opencv/c++

I want to sum all values in 4 frames in real-time. current frame and 3 frames before that. To do that, every time that current farme is produced, I store it in a vector called Nframe. This is what I have done until now but seems incorrect..

float *amp;   //points to the current frame
vector<float *>Nframe;

   for(int i=0; i<4; i++){
           Nframe.push_back(amp);
        }

         int sum_of_elems=0;
         for(std::vector<int>::iterator j=Nframe.begin();j!=Nframe.end();++j){
         sum_of_elems += *j;
         }