Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RGB2BGR option disappeared from cvtColor

Tags:

c++

opencv

I'm trying to compile my code with opencv 3.0.0 (that worked with previous opencv versions)
cvtColor(img, img, CV_RGB2BGR);
and get compilation error
‘CV_RGB2BGR’ was not declared in this scope
The option also does not exist in the documentation

How can I get the same functionality (RGB2BGR) with the new version?

like image 532
user1063489 Avatar asked Jul 31 '14 13:07

user1063489


1 Answers

Use constant cv::COLOR_RGB2BGR instead of CV_RGB2BGR.

It works for other convertions too, just change CV_ to cv::COLOR_ .

Just checked it it works for me.

like image 149
Andrey Smorodov Avatar answered Sep 21 '22 15:09

Andrey Smorodov