给定一张灰度图,显示这张图片的像素值
def show_image_pixel(img): ''' :param img: 需要输出像素值的图像,要求是灰度图 :return: 无返回值 ''' height,width=img.shape for i in range(height): for j in range(width): print(' %3d' %img[i,j],end='') print(' ')
给定一张灰度图,显示这张图片的像素值
def show_image_pixel(img): ''' :param img: 需要输出像素值的图像,要求是灰度图 :return: 无返回值 ''' height,width=img.shape for i in range(height): for j in range(width): print(' %3d' %img[i,j],end='') print(' ')