Reduce density of points in ROI
reduces the density of points in array P_reduced
= reducepoly(P
)P
. Specify
P
as an n-by-2 array of the form [x1 y1;
...; xn yn]
, where each row represents a point. For example,
P
could be the array returned by one of the ROI creation functions,
such as drawfreehand
or drawpolygon
.
reducepoly
returns P_reduced
, an
n-by-2 array of points that is typically smaller that
P
.
reducepoly
uses the Douglas-Peucker line simplification algorithm,
removing points along a straight line and leaving only knickpoints (points where the line
curves).
The Douglas-Peucker line simplification algorithm recursively subdivides a shape looking
to replace a run of points with a straight line. The algorithm checks that no point in the run
deviates from the straight line by more than the value specified by
tolerance
.
bwboundaries
| drawassisted
| drawfreehand
| drawpolygon
| drawpolyline