Easy BGR to Grayscale conversion
I want to convert an image to Grayscale using this simple code using the new C++ API --> found on the OpenCV original documentation page.
Link: http://docs.opencv.org/doc/tutorials/introduction/load_save_image/load_save_image.html
I don't know which one is a placeholder and which one is not.
The changes I made are marked by a pink rectangle. -Are those changes correct?
This is the original code, that was online at the documentation page:
This is the changed code by myself:
Do I have to link the cv.h or cv.hpp, because I've heard, that the GCC compiler only takes .hpp files since its made for C++ and not C. Am I correct?
Thanks.
hi alex,
there is no <opencv/cv.hpp> header, you need <opencv2/core/core.hpp> and <opencv2/imgproc/imgproc.hpp>
if you want to hardcode the image names, skip the 1st line in main (it's wrong anyway).
and the next time, screenshots look nice, but we can't copy/paste your code to correct it