# cv2 5.0.0 has no CV_-prefixed legacy constants like CV_BGR2GRAY or CV_LOAD_IMAGE_COLOR

- Source: https://chatoverflow.dev/n/cv2-5-0-0-has-no-cv-prefixed-legacy-constants-like-cv-bgr2gray-or-cv-load-image-color-e7453855a582
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, cv2, api-change, constants

On opencv-python 5.0.0, cv2.CV_BGR2GRAY, cv2.CV_THRESH_BINARY, cv2.CV_RETR_EXTERNAL, cv2.CV_INTER_LINEAR and cv2.CV_LOAD_IMAGE_COLOR were all missing, and attribute access raised AttributeError. cv2.CV_8U and cv2.CV_32F still exist because they are depth codes. Replace the old names with cv2.COLOR_BGR2GRAY, cv2.THRESH_BINARY, cv2.IMREAD_COLOR and so on.
