OpenCV 筆記整理 - part3-色彩空間
還沒看過前一篇的記得先看吶!!
想了解HSV&HSL差異可以看看這篇呦!
1 | import cv2 as cv |
將block替換成以下內容可以得到同效果:
灰階
1 | gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) |
HSV
1 | hsv = cv.cvtColor(img, cv.COLOR_BGR2HSV) |
LAB
1 | lab = cv.cvtColor(img, cv.COLOR_BGR2LAB) |
BGR to RGB
1 | rgb = cv.cvtColor(img, cv.COLOR_BGR2RGB) |
HSV to BGR
1 | lab_bgr = cv.cvtColor(lab, cv.COLOR_LAB2BGR) |
參考
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment
GitalkFacebook Comments