bboxB = bboxcrop(bboxA,window)
crops bounding boxes from a set of input bounding boxes, bboxA, located
in the cropping area, window.

[bboxB,indices] = bboxcrop(bboxA,window)
additionally returns a vector of indices that indicate which bounding boxes in
bboxA are within the cropping window,
window.

[___] = bboxcrop(___,'OverlapThreshold',threshold)
additionally sets an overlap threshold.

Bounding boxes, specified as an M-by-4,
M-by-5, or M-by-9 nonsparse numeric matrix.
M is the number of bounding boxes. Each row of the matrix defines a
bounding box as either an axis-aligned rectangle, a rotate rectangle, or a cuboid. This
table describes the format for each bounding box.

Bounding Box

Row

Description

Axis-aligned rectangle

[x_{min},
y_{min}, width,
height]

This type of bounding box is defined in pixel coordinates as an
M-by-4 matrix representing M bounding
boxes

Rotated rectangle

[x_{center},
y_{center}, width,
height, yaw]

This type of bounding box is defined in spatial coordinates as an
M-by-5 matrix representing M bounding
boxes. The x_{center} and
y_{center} coordinates represent the
center of the bounding box. The width and
height elements represent the length of the box along the
x and y axes, respectively. The
yaw represents the rotation angle in degrees. The amount
of rotation about the center of the bounding box is measured in the clockwise
direction.

Defined in spatial coordinates as an M-by-9 matrix
representing M bounding boxes. The
x_{center},
y_{center}, and
y_{center} coordinates represent the
center of the bounding box. The width and
height elements represent the length of the box along
the x and y axes, respectively. The
rx,ry, and rz
rotation angles are in degrees about the cuboid center. The rotation is
positive in the clockwise direction, with respect to the positive direction of
the axis.

Rotation matrices are computed assuming ZYX
order Euler angles [rx, ry,
rz].

When you specify bboxA as a rectangular input, the cropping
window must be a four-element vector in the format
[x,y,width,height].

When you specify bboxA as a cuboid, the cropping window must be
an images.spatialref.Cuboid object.

threshold — Overlap threshold 1 (default) | positive scalar less than or equal to 1

Overlap threshold, specified positive scalar less than or equal to
1. The amount of overlap between transformed boxes and the area
defined by the output view is defined as:

If the computed overlap value is greater than the value of the
threshold property, then the transformed boxes are clipped to the
bounding rectangle border. Otherwise, the boxes are discarded. Lowering the threshold
can result in parts of the object getting discarded.

Warped bounding boxes, returned as an M2-by-N
matrix of M2 bounding boxes. The number of bounding boxes returned is
less than the number of bounding boxes in the input. Each row, M2, of
the matrix defines one bounding box of the same type as the input
bboxA.

indices — Indices vector of integers

Indices, returned as a vector of integers. The indices indicate which bounding boxes
in the input, bboxA, are within the cropping window.

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.