Try something like this
someThreshold = 190;
binaryImage = grayImage < someThreshold;
labeledImage = bwlabel(binaryImage);
measurements = regionprops(labeledImage, grayImage, 'MaxIntensity');
maxIntensities = [measurements.MaxIntensity]
That gives a blob-by-blob accounting of the max. If you just want the max of the image above and below the threshold, you can simply do this
mask = grayImage < someThreshold;
maxAbove = max(grayImage(mask))
maxBelow = max(grayImage(~mask))
Best Answer