| [mmpatspec] [Up] [mmglblshow] | Measurements |
Compute global image statistics: 'max' - maximum gray-scale value in image; 'min' - minimum gray-scale value in image; 'sum' - sum of all pixel values; 'median' - median value of all pixels in image; 'mean' - mean value of all pixels in image; 'std' - standard deviation of all pixels (normalized by N-1); 'std1' - idem, normalized by N.
def mmstats(f, measurement):
from string import upper
from Numeric import ravel
from MLab import mean, median, std
measurement = upper(measurement)
if measurement == 'MAX':
y = max(ravel(f))
elif measurement == 'MIN':
y = min(ravel(f))
elif measurement == 'MEAN':
y = mean(ravel(f))
elif measurement == 'MEDIAN':
y = median(ravel(f))
elif measurement == 'STD':
y = std(ravel(f))
else:
assert 0,'Not a valid measurement'
return y
| mmhistogram | Find the histogram of the image f. |
| mmblob | Blob measurements from a labeled image. |
| mmgrain | Gray-scale statistics for each labeled region. |
| [mmpatspec] [Up] [mmglblshow] | |
| Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center. |