| [maxaopenthmt] [Up] [maxthreshold] | Thresholds and Regional Maxima |
| User Feedback |
Return a regional maxima feature:
"binary" - returns the regional maxima as a binary image."values" - returns the regional maxima as a gray-scale image."labels" - returns the regional maxima as a labeled image."a-dyn-image" - returns the area dynamics as a gray-scale image."h-dyn-image" - returns the contrast dynamics as a gray-scale image."v-dyn-image" - returns the volume dynamics as a gray-scale image."a-dyn" - returns the area dynamics of each regional maximum."h-dyn" - returns the contrast dynamics of each regional maximum."v-dyn" - returns the volume dynamics of each regional maximum."stats" - returns the regional maxima statistics; each row contains:
[0] area: node area (number of pixels)[1] sum_x: x_centroid = sum_x / area[2] sum_y: y_centroid = sum_y / area[3] xmin: minimum x coordinate[4] ymin: minimum y coordinate[5] xmax: maximum x coordinate[6] ymax: maximum y coordinate
a = mmreadgray("galeao.jpg")
mt = maxaopenmt(maxtree(a), 'area', 500)
b = maxregmax(mt)
mmshow(b)
![]() |
|
| b |
c = maxregmax(mt, 'labels')
mmlblshow(uint16(c))
![]() |
|
| uint16(c) |
stats = maxregmax(mt, 'stats')
print 'Found %d blobs. Printing the first five:' % (stats.shape[0],)
Found 49 blobs. Printing the first five:
for i in range(5):
print 'blob %d: %s' % (i+1, stats[i])
blob 1: [ 504 41098 13363 59 0 101 58] blob 2: [ 572 215931 12417 359 0 394 43] blob 3: [ 501 231151 7718 442 0 480 35] blob 4: [ 517 280578 10575 509 0 573 32] blob 5: [ 827 178076 25759 178 3 237 57]
bb = uint8([9, 10, 11, 4, 10, 10, 2])
mx = maxtree(bb)
print maxregmax(mx, 'h-dyn-image') # [0 0 9 0 6 6 0]
[0 0 9 0 6 6 0]
print maxregmax(mx, 'h-dyn')
[9 6]
print maxregmax(mx, 'v-dyn-image') # [0 0 42 0 12 12 0]
[ 0 0 42 0 12 12 0]
print maxregmax(mx, 'v-dyn')
[42 12]
print maxregmax(mx, 'a-dyn-image') # [0 0 7 0 2 2 0]
[0 0 6 0 2 2 0]
print maxregmax(mx, 'a-dyn')
[6 2]
| [maxaopenthmt] [Up] [maxthreshold] | |
| User Feedback | |
| Copyright (c) 1998-2008 by SDC Information Systems |