import cv2
import numpy as np

img = cv2.imread('C:\Users\Nitesh Singh\Downloads\panda'.jpg', cv2.IMREAD_GRAYSCALE)
r,c=img.shape
count=0
#img=np.array(img)
for i in range(r):
    for j in range(c):
        print(img[i,j])
 #       if img[i,j]==255:
           # count+=1     

"""print('Number of white pixels:', count)
# another method 
n_white_pix = np.sum(img == 255)
print('Number of white pixels:',n_white_pix)"""

a0d8ea8b9007baffdeb930ef32b134a117417eb8
import cv2
import numpy as np

img = cv2.imread('C:\Users\Nitesh Singh\Downloads\panda'.jpg', cv2.IMREAD_GRAYSCALE)
r,c=img.shape
count=0
#img=np.array(img)
for i in range(r):
    for j in range(c):
        print(img[i,j])
 #       if img[i,j]==255:
           # count+=1     

"""print('Number of white pixels:', count)
# another method 
n_white_pix = np.sum(img == 255)
print('Number of white pixels:',n_white_pix)"""
