python使用cv2显示图片像素值

mac2022-06-30  63

给定一张灰度图,显示这张图片的像素值

def show_image_pixel(img): ''' :param img: 需要输出像素值的图像,要求是灰度图 :return: 无返回值 ''' height,width=img.shape for i in range(height): for j in range(width): print(' =' %img[i,j],end='') print('\n')

 

转载于:https://www.cnblogs.com/shixisheng/p/9407064.html

相关资源:python opencv 读取图片 返回图片某像素点的b,g,r值的实现方法
最新回复(0)