Represents a 3x3x3 kernel dedicated to be applied on a binary image. Each kernel element can be assigned to one of three different values.
A 3D morphological kernel contains exactly 27 values and indexes matching the following table:
for z = 0for z = 1for z = 2[012345678][91011121314151617][181920212223242526]
Accepted values for the kernel are:
ZERO: pixel is off
ONE: pixel is on
ANY: pixel is ignored
Syntax
Method
Description
Ptr New( Value value = ZERO )
Constructor returning a kernel with all elements initialized with the same value
value: the value to assign.
Value getValue( int index )
get the value of a specific kernel's element at the position index
index: the position of the kernel's element between 0 and 26.
void setValue( int index, Values value )
Assigns a value to a specific kernel's element
index: the position of the kernel's element between 0 and 26.
value: the value to assign.
void setAllValues(Values value = ZERO )
Assigns the same value to all kernel elements.
value: the default value for all of a kernel's elements.
void rotateX( size_t rotation = 1 )
Applies a direct rotation of a PI/4 multiple around the kernel's X axis.
[18902112324156] =>[90318126212415]
rotation: the number of rotations of PI/4.
void rotateY( size_t rotation = 1 )
Applies a direct rotation of a PI/4 multiple around the kernel's Y axis.
[678151617242526] =>[781761626152425]
rotation: the number of rotations of PI/4.
void rotateZ( size_t rotation = 1 )
Applies a direct rotation of a PI/4 multiple around the kernel's Z axis.
[012345678] =>[125048367]
rotation: the number of rotations of PI/4.
Method
Description
MorphologicalKernel3d(value)
Constructor returning a kernel with all elements initialized with the same value
value: the value to assign.
get_value(index)
get the value of a specific kernel's element at the position index
index: the position of the kernel's element between 0 and 26.
set_value(index, value)
Assigns a value to a specific kernel's element
index: the position of the kernel's element between 0 and 26.
value: the value to assign.
set_all_values(value)
Assigns the same value to all kernel elements.
value: the default value for all of a kernel's elements.
rotate_x(rotation)
Applies a direct rotation of a PI/4 multiple around the kernel's X axis.
[18902112324156] =>[90318126212415]
rotation: the number of rotations of PI/4.
rotate_y(rotation)
Applies a direct rotation of a PI/4 multiple around the kernel's Y axis.
[678151617242526] =>[781761626152425]
rotation: the number of rotations of PI/4.
rotate_z(rotation)
Applies a direct rotation of a PI/4 multiple around the kernel's Z axis.
[012345678] =>[125048367]
rotation: the number of rotations of PI/4.
Method
Description
public MorphologicalKernel3d(Values initValue)
Constructor returning a kernel with all elements initialized with the same value
value: the value to assign.
Value GetValue(int index)
get the value of a specific kernel's element at the position index
index: the position of the kernel's element between 0 and 26.
void SetValue(int index, Values value)
Assigns a value to a specific kernel's element
index: the position of the kernel's element between 0 and 26.
value: the value to assign.
void SetAllValues(Values value)
Assigns the same value to all kernel elements.
value: the default value for all of a kernel's elements.
void RotateX(int rotation)
Applies a direct rotation of a PI/4 multiple around the kernel's X axis.
[18902112324156] =>[90318126212415]
rotation: the number of rotations of PI/4.
void RotateY(int rotation)
Applies a direct rotation of a PI/4 multiple around the kernel's Y axis.
[678151617242526] =>[781761626152425]
rotation: the number of rotations of PI/4.
void RotateZ(int rotation)
Applies a direct rotation of a PI/4 multiple around the kernel's Z axis.
[012345678] =>[125048367]