How does one convert a grayscale image to RGB in OpenCV (Python)?

前端 未结 4 1868
忘掉有多难
忘掉有多难 2020-12-08 06:15

I\'m learning image processing using OpenCV for a realtime application. I did some thresholding on an image and want to label the contours in green, but they aren\'t showing

4条回答
  •  不思量自难忘°
    2020-12-08 06:50

    I am promoting my comment to an answer:

    The easy way is:

    You could draw in the original 'frame' itself instead of using gray image.

    The hard way (method you were trying to implement):

    backtorgb = cv2.cvtColor(gray,cv2.COLOR_GRAY2RGB) is the correct syntax.

提交回复
热议问题