The following command causes an exception.
cv::imwrite("test.jpg", diffImg);
I also tried numerous variations on this, including absolute paths and PNG export. Here’s the error:
Exception at 0x75abd36f, code: 0xe06d7363: C++ exception, flags=0x1
(execution cannot be continued) in opencv_core231!cv::errorC:\slave\WinInstallerMegaPack\src\opencv\modules\highgui\src\loadsave.cpp:276:
error: (-2) could not find a writer for the specified extension
According to this related thread my current OpenCV installation doesn’t support the image formats I tried. But I merely downloaded the precompiled Windows framework like their site suggested.
How can I get JPG export working?
it sounds as if you were using a different execution environment than the one you are compiling. Can you try the following? Download dependency walker and go to the executable directory and drag and drop the .exe file over dependency walker (http://www.dependencywalker.com/). It will show you which runtime libraries it is using.
Now, make sure you are calling the program with the right environment. If you can, use a command line interface to call the program, it will make you feel safer to know where the code is being called from, so you can be sure your copied .dlls are being called.
Kind regards,
Daniel