I want to calculate the mean for each pixel value and how to show them separatly.for example: Mean 124.34(red),124.44(green),124.67(blue),123.56(gray) I try like this...
import numpy as np
import math
img = Image.open('cameraman.jpg')
h,w=img.size
#print(h,w)
arr = np.array(img)
total = 0
for i in range(arr.shape[0]):
for j in range(arr.shape[1]):
total+=arr[(i,j)]
a=h*w
mean=(total)/a
print("Mean Value is: ",np.mean)