| [maxgetindex] [Up] [maxgetchildren] | Introspection Functions |
| User Feedback |
| y | Image
Properties of the node(s). Each row contains the following properties:
|
This function returns the properties of the given node, if index is specified,
or the properties for all nodes in a given level, if index is not specified or is negative.
Call maxgetcount before this function to avoid accessing inexistent nodes.
a = uint8([1, 2, 3, 4, 4, 4, 3, 2, 3, 5, 6, 6, 4, 4, 4, 3, 3, 4, 1, 2, 2])
mt = maxtree(a)
nn = maxgetcount(mt)
nlev = nn.shape[0]
for i in range(nlev):
if nn[i] > 0:
print "-"*60
print "Level:", i
nodes = maxgetnodes(mt, i)
if len(nodes.shape) == 1:
nodes = reshape(nodes, (1, nodes.shape[0]))
for isleaf, plevel, pindex, area, xx, yy, x0, y0, x1, y1, hh, vv in nodes:
print " -"
print " isleaf: ", isleaf
print " parent level:", plevel
print " parent index:", pindex
print " area: ", area
print " height: ", hh
print " volume: ", vv
print " centroid: ", xx/area, yy/area
print " bounding box:", x0, y0, x1, y1
------------------------------------------------------------
Level: 1
-
isleaf: 0
parent level: 0
parent index: -1
area: 21
height: 7
volume: 70
centroid: 10 0
bounding box: 0 0 20 0
------------------------------------------------------------
Level: 2
-
isleaf: 0
parent level: 1
parent index: 0
area: 17
height: 5
volume: 47
centroid: 9 0
bounding box: 1 0 17 0
-
isleaf: 1
parent level: 1
parent index: 0
area: 2
height: 1
volume: 2
centroid: 19 0
bounding box: 19 0 20 0
------------------------------------------------------------
Level: 3
-
isleaf: 0
parent level: 2
parent index: 0
area: 5
height: 2
volume: 8
centroid: 4 0
bounding box: 2 0 6 0
-
isleaf: 0
parent level: 2
parent index: 0
area: 10
height: 4
volume: 22
centroid: 12 0
bounding box: 8 0 17 0
------------------------------------------------------------
Level: 4
-
isleaf: 1
parent level: 3
parent index: 0
area: 3
height: 1
volume: 3
centroid: 4 0
bounding box: 3 0 5 0
-
isleaf: 0
parent level: 3
parent index: 1
area: 6
height: 3
volume: 11
centroid: 11 0
bounding box: 9 0 14 0
-
isleaf: 1
parent level: 3
parent index: 1
area: 1
height: 1
volume: 1
centroid: 17 0
bounding box: 17 0 17 0
------------------------------------------------------------
Level: 5
-
isleaf: 0
parent level: 4
parent index: 1
area: 3
height: 2
volume: 5
centroid: 10 0
bounding box: 9 0 11 0
------------------------------------------------------------
Level: 6
-
isleaf: 1
parent level: 5
parent index: 0
area: 2
height: 1
volume: 2
centroid: 10 0
bounding box: 10 0 11 0
| [maxgetindex] [Up] [maxgetchildren] | |
| User Feedback | |
| Copyright (c) 1998-2008 by SDC Information Systems |