Error when using OpenCV: use of unclared identifier ‘CV_ Bgr2rgb ‘solution

catalogue

1. Error message:

2. Analysis:

3. Solution:

1. Error message:

F:\test\Qt-Demo\mainwindow.cpp:55: error: use of undeclared identifier ‘CV_ BGR2RGB’

2. Analysis:

Because opencv is used   CV_ Bgr2gray did not declare it. Therefore, an undeclared identifier is prompted.

3. Solution:

Reference the following code in the header file:

#include < opencv2\imgproc\types_ c.h>


Read More: