Back to Aurora Vision Library website
You are here: Start » Function Reference » Computer Vision » Image Segmentation » SegmentImage_Gray
SegmentImage_Gray
Header: | AVL.h |
---|---|
Namespace: | avl |
Module: | FoundationPro |
Segments an image into blobs examining differences between neighbouring pixels values.
Applications: Detection of objects of undefined shape, but characterized by uniform brightness and good contrast to the background.
Syntax
C++
C#
void avl::SegmentImage_Gray ( const avl::Image& inImage, atl::Optional<const avl::Region&> inRoi, const float inMaxDifference, const avl::BlobsDifferenceMeasure::Type inDifferenceMeasure, const int inMinArea, atl::Optional<int> inMaxArea, atl::Array<avl::Region>& outBlobs )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
inImage | const Image& | Image from which blobs are extracted | |||
inRoi | Optional<const Region&> | NIL | Range of pixels to be processed | ||
inMaxDifference | const float | 0.0 - | 5.0f | Maximal difference between two neighbouring blobs to be merged | |
inDifferenceMeasure | const BlobsDifferenceMeasure::Type | Neighbour | Measure of blobs difference | ||
inMinArea | const int | 0 - | 50 | Minimal area of a blob | |
inMaxArea | Optional<int> | 0 - | NIL | Maximal area of a blob | |
outBlobs | Array<Region>& | Blobs extracted from the input image |
Description
The filter segments the inImage image into blobs of adjacent pixels which gray values do not differ too much. The classification is different depending on the inDifferenceMeasure method:
- if Mean is selected, pixel is considered to belong to an adjacent blob when its value differs by at most inMaxDifference from the mean value of this blob's pixels
- if Neighbour is selected, two adjacent pixels are considered to belong to the same blob when their values differ by at most inMaxDifference
Examples
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Not supported difference measure in SegmentImage_Gray. |
See Also
- SegmentImage_Edges – Segments an image into blobs using image edges as their borders.
- SegmentImage_Watersheds – Computes dark or bright watershed basins of an image.