DrawBoundingBoxes(BlobList, Color, FigureHandle);
a list of blob features, should be generated using AnalyzeBlobs
a vector with three elements, all elements must be in the interval [0, 1].
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.
This function draws bounding boxes into an image. Thus it is possible to mark objects found in an image with rectangles.
RGB = imread('contrib\IPD-5.0\demos\teaset.png'); Image = RGB2Gray(RGB); ThresholdedImage = SegmentbyThreshold(Image, 200); BlobImage = SearchBlobs(ThresholdedImage); FilteredBlobImage = FilterBySize(BlobImage, 100); // 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); Figure = figure(); ShowImage(FilteredBlobImage, 'BlobImage', jetcolormap(16)); DrawBoundingBoxes(BlobStatistics, Figure1, [1 1 1]); // Bounding boxes are drawn in white.