I am trying to write code using the OpenCV stitcher to stitch together a set of images and keep coming up with this error.
OpenCV Error: Assertion failed (dsize.area() > 0 || (inv_scale_x > 0 && inv_scale_y > 0)) in cv::resize, file C:\Users\car4p\Downloads\opencv-master\opencv-master\modules\imgproc\src\imgwarp.cpp, line 3230
I have searched around and found that this is not a problem with reading the images, the images both display fine and have more than 0 cols. I believe there is an error with the output but can't figure out how to fix it. If anyone has dealt with this before or knows a solution it would be much appreciated.
I'm writing in C++, using OpenCV 3.1 and Visual Studio 2015.
Code for Reading Images
imgs.push_back(imread("testerer1.jpg"));
imgs.push_back(imread("testerer2.jpg"));
imgs.push_back(imread("testerer3.jpg"));
imgs.push_back(imread("testerer4.jpg"));
Code for Stitching Images
Mat stitchImages(vector<Mat> imgs) {
Stitcher stitchs;
vector<Mat> stitchedImg;
stitchs.createDefault(false);
Stitcher::Status status = stitchs.stitch(imgs, stitchedImg);
return stitchedImg[0];
}