Python opencv 伪彩色保存的结果和plt.imshow

Python opencv 伪彩色保存的结果和plt.imshow,第1张

真的是醉了

plt.figure()
plt.imshow(blur_heatMap_jet)
plt.show()

的结果

cv2.imwrite(heatMapPath, blur_heatMap_jet)

的结果

真的无语子!

Python opencv如何imshow一张图片

# Python program to explain cv2.imshow() method 

  

# importing cv2 

import cv2 

  

# path 

path = r'C:\Users\Rajnish\Desktop\geeksforgeeks.png'

  

# Reading an image in default mode

image = cv2.imread(path)

  

# Window name in which image is displayed

window_name = 'image'

  

# Using cv2.imshow() method 

# Displaying the image 

cv2.imshow(window_name, image)

  

#waits for user to press any key 

#(this is necessary to avoid Python kernel form crashing)

cv2.waitKey(0)

  

#closing all open windows 

cv2.destroyAllWindows()

一行命令!  等价于 matlab中imshow(img)

cv2.imshow("window_name", combineImg),cv2.waitKey(0) 

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/737727.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-28
下一篇 2022-04-28

发表评论

登录后才能评论

评论列表(0条)

保存