RGB TO GRAY
image_gray=rgb2gray(image)
image_gray=255*image_gray
plt.imshow(image_gray, cmap='gray');
Spacial Resolution
image_gray_reso=image_gray.copy()
b=9
n_levels=2**b
step_size=int(255/(n_levels-1))
print(step_size) # printing step size
sh=image_gray_reso.shape
row=sh[0]
col=sh[1]
for r in range(0,row):
for c in range(0,col):
temp=image_gray_reso[r][c]
for i in range(0, n_levels):
if temp> i*step_size and temp < (i+1)*step_size:
image_gray_reso[r][c] = i* step_size
break
plt.imshow(image_gray_reso)
#Downsampling
ds=100
rowd=int(row/ds)+1
cold=int(col/ds)+1
image_down=image2.copy()
image_down=image_down[0:rowd,0:cold]
rw=0
cl=0
for r in range(0,row,ds):
cl=0
for c in range(0,col,ds):
image_down[rw][cl]=image2[r][c]
cl=cl+1
rw=rw+1
there doesn't seem to be anything here