Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV cv2.CV_LOAD_IMAGE_COLOR [duplicate]

Tags:

python

opencv

I tried to run the following in python:

import cv2
im_A = cv2.imread(path_A, cv2.CV_LOAD_IMAGE_COLOR)

But there is an error message "module 'cv2' has no attribute 'CV_LOAD_IMAGE_COLOR'. Why?

like image 226
KHCheng Avatar asked Oct 15 '25 07:10

KHCheng


1 Answers

I guess you are not using Python (or C++) flags in your syntax. You must instead use the IMREAD_COLOR constant.

import cv2
im = cv2.imread('link_to_file', cv2.IMREAD_COLOR)
like image 194
Lokinou Avatar answered Oct 19 '25 05:10

Lokinou



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!