i have an binary word image with grid and i want to find the foreground pixels (number of black and white in each segments) in each segments : Help me to find foreground pixels in every segments in a image 