Ask Your Question
0

OpenCV Macro CV_BGR2RGBA Not Defined.

asked 2019-04-14 13:26:33 -0600

updated 2019-04-14 13:29:27 -0600

Hello OpenCV experts,

I was using the following function with headers:

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
cv::cvtColor(imageBGR, imageRGBA, CV_BGR2RGBA);

However, when I compile, I got error:

"error: identifier "CV_BGR2RGBA" is undefined" Please let me know how to use this macro correctly. Thank you.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-04-14 13:33:35 -0600

The API might have been changed. Use cv::cvtColor(imageBGR, imageRGBA, cv::COLOR_BGR2BGRA);.

edit flag offensive delete link more

Comments

Since OpenCV 3.4.x all CV_ prefixes where indeed removed, because they did not resemble the new unified backend. They are now all available in the COLOR subspace :)

StevenPuttemans gravatar imageStevenPuttemans ( 2019-04-15 04:35:48 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-04-14 13:26:33 -0600

Seen: 2,247 times

Last updated: Apr 14 '19