First time here? Check out the FAQ!
answered 2013-08-25 21:41:30 -0600
You can use the function cv::countNonZero to count the number of black pixels. If your image only contains black and white pixels, the number of white pixels will be: (image_width * image_height) - black_pixel_count