Compilation errror: XY was no declared in this scope
I there,
i was trying to follow this tutorial: http://docs.opencv.org/doc/tutorials/core/how_to_scan_images/how_to_scan_images.html#howtoscanimagesopencv and tried to compile the sample code given here: http://docs.opencv.org/_downloads/how_to_scan_images.cpp and get the following error:
wx@yz:~/Workspace/OpenCV/scan images$ g++ `pkg-config --cflags opencv` how_to_scan_images.cpp `pkg-config --libs opencv` -o test
how_to_scan_images.cpp: In function ‘int main(int, char**)’:
how_to_scan_images.cpp:38:29: error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
how_to_scan_images.cpp:40:29: error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
I was using the following compilation command
g++ `pkg-config --cflags opencv` how_to_scan_images.cpp `pkg-config --libs opencv` -o test
The Code itself is correct, so why do I still get this error. Edit: I'm using Debian Linux and OpenCV 3.
Thanks in advance!
ah, another tutorial bug.
should be cv::IMREAD_GRAYSCALE and cv::IMREAD_COLOR
(btw, for 3.0, use: http://docs.opencv.org/trunk [still wrong there, too] )
Nice you fixed it, thanks a lot. Btw thanks for the link, very useful stuff. Anyhow I'am new to OpenCV so I'll need to work through the tutorials.
@berak is this fix included in your PR?
no ;) those were only the rst files.
( i didn't dare to change more in one go (49 files already, hey),
what's your opinion, - have another run at it, change all the tutorial code too ? (so it's in sync) - or do a seperate pr for this ?)
btw, above link to how_to_scan_images.cpp is from 2.4, it's fixed in 3.0
I would do a seperate PR for that. But it needs to be done ... because there are still enough wrong tutorials out there. Already tried to fix some of them in the past.
yep, thanks, what i'm thinking, too. (actually, there's only a few CV_CAP_* things left in the user guide code and a few CV_BGR2* in the winrt section.
(but right. i'll send out a 2nd pr later the day ..)