This algorithm inserts a marker, described in a binary image, to a label image.
The result is a copy of the label image covered by the marker.
The pixels belonging to the marker are set to the value defined by the labelValue parameter.
A label image may be 8, 16 or 32 bits per pixel. By default the result of this algorithm is a 16-bit label
image, but if the number of labels exceeds 65,535 then the output image is automatically converted to 32-bit
type, and thus can manage more than two billion labels.
(a)
(b)
(c)
Figure 1. (a) Binary image describing the marker to add,
(b) label image in which the marker is inserted, (c) result image with added marker
// Function prototype.publicstaticIOLink.ImageViewAddObjectToLabel(IOLink.ImageView inputBinaryImage,IOLink.ImageView inputLabelImage,Int32 labelValue =1,IOLink.ImageView outputLabelImage =null);
Class Syntax
// Command constructor.AddObjectToLabel();/// Gets the inputBinaryImage parameter./// The input binary image.
std::shared_ptr< iolink::ImageView> inputBinaryImage()const;/// Sets the inputBinaryImage parameter./// The input binary image.void setInputBinaryImage( std::shared_ptr< iolink::ImageView> inputBinaryImage );/// Gets the inputLabelImage parameter./// The input label image. It must have same dimensions as the binary input image.
std::shared_ptr< iolink::ImageView> inputLabelImage()const;/// Sets the inputLabelImage parameter./// The input label image. It must have same dimensions as the binary input image.void setInputLabelImage( std::shared_ptr< iolink::ImageView> inputLabelImage );/// Gets the labelValue parameter./// The label value to assign.int32_t labelValue()const;/// Sets the labelValue parameter./// The label value to assign.void setLabelValue(constint32_t& labelValue );/// Gets the outputLabelImage parameter./// The output label image. Its dimensions are forced to the same values as the input.
std::shared_ptr< iolink::ImageView> outputLabelImage()const;/// Sets the outputLabelImage parameter./// The output label image. Its dimensions are forced to the same values as the input.void setOutputLabelImage( std::shared_ptr< iolink::ImageView> outputLabelImage );// Method to launch the command.void execute();
# Property of the inputBinaryImage parameter.AddObjectToLabel.input_binary_image
# Property of the inputLabelImage parameter.AddObjectToLabel.input_label_image
# Property of the labelValue parameter.AddObjectToLabel.label_value
# Property of the outputLabelImage parameter.AddObjectToLabel.output_label_image
// Method to launch the command.
execute()
// Command constructor.AddObjectToLabel()// Property of the inputBinaryImage parameter.AddObjectToLabel.inputBinaryImage
// Property of the inputLabelImage parameter.AddObjectToLabel.inputLabelImage
// Property of the labelValue parameter.AddObjectToLabel.labelValue
// Property of the outputLabelImage parameter.AddObjectToLabel.outputLabelImage
// Method to launch the command.Execute()
Parameters
Parameter Name
Description
Type
Supported Values
Default Value
inputBinaryImage
The input binary image.
Image
Binary
nullptr
inputLabelImage
The input label image. It must have same dimensions as the binary input image.
Image
Label
nullptr
labelValue
The label value to assign.
Int32
>=1
1
outputLabelImage
The output label image. Its dimensions are forced to the same values as the input.
Image
nullptr
Parameter Name
Description
Type
Supported Values
Default Value
input_binary_image
The input binary image.
image
Binary
None
input_label_image
The input label image. It must have same dimensions as the binary input image.
image
Label
None
label_value
The label value to assign.
int32
>=1
1
output_label_image
The output label image. Its dimensions are forced to the same values as the input.
image
None
Parameter Name
Description
Type
Supported Values
Default Value
inputBinaryImage
The input binary image.
Image
Binary
null
inputLabelImage
The input label image. It must have same dimensions as the binary input image.
Image
Label
null
labelValue
The label value to assign.
Int32
>=1
1
outputLabelImage
The output label image. Its dimensions are forced to the same values as the input.