<< DistanceTransform IPD - Image Processing Design EdgeFilter >>

IPD - Image Processing Design >> IPD - Image Processing Design > DrawBoundingBoxes

DrawBoundingBoxes

draws bounding boxes into an image

Calling Sequence

DrawBoundingBoxes(BlobList, Color, FigureHandle);

Parameters

BlobList

a list of blob features, should be generated using AnalyzeBlobs

Color

a vector with three elements, all elements must be in the interval [0, 1].

FigureHandle

Handle to the graphic window where the bounding boxes shall be drawn. This parameter is optional. If it is omitted, the bounding boxes are drawn in the current figure.

Description

This function draws bounding boxes into an image. Thus it is possible to mark objects found in an image with rectangles.

Examples

global IPD_PATH;

RGB = ReadImage(IPD_PATH + 'demos\teaset.png');

Image = RGB2Gray(RGB);

Image = uint8(255 * ones(size(Image, 1), size(Image, 2))) - Image;

ThresholdedImage = SegmentByThreshold(Image, 100);

BlobImage = SearchBlobs(ThresholdedImage);

FilteredBlobImage = FilterBySize(BlobImage, 10000); // Small objects are removed.

IsCalculated = CreateFeatureStruct(%f); // Feature struct is generated.

IsCalculated.BoundingBox = %t; // The bounding box shall be calculated for each blob.

BlobStatistics = AnalyzeBlobs(FilteredBlobImage, IsCalculated);

FigureWindow = figure();

ShowImage(FilteredBlobImage, 'Blob Image', jetcolormap(4));

DrawBoundingBoxes(BlobStatistics, [1 1 1], FigureWindow); // Bounding boxes are drawn in white.

See also

<< DistanceTransform IPD - Image Processing Design EdgeFilter >>