Back to Adaptive Vision Library websiteYou are here:
Start »
Function Reference »
Image Segmentation »
SegmentImage_Gray
Segments an image into blobs examining differences between neighbouring pixels values.
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
)
void SegmentImage_Gray
(
Image inImage,
Region? inRoi,
float inMaxDifference,
BlobsDifferenceMeasure inDifferenceMeasure,
int inMinArea,
int? inMaxArea,
out 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
SegmentImage_Gray performed on the sample image with inMaxDifference = 55, inDifferenceMeasure = Mean and inMinArea = 50.
Errors
Error type |
Description |
DomainError |
Not supported difference measure in SegmentImage_Gray. |
See Also
- ImageWatersheds – Computes dark basins which are separated by at least inThreshold height watershed.