Undeclared identifier problem in 3.0.0 alpha (Bugfix #4000)


Added by Yida Wang over 10 years ago. Updated over 10 years ago.


Status:Cancelled Start date:2014-11-07
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:imgproc, video
Target version:3.0
Affected version:branch 'master' (3.0-dev) Operating System:Any
Difficulty: HW Platform:x64
Pull request:

Description

When I use improc in my program, there are problem in these 2 lines:
cvtColor(bgr3u, g1u, CV_BGR2GRAY);
cvtColor(bgr3u, hsv3u, CV_BGR2HSV);

And the compiler warn me that:
"error C2065: 'CV_BGR2GRAY' : undeclared identifier" and
"Objectness.cpp(257): error C2065: 'CV_BGR2HSV' : undeclared identifier"

I find the problem lies in the file "imgproc.hpp", there should be included some file and the "core.hpp" should add a line of code:

#include "opencv2/imgproc/types_c.h"

After this action , the problem just got solved.
the file which is modified by me has been attached with this issue.


imgproc.hpp (2.3 kB) Yida Wang, 2014-11-07 09:34 am


Associated revisions

Revision 939c1d24
Added by Vadim Pisarevsky almost 10 years ago

Merge pull request #4000 from sdika:HOGSignedGradient

History

Updated by Alexander Duda over 10 years ago

The name of the constants got changed. Have a look at http://docs.opencv.org/trunk/modules/imgproc/doc/miscellaneous_transformations.html. The header file you are referring to is for backward compatibility.

Updated by Alexander Alekhin over 10 years ago

CV_BGR2HSV / CV_BGR2GRAY is deprecated in C++ code (because constants like these garbage global namespace, and it is not right behaviour for library).
Preferred way is to use cv::COLOR_BGR2HSV / cv::COLOR_BGR2GRAY in new C++ code.

  • Difficulty deleted (Easy)
  • Status changed from New to Cancelled
  • Assignee deleted (Alexander Alekhin)

Updated by Yida Wang over 10 years ago

OK, thanks for your prompting, I will use the new namespace afterwards
Alexander Alekhin wrote:

CV_BGR2HSV / CV_BGR2GRAY is deprecated in C++ code (because constants like these garbage global namespace, and it is not right behaviour for library).
Preferred way is to use cv::COLOR_BGR2HSV / cv::COLOR_BGR2GRAY in new C++ code.

Updated by Yida Wang over 10 years ago

Thanks! The explanation is quite in detail, and I will change my past usage with opencv defined color space functions.
Alexander Duda wrote:

The name of the constants got changed. Have a look at http://docs.opencv.org/trunk/modules/imgproc/doc/miscellaneous_transformations.html. The header file you are referring to is for backward compatibility.

Also available in: Atom PDF