Updated by Alexander Shishkov about 13 years ago

System:
Ubuntu 11.10, x64, OpenCV 2.3.1a [[OpenCV]]2.3.1a

Compile Error:
how_to_scan_images.cpp|69|error: invalid initialization of non-const reference of type ‘cv::Mat&’ from an rvalue of type ‘cv::Mat’|

Description:
Compile error occurs three times in file (lines 69, 80, 91).
Relates to the issue discussed here:
http://stackoverflow.com/questions/4084053/passing-non-const-references-to-rvalues-in-c
(ie, possibly compiles fine under other OSes).

Suggested Fix:
Declare additional Mat objects, assign I.clone() to each, and then reference those additional objects in the ScanImageAndReducXXX [[ScanImageAndReducXXX]] functions.

Back