Count every pixels in image opencv python
Installation and Deployment
2
Posts
2
Posters
4.1k
Views
1
Watching
-
wrote on 6 Nov 2013, 13:49 last edited by
Hello i am new in open cv i want to count every pixel in image then count the blue pixel so far i have done the blue pixel counting but it does not work probably so i want to count every brg pixel then defin the blue pixel this is my code
@ import cv2
import numpy as npimg = cv2.imread("mm.jpg")
BLUE_MIN = np.array([0, 0, 0], np.uint8)
BLUE_MAX = np.array([255, 20, 20], np.uint8)dst = cv2.inRange(img, BLUE_MIN, BLUE_MAX)
no_blue = cv2.countNonZero(dst)
print('The number of blue pixels is: ' + str(no_blue))
cv2.namedWindow("opencv")
cv2.imshow("opencv",img)
cv2.waitKey(0)@
Please help me i am stack in this code -
Hi and welcome to devnet,
Your question is completely unrelated to Qt. You should ask it on the OpenCV forums/mailing list
1/2