img = caffe.io.load_image('caffe/examples/images/cat.jpg') # loading the image
img = cv2.resize(img, (256, 256)) # resizing it to 256x256
ilsvrc_mean = numpy.load('caffe/python/caffe/imagenet/ilsvrc_2012_mean.npy') #loading the mean file
print ilsvrc_mean.shape, img.shape #(3, 256, 256) (256, 256, 3)
mean_file = ilsvrc_mean.reshape((256,256,3))
img[50:170, 100:170, :] = mean_file[50:170, 100:170, :]
plt.imshow(img)
I was expecting something grayish without such textures, so I think I'm doing something wrong. In fact if I display the mean file:
plt.imshow(mean_file)
I wonder what is that I'm doing wrong.
Thanks,