Use cmap with opencv

Viewed 175

I have a developed python program for some image processing. I am trying to get the colored sketch of an image using cmap.

plt.imshow(invert, cmap='Blues')
plt.axis('off')
plt.title('Pencil-Sketch', size=20)

This is the output with matplotlib. But I am a bit confused when developing the working application with OpenCV.

my try:

dst_sketch, dst_color_sketch = cv2.pencilSketch(opencv_image, sigma_s=50, sigma_r=0.07, shade_factor=0.08)

invert = cv2.bitwise_not(dst_sketch)

newimage = cv2.applyColorMap(invert, cv2.COLORMAP_AUTUMN)

This is the output with OpenCV colormap But in OpenCV, any matplotlib-like colors are not available in the colormap.

Is there a way to achieve the same as using matplotlib when using OpenCV?

0 Answers
Related