error: ‘CV_BGR2RGB’ was not declared in this scope

缺少库,添加相应库就行,ubuntu中Qt Create设置如下
LIBS += -L/home/mima111/opencv345/lib -lopencv_imgcodecs -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_videoio
实际只要添加-lopencv_imgproc就行,CV_BGR2RGB变量存储在该库中。

你可能感兴趣的:(Qt,CV_BGR2RGB,Qt,not,declare)