The following command causes an exception.
cv::imwrite(\"test.jpg\", diffImg);
I also tried numerous variations on this, including absolute
You need to recompile OpenCV and add support to "jpeg" format. Get the lastest opencv code and run cmake:
svn co http://code.opencv.org/svn/opencv/trunk/opencv myopencvdir.svn/
cd myopencvdir.svn/
mkdir release
cd release/
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
And check if libjpeg, libpng, libtiff are supported. If not you need to install them and re-run cmake.
Example of cmake output that shows Media I/O support:
-- Media I/O:
-- ZLib: TRUE
-- JPEG: TRUE
-- PNG: TRUE
-- TIFF: TRUE
-- JPEG 2000: TRUE
-- OpenEXR: YES