Ask Your Question

Revision history [back]

Hi Berak,

Here is the portion of code that needed to be adapted to work around this issue. I had to not do the operation if it is empty. Hope it helps.

     const int buffSize[] = { numCols, numRows };
     Mat tmpcv_dBuffnew = Mat::zeros(2, buffSize, CV_32FC1);
     //Mat tmpcv_dBuffnew = tmpcv_dBuff0 - tmpcv_dBuffX;

     // if the buffer is not empty add it to the equation for use
     // OpenCV seems to have a bug in the operator overloads.  Doesn't use vectors correctly with the overload
     // Check for semi initialized values that are 0, still won't work when 0.
     if ( !cv_dBuff_v[X].empty() && 0 != cv_dBuff_v[X].at<double>(0,0) )
     {
        tmpcv_dBuffnew = cv_dBuff_v[0] - cv_dBuff_v[X];
     }
     else
     {
        if (DEBUG)
        {
           cout << "x~~~~~~~~~~dBuff_X is empty~~~~~~~~~~~~" << endl;
        }
        tmpcv_dBuffnew = cv_dBuff_v[0];
     }