OpenCV Python: Convert RGB to YCrCb -


i can't seem convert rgb ycrcb in new opencv python api (cv2). when run code:

img = cv2.imread('img1.jpg') imgycc = cv2.cvtcolor(img, cv2.color_rgb2ycrcb) 

, error:

attributeerror: 'module' object has no attribute 'color_rgb2ycrcb' 

what doing wrong?

the attribute name color_rgb2ycr_cb rgb ordering.

bear in mind opencv natively uses bgr color ordering, not rgb, in case attribute color_bgr2ycr_cb. so, may want modify code:

img = cv2.imread('img1.jpg') imgycc = cv2.cvtcolor(img, cv2.color_bgr2ycr_cb) 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -