![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
Posterize an image using the results from k-means algorithm. More...
Posterize an image using the results from k-means algorithm.
Fills the output image (that must have the same geometry as the input one), by replacing each pixel value of the input image (
) with the value of the center of the cluster which it belongs to. Values of clusters centers are defined by
attribute, and input image clustering is defined by
attribute. These 2 attributes are usually initialized using K-means algorithm.
Here is an example of posterization algorithm applied to Lena RGB image and to results of K-Means algorithm application (4 clusters expected):
It is also possible to provide a mask image. In this case, the posterized image will have a value of 0 where the mask equals False. Here is an example of masked posterization:
Attribute description for algorithm :
| Name | ToolTip | Default Initializer |
|---|---|---|
| ipsdk::imaproc::attr::InHomogeneousImg | [Input] Homogeneous image | X |
| ipsdk::imaproc::attr::InClustersCenters | [Input] centers of clusters | X |
| ipsdk::imaproc::attr::InClassImg | [Input] Image of classes | 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::OutPosterizedImg | [Output] PosterizedImg | ipsdk::imaproc::duplicateInOut (_pOutPosterizedImg, _pInHomogeneousImg) |
Global rule description for algorithm :
ipsdk::imaproc::matchSize (eMatchImageSizeType::eMIST_3d,_pInHomogeneousImg,_pInClassImg) &&
ipsdk::imaproc::classif::clustersCentersCollMatchImgSize (_pInClustersCenters,_pInHomogeneousImg) &&
ipsdk::imaproc::matchSizeAndType (_pInHomogeneousImg,_pOutPosterizedImg) &&
ipsdk::processor::If (
ipsdk::processor::isSet (_pInOptSingleGreyMaskImg),
ipsdk::imaproc::matchSize (eMatchImageSizeType::eMIST_3d,_pInHomogeneousImg,_pInOptSingleGreyMaskImg),
ipsdk::processor::none ())
| IPSDKIPLCLASSIFICATION_API image::ImagePtr ipsdk::imaproc::classif::kMeansPosterizeImg | ( | const image::ImageConstPtr & | pInImg, |
| const image::ImageConstPtr & | pClassImg, | ||
| const ipsdk::imaproc::attr::ClustersCentersConstPtr & | pClustersCenters | ||
| ) |
wrapper function for Posterize an image using the results from k-means algorithm
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLCLASSIFICATION_API image::ImagePtr ipsdk::imaproc::classif::kMeansPosterizeImg | ( | const image::ImageConstPtr & | pInImg, |
| const image::ImageConstPtr & | pClassImg, | ||
| const ipsdk::image::ImageConstPtr & | pMaskImg, | ||
| const ipsdk::imaproc::attr::ClustersCentersConstPtr & | pClustersCenters | ||
| ) |
wrapper function for Posterize an image using the results from k-means algorithm
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLCLASSIFICATION_API void ipsdk::imaproc::classif::kMeansPosterizeImg | ( | const image::ImageConstPtr & | pInImg, |
| const image::ImageConstPtr & | pClassImg, | ||
| const ipsdk::imaproc::attr::ClustersCentersConstPtr & | pClustersCenters, | ||
| const image::ImagePtr & | pOutImg | ||
| ) |
wrapper function for Posterize an image using the results from k-means algorithm
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLCLASSIFICATION_API void ipsdk::imaproc::classif::kMeansPosterizeImg | ( | const image::ImageConstPtr & | pInImg, |
| const image::ImageConstPtr & | pClassImg, | ||
| const ipsdk::image::ImageConstPtr & | pMaskImg, | ||
| const ipsdk::imaproc::attr::ClustersCentersConstPtr & | pClustersCenters, | ||
| const image::ImagePtr & | pOutImg | ||
| ) |
wrapper function for Posterize an image using the results from k-means algorithm
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
1.8.14