segmentedbit / impro-assignment

Assignment for image processing
1 stars 0 forks source link

copyWithPadding #29

Closed Ardillo closed 10 years ago

Ardillo commented 10 years ago

when making a padding like this:

Mat temp = im::copyWithPadding(input, 2, 0, PZERO);

it gives this output:

OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in Mat, file /home/ardillo/Downloads/opencv2.4.7/opencv-2.4.7/modules/core/src/matrix.cpp, line 323 terminate called after throwing an instance of 'cv::Exception' what(): /home/ardillo/Downloads/opencv2.4.7/opencv-2.4.7/modules/core/src/matrix.cpp:323: error: (-215) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function Mat

Appearantly the bug is somewhere in line 126 of stockpile.cc:

    original.copyTo(output(Rect(cv::Point(hPadding, vPadding), Size(oWidth,oHeight))));
Ardillo commented 10 years ago

segmented bit fixed, some padding issues