Open-CV - Not loading correctly

ぃ、小莉子 提交于 2019-12-03 13:17:58

it seems, you are (accidentally) using the 3.0(master) opencv branch.

a lot of constants have changed there, like most of the CV_ prefixes were changed to cv:: namespace, CV_BGR2GRAY is now cv::COLOR_BGR2GRAY, etc.

also all module headers went one up, like opencv2/imgproc.hpp .

if you got the code from the github repo, and want to use the 2.4.9 branch instead,

git checkout 2.4

(in the opencv folder) will take you there. ofc you will have to rerun cmake and recompile

Use COLOR_RGB2GRAY rather than COLOR_BGR2GRAY. It worked for me, though I am running OpenCV 3.0. You may have to use cv::COLOR_RGB2GRAY as the others recommended, if you are running 2.4.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!