Counting the number of pixels from a ticket category