import cv2
import numpy as np
img=cv2.imread(’/workspace/opencv/images/1.jpg’)
print img.item(10,10,2)
img.itemset((10,10,2),100)
print img.item(10,10,2)
##50
##100
opencv修改和提取像素值
最新推荐文章于 2023-01-19 11:15:16 发布
import cv2
import numpy as np
img=cv2.imread(’/workspace/opencv/images/1.jpg’)
print img.item(10,10,2)
img.itemset((10,10,2),100)
print img.item(10,10,2)
##50
##100