EasyColor::AssignNearestClass
Assigns to every pixel of the source image the nearest class index plus one and stores its value in the destination image.
Namespace: Euresys::Open_eVision
[C++]
static void AssignNearestClass(
const EROIC24
* sourceImage,
EROIBW8
* destinationImage,
const EC24Vector
* classCenters
)
Parameters
sourceImage
Pointer to the source image/ROI.
destinationImage
Pointer to the destination gray-level image/ROI.
classCenters
Pointer to the vector of the class centers.
Remarks
This generates a labeled gray-level image for use with EasyObject (see EImageEncoder
and ELabeledImageSegmenter
).
Note. The class index plus one is stored instead of the class index because EasyObject will never code class 0 objects.
Color image segmentation allows you to decompose a color image in different regions by assigning a "class" (integer index) to every pixel. The nearest neighbor method is used, i.e. for each class a representative center is specified, and a given pixel is associated to the class with the closest center.
Color image segmentation can be used in conjunction with EasyObject to perform blob Synonym of object. analysis on the segmented regions.
To use the color segmentation functions, the set of class centers must be specified as a vector of EC24
elements. In this sense, the method is termed supervised clustering. A good way to obtain these values is to compute the average color in an ROI.
Unsupervised clustering is also made available by implementing the so called K-means method that automatically improves an initial choice of class centers.
EasyColor.AssignNearestClass
Assigns to every pixel of the source image the nearest class index plus one and stores its value in the destination image.
Namespace: Euresys.Open_eVision
[C#]
static void AssignNearestClass(
EROIC24
sourceImage,
EROIBW8
destinationImage,
EC24Vector
classCenters
)
Parameters
sourceImage
Pointer to the source image/ROI.
destinationImage
Pointer to the destination gray-level image/ROI.
classCenters
Pointer to the vector of the class centers.
Remarks
This generates a labeled gray-level image for use with EasyObject (see EImageEncoder
and ELabeledImageSegmenter
).
Note. The class index plus one is stored instead of the class index because EasyObject will never code class 0 objects.
Color image segmentation allows you to decompose a color image in different regions by assigning a "class" (integer index) to every pixel. The nearest neighbor method is used, i.e. for each class a representative center is specified, and a given pixel is associated to the class with the closest center.
Color image segmentation can be used in conjunction with EasyObject to perform blob analysis on the segmented regions.
To use the color segmentation functions, the set of class centers must be specified as a vector of EC24
elements. In this sense, the method is termed supervised clustering. A good way to obtain these values is to compute the average color in an ROI.
Unsupervised clustering is also made available by implementing the so called K-means method that automatically improves an initial choice of class centers.
EasyColor.AssignNearestClass
Assigns to every pixel of the source image the nearest class index plus one and stores its value in the destination image.
Module: open_evision
[Python]
@staticmethod
AssignNearestClass(
sourceImage: EROIC24
destinationImage: EROIBW8
classCenters: EC24Vector
) -> None
Parameters
sourceImage
Pointer to the source image/ROI.
destinationImage
Pointer to the destination gray-level image/ROI.
classCenters
Pointer to the vector of the class centers.
Remarks
This generates a labeled gray-level image for use with EasyObject (see EImageEncoder
and ELabeledImageSegmenter
).
Note. The class index plus one is stored instead of the class index because EasyObject will never code class 0 objects.
Color image segmentation allows you to decompose a color image in different regions by assigning a "class" (integer index) to every pixel. The nearest neighbor method is used, i.e. for each class a representative center is specified, and a given pixel is associated to the class with the closest center.
Color image segmentation can be used in conjunction with EasyObject to perform blob analysis on the segmented regions.
To use the color segmentation functions, the set of class centers must be specified as a vector of EC24
elements. In this sense, the method is termed supervised clustering. A good way to obtain these values is to compute the average color in an ROI.
Unsupervised clustering is also made available by implementing the so called K-means method that automatically improves an initial choice of class centers.