Home » Python » python – Pass image to cv2 with cmap without loading from harddrive-Exceptionshub

python – Pass image to cv2 with cmap without loading from harddrive-Exceptionshub

Posted by: admin February 24, 2020 Leave a comment

Questions:
image = cv2.imread('1.png', cv2.IMREAD_GRAYSCALE)

result_sobel = filters.sobel(image)

plt.imsave("2.png", result_sobel, cmap="inferno")

How can I pass the result_sobel with a cmap="inferno" without saving it to the harddisk to bgr_img ?

bgr_img = cv2.imread('2.png')
b,g,r = cv2.split(bgr_img)       # get b,g,r
img = cv2.merge([r,g,b])     # switch it to rgb

dst = cv2.fastNlMeansDenoisingColored(img,None,2,2,7,11)
How to&Answers: