TextureClassificationApply
Classifies all pixels of an image using a trained texture model.
Access to parameter description
For an introduction:
The pixel is classified as belonging to the closest class and the corresponding label is assigned to it in the output label image.
The distances are stored in an uncertainty output image in accordance with a metric defined by the outputMapType parameter.
See also
Access to parameter description
For an introduction:
- section Image Segmentation
- section Supervised Texture Classification
The pixel is classified as belonging to the closest class and the corresponding label is assigned to it in the output label image.
The distances are stored in an uncertainty output image in accordance with a metric defined by the outputMapType parameter.
See also
Function Syntax
This function returns a TextureClassificationApplyOutput structure containing outputLabelImage and outputMapImage.
// Output structure of the textureClassificationApply function. struct TextureClassificationApplyOutput { /// The output label image representing the texture classification result. Its dimensions and type are forced to the same values as the training input. std::shared_ptr< iolink::ImageView > outputLabelImage; /// The output map image. Its dimensions are forced to the same values as the training image. In CLASS_DISTANCE mode, its number of channels is equal to the number of classes defined in the training image. Its data type is forced to floating point. std::shared_ptr< iolink::ImageView > outputMapImage; }; // Function prototype
TextureClassificationApplyOutput textureClassificationApply( std::shared_ptr< iolink::ImageView > inputImage, TextureClassificationModel::Ptr inputModel, TextureClassificationApply::OutputMapType outputMapType, std::shared_ptr< iolink::ImageView > outputLabelImage = NULL, std::shared_ptr< iolink::ImageView > outputMapImage = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
inputImage |
The input grayscale image. | Image | Grayscale | nullptr | ||||||||
![]() |
inputModel |
The input texture classification model, previously trained. | TextureClassificationModel | nullptr | |||||||||
![]() |
outputMapType |
The type of uncertainty map image to compute.
|
Enumeration | CLOSEST_DISTANCE | |||||||||
![]() |
outputLabelImage |
The output label image representing the texture classification result. Its dimensions and type are forced to the same values as the training input. | Image | nullptr | |||||||||
![]() |
outputMapImage |
The output map image. Its dimensions are forced to the same values as the training image. In CLASS_DISTANCE mode, its number of channels is equal to the number of classes defined in the training image. Its data type is forced to floating point. | Image | nullptr |
Object Examples
auto classification_input = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "classification_input.vip" ); TextureClassificationModel::Ptr modelToApply= TextureClassificationModel::read( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "modelToApply.vip" ); TextureClassificationApply textureClassificationApplyAlgo; textureClassificationApplyAlgo.setInputImage( classification_input ); textureClassificationApplyAlgo.setInputModel( modelToApply ); textureClassificationApplyAlgo.setOutputMapType( TextureClassificationApply::OutputMapType::CLOSEST_DISTANCE ); textureClassificationApplyAlgo.execute(); std::cout << "outputLabelImage:" << textureClassificationApplyAlgo.outputLabelImage()->toString(); std::cout << "outputMapImage:" << textureClassificationApplyAlgo.outputMapImage()->toString();
Function Examples
auto classification_input = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "classification_input.vip" ); TextureClassificationModel::Ptr modelToApply= TextureClassificationModel::read( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "modelToApply.vip" ); auto result = textureClassificationApply( classification_input, modelToApply, TextureClassificationApply::OutputMapType::CLOSEST_DISTANCE ); std::cout << "outputLabelImage:" << result.outputLabelImage->toString(); std::cout << "outputMapImage:" << result.outputMapImage->toString();