How do I write a computer program that counts number of black pixels?

First, learn to program and how to create programs.

Next, figure out how to create programs that use OpenCV.

Then, google “how to count pixels in opencv” and apply what you find for your problem.

1 Like