I am writting code that uses opencv and i need to have access to PI (3.14...), I know that standard math.h has the efinition, but I found it not easy to uses it is not exposed by default.
Does OpenCV has any definition for PI?
I am writting code that uses opencv and i need to have access to PI (3.14...), I know that standard math.h has the efinition, but I found it not easy to uses it is not exposed by default.
Does OpenCV has any definition for PI?
Yes. It defines CV_PI
.
I think it's defined in the cv
namespace.
Edit: At a closer look it seems that it's available in the global namespace.
In OpenCV python, it seems CV_PI
(or cv2.CV_PI
) doesn't exist, use numpy.pi
.
Currently CV_PI seems to be in cvdef.h, line 193:
#define CV_PI 3.1415926535897932384626433832795
I can confirm as others have mentioned that cv::PI does not seem to be available any longer (probably removed in the OpenCV 2 to OpenCV 3 change over when the OpenCV 1 legacy stuff was depreciated).