I have a segmented output image of size (513,513,3) and the unique values it carries is [0 200 255]. I want to get the total number of pixels under each unique color. Like get total number of pixels that are 0(black), total number of pixels that are 200(green), and total number of pixels that are 255(white).
I tried something like this:
for i in range(img.shape[-1]):
mask = img[0, :, i].sum()
But i feel that its wrong way of get the pixel counts under each unique color. I am new with images, please help in solving this.