Back to FabImage Library website
You are here: Start » Function Reference » Computer Vision » Image Segmentation » ExtractBlobs_Color

ExtractBlobs_Color
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationBasic |
Segments an image into blobs by color-based thresholding.
Syntax
C++
C#
void fil::ExtractBlobs_Color ( const fil::Image& inImage, ftl::Optional<const fil::ShapeRegion&> inRoi, ftl::Optional<const fil::CoordinateSystem2D&> inRoiAlignment, const fil::ColorThresholdParams& inThresholdParams, const fil::RegionProcessingParams& inRegionProcessingParams, const fil::BlobSplittingParams& inBlobSplittingParams, ftl::Array<fil::Region>& outBlobs, ftl::Array<int>& diagBlobAreas, fil::Region& diagBaseRegion )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inImage | const Image& | Image from which blobs are extracted | |
![]() |
inRoi | Optional<const ShapeRegion&> | NIL | Range of pixels to be processed |
![]() |
inRoiAlignment | Optional<const CoordinateSystem2D&> | NIL | Adjusts the region |
![]() |
inThresholdParams | const ColorThresholdParams& | Parameters for color-based thresholding | |
![]() |
inRegionProcessingParams | const RegionProcessingParams& | Parameters for opening and closing of a region | |
![]() |
inBlobSplittingParams | const BlobSplittingParams& | Parameters for splitting region into blobs | |
![]() |
outBlobs | Array<Region>& | Blobs extracted from the input image | |
![]() |
diagBlobAreas | Array<int>& | Areas of extracted blobs | |
![]() |
diagBaseRegion | Region& | Region of pixels right after thresholding |
Requirements
For input inImage only pixel formats are supported: 1⨯uint8, 2⨯uint8, 3⨯uint8, 4⨯uint8.
Read more about pixel formats in Image documentation.
Description
This filter can be used to quickly segment an image using color-based thresholding. It performs a series of operations on inImage:
- image is thresholded by ThresholdToRegion_Color using parameters from inThresholdParams
- resulting region is opened and then closed by OpenRegion and CloseRegion using parameters from inRegionProcessingParams
- resulting region is split into blobs by SplitRegionIntoBlobs using parameters from inBlobSplittingParams
Examples
![]() |
![]() |
ExtractBlobs_Color performed on the sample image with inThresholdParams.RgbColor = (189, 36, 25), inThresholdParams.MaxDifference = 40.0 and inRegionProcessingParams.ClosingRadius = 5.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Region exceeds an input image in ExtractBlobs_Color. |
DomainError | Not supported inImage pixel format in ExtractBlobs_Color. Supported formats: 1xUInt8, 2xUInt8, 3xUInt8, 4xUInt8. |
See Also
- ExtractBlobs_Intensity – Segments an image into blobs by thresholding.
- ExtractBlobs_Dynamic – Segments an image into blobs by dynamic thresholding.
- ExtractBlobs_DoG – Segments an image into blobs by thresholding Difference of Gaussians.