![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
Initializes the clusters for K-Mean classification. More...
| IPSDKIPLCLASSIFICATION_API attr::ClustersCentersPtr | ipsdk::imaproc::classif::kMeansPPClusterInit (const ipsdk::image::ImageConstPtr &pInImg, const ipsdk::ipUInt32 inNbClusters) |
| wrapper function for Initializes the clusters for K-Mean classification The algorithm used is K-Mean++ and is based on random cluster selection More... | |
| IPSDKIPLCLASSIFICATION_API attr::ClustersCentersPtr | ipsdk::imaproc::classif::kMeansPPClusterInit (const ipsdk::image::ImageConstPtr &pInImg, const ipsdk::image::ImageConstPtr &pInOptSingleGreyMaskImg, const ipsdk::ipUInt32 inNbClusters) |
| wrapper function for Initializes the clusters for K-Mean classification The algorithm used is K-Mean++ and is based on random cluster selection More... | |
| IPSDKIPLCLASSIFICATION_API attr::ClustersCentersPtr | ipsdk::imaproc::classif::nonRandomKMeansPPClusterInit (const ipsdk::image::ImageConstPtr &pInImg, const ipsdk::ipUInt32 inNbClusters) |
| wrapper function for Initializes the clusters for K-Mean classification The algorithm used a non-random version of the K-Mean++ algorithm More... | |
| IPSDKIPLCLASSIFICATION_API attr::ClustersCentersPtr | ipsdk::imaproc::classif::nonRandomKMeansPPClusterInit (const ipsdk::image::ImageConstPtr &pInImg, const ipsdk::image::ImageConstPtr &pInOptSingleGreyMaskImg, const ipsdk::ipUInt32 inNbClusters) |
| wrapper function for Initializes the clusters for K-Mean classification The algorithm used a non-random version of the K-Mean++ algorithm More... | |
Initializes the clusters for K-Mean classification.
Classical random K-means algorithm initialization can lead to a sub-optimal classification and can vary between two calculations. Defining a relevant cluster initialization is an important problem in order to produce a robust and repeatable classification.
This algorithm can compute two versions of the K-Means++ initialization algorithm :
, just like for the classical K-Means.
is then compute between this center and each pixels of the image :
is also generated in order to have
. The new center is the first pixel where the cumulated distance is greater than
.
is calculated as described above.Here is an example of a non-random cluster center classification on a UInt8 gray-level image with 5 clusters:
We can read on the abscissa axis the grey level intensity. The small points represent the pixels in the image, colored according to the cluster initialization. The squares illustrates the final cluster centers whereas the diamonds correspond to the first center as described in the step 1 of one of the algorithm versions.
If a mask image is provided, only pixels where the mask equals True can be used as a center. In the random case, the first center is randomly defined and until it corresponds to a value of False in the mask image. In the non-random case, the first center is the first pixel where the mask equals True: the first line is scanned, if all the pixels in the first line have False in the mask image, the second line is scanned, etc. To define the other centers, only pixels where the mask image equals True are used for the distance map calculation.
[1] "K-means++: The Advantages of Careful Seeding", Arthur, D. and Vassilvitskii, S, Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms, 2007, 1027-1035
Attribute description for algorithm :
| Name | ToolTip | Default Initializer |
|---|---|---|
| ipsdk::imaproc::attr::InHomogeneousImg | [Input] Homogeneous image | X |
| ipsdk::imaproc::attr::InOptSingleGreyMaskImg | [Input Optional] Binary image for masking operation for each (x, y, z) coordinate regardless to (c, t) coordinates | X |
| ipsdk::imaproc::attr::InNbClusters | [Input] Number of clusters | X |
| ipsdk::imaproc::attr::InRandomAlgoType | [Input] Informs if the algorithm uses a random approach or not (used for instance in the KMeansPPClusterInit algorithm) | X |
| ipsdk::imaproc::attr::InOutOptWk1RealImg | [InOut Optional] Temporary working image for algorithm (data contained in image buffer are reals) | X |
| ipsdk::imaproc::attr::OutOptWk1RealImg | [Output Optional] Temporary working image for algorithm (data contained in image buffer are reals) | X |
| ipsdk::imaproc::attr::OutClustersCenters | [Output] Centers of clusters | ipsdk::processor::allocate (_pOutClustersCenters) |
Global rule description for algorithm :
ipsdk::processor::ifIsSet (_pInOutOptWk1RealImg,
ipsdk::imaproc::matchSize (eMatchImageSizeType::eMIST_3d,_pInHomogeneousImg,_pInOutOptWk1RealImg) &&
ipsdk::processor::ifIsSet (_pOutOptWk1RealImg,
ipsdk::imaproc::matchSize (eMatchImageSizeType::eMIST_3d,_pInHomogeneousImg,_pOutOptWk1RealImg) &&
ipsdk::imaproc::matchSizeAndType (_pInOutOptWk1RealImg,_pOutOptWk1RealImg))) &&
ipsdk::processor::ifIsSet (_pInOptSingleGreyMaskImg,
ipsdk::imaproc::matchSize (eMatchImageSizeType::eMIST_3d,_pInHomogeneousImg,_pInOptSingleGreyMaskImg))
| IPSDKIPLCLASSIFICATION_API attr::ClustersCentersPtr ipsdk::imaproc::classif::kMeansPPClusterInit | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::ipUInt32 | inNbClusters | ||
| ) |
wrapper function for Initializes the clusters for K-Mean classification The algorithm used is K-Mean++ and is based on random cluster selection
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLCLASSIFICATION_API attr::ClustersCentersPtr ipsdk::imaproc::classif::nonRandomKMeansPPClusterInit | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::ipUInt32 | inNbClusters | ||
| ) |
wrapper function for Initializes the clusters for K-Mean classification The algorithm used a non-random version of the K-Mean++ algorithm
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLCLASSIFICATION_API attr::ClustersCentersPtr ipsdk::imaproc::classif::kMeansPPClusterInit | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::image::ImageConstPtr & | pInOptSingleGreyMaskImg, | ||
| const ipsdk::ipUInt32 | inNbClusters | ||
| ) |
wrapper function for Initializes the clusters for K-Mean classification The algorithm used is K-Mean++ and is based on random cluster selection
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLCLASSIFICATION_API attr::ClustersCentersPtr ipsdk::imaproc::classif::nonRandomKMeansPPClusterInit | ( | const ipsdk::image::ImageConstPtr & | pInImg, |
| const ipsdk::image::ImageConstPtr & | pInOptSingleGreyMaskImg, | ||
| const ipsdk::ipUInt32 | inNbClusters | ||
| ) |
wrapper function for Initializes the clusters for K-Mean classification The algorithm used a non-random version of the K-Mean++ algorithm
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
1.8.14