失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > python openCV 获取图像像素点

python openCV 获取图像像素点

时间:2023-10-03 02:31:23

相关推荐

python openCV 获取图像像素点

import cv2# 读取图像img = cv2.imread("test.jpg")# 查看图像cv2.imshow("title", img)cv2.waitKey(0)# 查看维度print(img.shape)# 查看 (10,10) 位置的RGB # 注意:此处返回顺序为 [B, G, R]print(img[10,10]) # 更改 部分为白色for i in range(100):for j in range(100):img[i, j] = [200,255,255]# 保存cv2.imwrite("test2.png", img) # 用 imwrite 函数将数据写到本地

如果觉得《python openCV 获取图像像素点》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。