OpenCV(Python)基礎 | 色彩空間的轉換

OpenCV(Python)基礎 | 色彩空間的轉換

OpenCV(Python)基礎 | 色彩空間的轉換


資料來源: https://mp.weixin.qq.com/s?__biz=MzIwMDU3MDkzNg==&mid=2651312492&idx=1&sn=1a093dc53ee98940b39a7240de401324&chksm=8d08503bba7fd92dadf2d5d2eb57fb3ae35ffb157af450ff849a6e96fa7968d90a7f470a5132&scene=126&sessionid=1607388989&key=e420ad4ff565d51fbc143339165afd922b87f1bcd194e10ff1d91676a9d42592ed36a2c2d7ab8aef114b816ccd7acc2d8374d9437b32cadfe3b6f963fdc30f91c14fbc067ec1e703aa19490353f7dccf1794271a2fe974298065bf88dcaedb0a778bf6c280d6eed99f829a34f32ae5cf37ba6eb1b19a7eb9a1b3a127213d7c4d&ascene=1&uin=MjIwODk2NDgxNw%3D%3D&devicetype=Windows+10+x64&version=6300002f&lang=zh_TW&exportkey=AmHHv3ajukqYlxGP9h8yslw%3D&pass_ticket=0gGYf2c03M7ejUVfmjrIHgJkhrMGS61jg%2FgyZlOfGhQCljXh8cE4NsI%2BQGQbG5sm&wx_header=0


https://www.bilibili.com/video/BV1QW411F7e7?p=1


code:

def color_space_demo(image):
    gray=cv.cvtColor(image,cv.COLOR_BGR2GRAY)
    cv.imshow("gray",gray)

    hsv=cv.cvtColor(image,cv.COLOR_BGR2HSV)
    cv.imshow("hsv",hsv)

    hls=cv.cvtColor(image,cv.COLOR_BGR2HLS)
    cv.imshow("hls",hls)

    yuv = cv.cvtColor(image, cv.COLOR_BGR2YUV)
    cv.imshow("yuv", yuv)

    ycrcb = cv.cvtColor(image, cv.COLOR_BGR2YCrCb)
    cv.imshow("ycrcb", ycrcb)

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *