Sample code how_to_scan_images.cpp doesn't compile on g++ (Bug #1571)


Added by mr_timbeau - about 13 years ago. Updated almost 13 years ago.


Status:Done Start date:
Priority:Normal Due date:
Assignee:Marina Kolpakova % Done:

0%

Category:samples
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

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

Revision 577dabb8
Added by Marina Kolpakova almost 13 years ago

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

Also available in: Atom PDF