The number of distint intensity (gray) values in an gray scale image matlab code?

2 Ansichten (letzte 30 Tage)
for my work, i need the number of intensity values in gray scale image. for example, consider an image a=[100,120;23,100]. the number of intensity values is 3. i need matlab code for the same.

Antworten (1)

Guillaume
Guillaume am 17 Mai 2016
Simply count the number of unique values in your image:
numel(unique(a))

Kategorien

Mehr zu Modify Image Colors finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by