Sample code how_to_scan_images.cpp doesn't compile on g++ (Bug #1571)
Description
System:
Ubuntu 11.10, x64, 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 functions.
Associated revisions
fixed bug #1571
History
Updated by Alexander Shishkov about 13 years ago
- Description changed from System: Ubuntu 11.10, x64, [[OpenCV]]2.3.1a Compile Error: how_to_scan_... to System: Ubuntu 11.10, x64, OpenCV 2.3.1a Compile Error: how_to_scan_ima... More
Updated by Marina Kolpakova almost 13 years ago
Thanks for reporting!
- Status changed from Open to Done
- Target version set to 2.4.0
- Assignee set to Marina Kolpakova