RegionFeature

Region feature class

This class represents a region feature.

Methods

boundary Return the boundary as a list
box Return the bounding box
plot Plot the centroid
plot_boundary Plot the boundary
plot_box Plot the bounding box
plot_ellipse Plot the equivalent ellipse
display Display value
char Convert value to string
pick Return the index of the blob that is clicked

Properties

uc* centroid, horizontal coordinate
vc* centroid, vertical coordinate
p centroid (uc, vc)
umin bounding box, minimum horizontal coordinate
umax bounding box, maximum horizontal coordinate
vmin bounding box, minimum vertical coordinate
vmax bounding box, maximum vertical coordinate
area* the number of pixels
class* the value of the pixels forming this region
label* the label assigned to this region
children a list of indices of features that are children of this feature
edgepoint coordinate of a point on the perimeter
edge a list of edge points 2xN matrix
perimeter* edge length (pixels)
touch* true if region touches edge of the image
a major axis length of equivalent ellipse
b minor axis length of equivalent ellipse
theta* angle of major ellipse axis to horizontal axis
shape* aspect ratio b/a (always <= 1.0)
circularity* 1 for a circle, less for other shapes
moments a structure containing moments of order 0 to 2
bbox* the bounding box, 2x2 matrix [umin umax; vmin vmax]
bboxarea* bounding box area

Note

See also

iblobs, imoments


RegionFeature.RegionFeature

Create a region feature object

R = RegionFeature() is a region feature object with null parameters.


RegionFeature.boundary

Boundary in polar form

[d,th] = R.boundary() is a polar representation of the boundary with respect to the centroid. d(i) and th(i) are the distance to the boundary point and the angle respectively. These vectors have 400 elements irrespective of region size.


RegionFeature.box

Return bounding box

b = R.box() is the bounding box in standard Toolbox form [xmin,xmax; ymin, ymax].


RegionFeature.char

Convert to string

s = R.char() is a compact string representation of the region feature. If R is a vector then the string has multiple lines, one per element.


RegionFeature.contains

Test if coordinate is contained within region bounding box

R.contains(coord) true if the coordinate COORD lies within the bounding box of the region feature R. If R is a vector, return a vector of logical values, one per input region.


RegionFeature.display

Display value

R.display() is a compact string representation of the region feature. If R is a vector then the elements are printed one per line.

Notes

See also

RegionFeature.char


RegionFeature.pick

Select blob from mouse click

i = R.pick() is the index of the region feature within the vector of RegionFeatures R to which the clicked point corresponds. Since regions can overlap of be contained in other regions, the region with the smallest area of bounding box that contains the selected point is returned.

See also

ginput, RegionFeature.inbox


RegionFeature.plot

Plot centroid

R.plot() overlay the centroid on current plot. It is indicated with overlaid o- and x-markers.

R.plot(ls) as above but the optional line style arguments ls are passed to plot.

If R is a vector then each element is plotted.


RegionFeature.plot_boundary

Plot boundary

R.plot_boundary() overlay perimeter points on current plot.

R.plot_boundary(ls) as above but the optional line style arguments ls are passed to plot.

Notes

See also

boundmatch


RegionFeature.plot_box

Plot bounding box

R.plot_box() overlay the the bounding box of the region on current plot.

R.plot_box(ls) as above but the optional line style arguments ls are passed to plot.

If R is a vector then each element is plotted.


RegionFeature.plot_ellipse

Plot equivalent ellipse

R.plot_ellipse() overlay the the equivalent ellipse of the region on current plot.

R.plot_ellipse(ls) as above but the optional line style arguments ls are passed to plot.

If R is a vector then each element is plotted.


Machine Vision Toolbox for MATLAB © 1990-2014 Peter Corke.