将MAT图像保存到矢量中。 (记忆和速度问题)

时间:2016-04-14 06:57:47

标签: c++ opencv

我有一点问题。下面我根据用户定义的ROI扫描图像。一切正常但是当我尝试用一​​个像素的滑动尺寸扫描我的图像时,我在回击中得到错误。我想知道为什么?有没有记忆问题?

 vector<Mat> images;
vector < pair < int, int > > Coordinate;
for (int rowIndex = 0; rowIndex <= lBPIIImage2.rows - roih; rowIndex = getNextIndex(rowIndex, lBPIIImage2.rows, roih, 1))

    {
        for (int colindex = 0; colindex <= lBPIIImage2.cols - roiw; colindex = getNextIndex(colindex, lBPIIImage2.cols, roiw, 1))

        {
            searchRect = cvRect(colindex, rowIndex, roiw, roih);
            frameSearchRect = lBPIIImage2(searchRect);
            LoopDummy = frameSearchRect.clone();
            rectangle(frame, searchRect, CV_RGB(255, 0, 0), 1, 8, 0);

            images.push_back(LoopDummy);
            Coordinate.push_back(make_pair(rowIndex, colindex));
        }

    }

0 个答案:

没有答案