Number of unique CIELab colors in an image

82 Views Asked by At

I have an image represented in the CIELab color space. How can I return the number of unique CIELab colors the image contains?

Thanks.

1

There are 1 best solutions below

0
On

You can use unique(...,'rows'):

n = size(unique(reshape(img, [], 3)),1);