You ask several questions here. I'll try and answer.
When asking for
'PixelValues'
you get a vector with the gray-scale values of the pixels in inputimg
corresponding to the labeled region inlabel
. That is,stats(ii).PixelValues
is a vector with number of elements equal to the number of pixels in theii
-th region. The values of this vector is the gray-scale values taken from the corresponding pixels inimg
.The range of values in
'PixelValues'
depends on the inputimg
. If the values ofimg
are between 0..255 so will the values be. If you convertedimg
to double (e.g., usingim2double
) the values will rang ein 0..1Your text boxes are long because they show you ALL pixel values of each region (values of MANY pixels). They contain decimal because this is the way you printed them with
'%2.1f'
. Use'%d'
to print integer values. You might also want to add a space there.If all you want is to inspect the pixel values, you migt want to try tool like
impixelinfo
.