How do I use a 5x5 window to scan over the greyscale image and create a text table with 25x25 array?
Will this be a correct way?
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.misc import imread, imsave, imresize
img = imread('new_photo.jpg')
plt.imshow(img)
np.shape(img)
newimg = img[:25,:25,:][:,:,0]
np.shape(newimg)
plt.imshow(newimg)
plt.show()
nextimg = pd.DataFrame(newtimg)
nextimg.to_csv('newtimg.txt',header=False,index=False)
fimg = pd.read_csv('newimg.txt')
plt.imshow(fimg)
nextimg = pd.DataFrame(newtimg)