Is there OpenCV colormap in python?

后端 未结 3 511
感动是毒
感动是毒 2020-12-20 22:23

I am aware of Matlab, matplotlib style colormap in OpenCV . The documentation explains its usage for C++. I was wondering if such an option exists for python using cv2 as w

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-20 22:32

    For OpenCV 2.4.11, applyColorMap works in Python (even though the 2.4.11 docs still list only C++):

    import cv2
    im = cv2.imread('test.jpg', cv2.IMREAD_GRAYSCALE)
    imC = cv2.applyColorMap(im, cv2.COLORMAP_JET)
    

    See also this Stack Overflow answer.

提交回复
热议问题