Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The problem is here:

src_base = imread("image0", 1);
src_test1 = imread("image1", 1);
src_test2 = imread("image2", 1);

imread() is not reading your saved images because you're not using the full filename, with extension. It should be replaced with this:

src_base = imread("image0.jpg", 1);
src_test1 = imread("image1.jpg", 1);
src_test2 = imread("image2.jpg", 1);

In fact, you should add proper checks every time you use imread(), to make sure you're properly reading images. Example:

src_base = imread("image0.jpg", 1);
if (src_base.empty()){
    cout << "Error reading image from file" << endl;
    return -1;
}