3

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?

KHCheng
  • 621
  • 2
  • 6
  • 9

1 Answers1

9

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)
Lokinou
  • 1,039
  • 10
  • 13