ImageMorphology

class ImageMorphology

Bases: pybind11_object

Various mathematical morphology tools, erosion, dilatation…

Methods

__init__

dilatation

Overloaded function.

erosion

Overloaded function.

Inherited Methods

Operators

__doc__

__init__

__module__

Attributes

CONNEXITY_4

CONNEXITY_8

__annotations__

class ConnexityType(self, value: int)

Bases: pybind11_object

Type of connexity 4, or 8.

Values:

  • CONNEXITY_4: For a given pixel 4 neighbors are considered (left, right, up, down)

  • CONNEXITY_8: For a given pixel 8 neighbors are considered (left, right, up, down, and the 4 pixels located on the diagonal)

__and__(self, other: object) object
__eq__(self, other: object) bool
__ge__(self, other: object) bool
__getstate__(self) int
__gt__(self, other: object) bool
__hash__(self) int
__index__(self) int
__init__(self, value: int)
__int__(self) int
__invert__(self) object
__le__(self, other: object) bool
__lt__(self, other: object) bool
__ne__(self, other: object) bool
__or__(self, other: object) object
__rand__(self, other: object) object
__ror__(self, other: object) object
__rxor__(self, other: object) object
__setstate__(self, state: int) None
__xor__(self, other: object) object
property name : str
__init__(*args, **kwargs)
static dilatation(*args, **kwargs)

Overloaded function.

  1. dilatation(I: visp._visp.core.ImageGray, value: int, value_out: int, connexity: visp._visp.core.ImageMorphology.ConnexityType) -> None

Dilate a binary image using a structuring element of size one.

To dilate a black area in an unsigned char image with one element mask, set value to 0 and value_out to 255.

To dilate a white area in an unsigned char image with one element mask, set value to 255 and value_out to 0.

Note

See erosion()

Parameters:
I

Image to process.

value

Values of the pixels to dilate.

value_out

Value to set if dilatation is done.

connexity

Type of connexity: 4 or 8.

  1. dilatation(I: visp._visp.core.ImageFloat, value: float, value_out: float, connexity: visp._visp.core.ImageMorphology.ConnexityType) -> None

Dilate a binary image using a structuring element of size one.

To dilate a black area in an unsigned char image with one element mask, set value to 0 and value_out to 255.

To dilate a white area in an unsigned char image with one element mask, set value to 255 and value_out to 0.

Note

See erosion()

Parameters:
I

Image to process.

value

Values of the pixels to dilate.

value_out

Value to set if dilatation is done.

connexity

Type of connexity: 4 or 8.

  1. dilatation(I: visp._visp.core.ImageDouble, value: float, value_out: float, connexity: visp._visp.core.ImageMorphology.ConnexityType) -> None

Dilate a binary image using a structuring element of size one.

To dilate a black area in an unsigned char image with one element mask, set value to 0 and value_out to 255.

To dilate a white area in an unsigned char image with one element mask, set value to 255 and value_out to 0.

Note

See erosion()

Parameters:
I

Image to process.

value

Values of the pixels to dilate.

value_out

Value to set if dilatation is done.

connexity

Type of connexity: 4 or 8.

  1. dilatation(I: visp._visp.core.ImageGray, connexity: visp._visp.core.ImageMorphology.ConnexityType = CONNEXITY_4) -> None

  2. dilatation(I: visp._visp.core.ImageFloat, connexity: visp._visp.core.ImageMorphology.ConnexityType = CONNEXITY_4) -> None

  3. dilatation(I: visp._visp.core.ImageDouble, connexity: visp._visp.core.ImageMorphology.ConnexityType = CONNEXITY_4) -> None

  4. dilatation(I: visp._visp.core.ImageGray, size: int) -> None

Dilatation of size >=3 with 8-connectivity.

The dilatation of \(A \left( x, y \right)\) by \(B \left (x, y \right)\) is defined as:

\[\left ( A \oplus B \right ) \left( x,y \right) = \textbf{max} \left \{ A \left ( x-x', y-y' \right ) + B \left ( x', y'\right ) | \left ( x', y'\right ) \subseteq D_B \right \} \]

where \(D_B\) is the domain of the structuring element \(B\) and \(A \left( x,y \right)\) is assumed to be \(- \infty\) outside the domain of the image.

In our case, the dilatation is performed with a flat structuring element \(\left( B \left( x,y \right) = 0 \right)\) . The dilatation using such a structuring element is equivalent to a local-maximum operator:

\[\left ( A \oplus B \right ) \left( x,y \right) = \textbf{max} \left \{ A \left ( x-x', y-y' \right ) | \left ( x', y'\right ) \subseteq D_B \right \} \]

Note

See erosion(vpImage<T> &, const int &)

Parameters:
I

The image to which the dilatation must be applied, where the dilatation corresponds to a max operator on a window of size size .

size

The size of the window on which is performed the max operator for each pixel.

  1. dilatation(I: visp._visp.core.ImageFloat, size: int) -> None

Dilatation of size >=3 with 8-connectivity.

The dilatation of \(A \left( x, y \right)\) by \(B \left (x, y \right)\) is defined as:

\[\left ( A \oplus B \right ) \left( x,y \right) = \textbf{max} \left \{ A \left ( x-x', y-y' \right ) + B \left ( x', y'\right ) | \left ( x', y'\right ) \subseteq D_B \right \} \]

where \(D_B\) is the domain of the structuring element \(B\) and \(A \left( x,y \right)\) is assumed to be \(- \infty\) outside the domain of the image.

In our case, the dilatation is performed with a flat structuring element \(\left( B \left( x,y \right) = 0 \right)\) . The dilatation using such a structuring element is equivalent to a local-maximum operator:

\[\left ( A \oplus B \right ) \left( x,y \right) = \textbf{max} \left \{ A \left ( x-x', y-y' \right ) | \left ( x', y'\right ) \subseteq D_B \right \} \]

Note

See erosion(vpImage<T> &, const int &)

Parameters:
I

The image to which the dilatation must be applied, where the dilatation corresponds to a max operator on a window of size size .

size

The size of the window on which is performed the max operator for each pixel.

  1. dilatation(I: visp._visp.core.ImageDouble, size: int) -> None

Dilatation of size >=3 with 8-connectivity.

The dilatation of \(A \left( x, y \right)\) by \(B \left (x, y \right)\) is defined as:

\[\left ( A \oplus B \right ) \left( x,y \right) = \textbf{max} \left \{ A \left ( x-x', y-y' \right ) + B \left ( x', y'\right ) | \left ( x', y'\right ) \subseteq D_B \right \} \]

where \(D_B\) is the domain of the structuring element \(B\) and \(A \left( x,y \right)\) is assumed to be \(- \infty\) outside the domain of the image.

In our case, the dilatation is performed with a flat structuring element \(\left( B \left( x,y \right) = 0 \right)\) . The dilatation using such a structuring element is equivalent to a local-maximum operator:

\[\left ( A \oplus B \right ) \left( x,y \right) = \textbf{max} \left \{ A \left ( x-x', y-y' \right ) | \left ( x', y'\right ) \subseteq D_B \right \} \]

Note

See erosion(vpImage<T> &, const int &)

Parameters:
I

The image to which the dilatation must be applied, where the dilatation corresponds to a max operator on a window of size size .

size

The size of the window on which is performed the max operator for each pixel.

static erosion(*args, **kwargs)

Overloaded function.

  1. erosion(I: visp._visp.core.ImageGray, value: int, value_out: int, connexity: visp._visp.core.ImageMorphology.ConnexityType) -> None

Erode a binary image using a structuring element of size one.

To erode a black area in an unsigned char image, set value to 0 and value_out to 255.

To erode a white area in an unsigned char image with one element mask, set value to 255 and value_out to 0.

Note

See dilatation()

Parameters:
I

Image to process.

value

Values of the pixels to erode.

value_out

Value to set if erosion is done.

connexity

Type of connexity: 4 or 8.

  1. erosion(I: visp._visp.core.ImageFloat, value: float, value_out: float, connexity: visp._visp.core.ImageMorphology.ConnexityType) -> None

Erode a binary image using a structuring element of size one.

To erode a black area in an unsigned char image, set value to 0 and value_out to 255.

To erode a white area in an unsigned char image with one element mask, set value to 255 and value_out to 0.

Note

See dilatation()

Parameters:
I

Image to process.

value

Values of the pixels to erode.

value_out

Value to set if erosion is done.

connexity

Type of connexity: 4 or 8.

  1. erosion(I: visp._visp.core.ImageDouble, value: float, value_out: float, connexity: visp._visp.core.ImageMorphology.ConnexityType) -> None

Erode a binary image using a structuring element of size one.

To erode a black area in an unsigned char image, set value to 0 and value_out to 255.

To erode a white area in an unsigned char image with one element mask, set value to 255 and value_out to 0.

Note

See dilatation()

Parameters:
I

Image to process.

value

Values of the pixels to erode.

value_out

Value to set if erosion is done.

connexity

Type of connexity: 4 or 8.

  1. erosion(I: visp._visp.core.ImageGray, connexity: visp._visp.core.ImageMorphology.ConnexityType = CONNEXITY_4) -> None

  2. erosion(I: visp._visp.core.ImageFloat, connexity: visp._visp.core.ImageMorphology.ConnexityType = CONNEXITY_4) -> None

  3. erosion(I: visp._visp.core.ImageDouble, connexity: visp._visp.core.ImageMorphology.ConnexityType = CONNEXITY_4) -> None

  4. erosion(I: visp._visp.core.ImageGray, size: int) -> None

Erosion of size >=3 with 8-connectivity. Erode an image using the given structuring element.

The erosion of \(A \left( x, y \right)\) by \(B \left (x, y \right)\) is defined as:

\[\left ( A \ominus B \right ) \left( x,y \right) = \textbf{min} \left \{ A \left ( x+x', y+y' \right ) - B \left ( x', y'\right ) | \left ( x', y'\right ) \subseteq D_B \right \} \]

where \(D_B\) is the domain of the structuring element \(B\) and \(A \left( x,y \right)\) is assumed to be \(+ \infty\) outside the domain of the image.

In our case, the erosion is performed with a flat structuring element \(\left( B \left( x,y \right) = 0 \right)\) . The erosion using such a structuring element is equivalent to a local-minimum operator:

\[\left ( A \ominus B \right ) \left( x,y \right) = \textbf{min} \left \{ A \left ( x+x', y+y' \right ) | \left ( x', y'\right ) \subseteq D_B \right \} \]

Note

See dilatation(vpImage<T> &, const int &)

Parameters:
I

The image to which the erosion must be applied, where the erosion corresponds to a min operator on a window of size size .

size

The size of the window on which is performed the min operator for each pixel.

  1. erosion(I: visp._visp.core.ImageFloat, size: int) -> None

Erosion of size >=3 with 8-connectivity. Erode an image using the given structuring element.

The erosion of \(A \left( x, y \right)\) by \(B \left (x, y \right)\) is defined as:

\[\left ( A \ominus B \right ) \left( x,y \right) = \textbf{min} \left \{ A \left ( x+x', y+y' \right ) - B \left ( x', y'\right ) | \left ( x', y'\right ) \subseteq D_B \right \} \]

where \(D_B\) is the domain of the structuring element \(B\) and \(A \left( x,y \right)\) is assumed to be \(+ \infty\) outside the domain of the image.

In our case, the erosion is performed with a flat structuring element \(\left( B \left( x,y \right) = 0 \right)\) . The erosion using such a structuring element is equivalent to a local-minimum operator:

\[\left ( A \ominus B \right ) \left( x,y \right) = \textbf{min} \left \{ A \left ( x+x', y+y' \right ) | \left ( x', y'\right ) \subseteq D_B \right \} \]

Note

See dilatation(vpImage<T> &, const int &)

Parameters:
I

The image to which the erosion must be applied, where the erosion corresponds to a min operator on a window of size size .

size

The size of the window on which is performed the min operator for each pixel.

  1. erosion(I: visp._visp.core.ImageDouble, size: int) -> None

Erosion of size >=3 with 8-connectivity. Erode an image using the given structuring element.

The erosion of \(A \left( x, y \right)\) by \(B \left (x, y \right)\) is defined as:

\[\left ( A \ominus B \right ) \left( x,y \right) = \textbf{min} \left \{ A \left ( x+x', y+y' \right ) - B \left ( x', y'\right ) | \left ( x', y'\right ) \subseteq D_B \right \} \]

where \(D_B\) is the domain of the structuring element \(B\) and \(A \left( x,y \right)\) is assumed to be \(+ \infty\) outside the domain of the image.

In our case, the erosion is performed with a flat structuring element \(\left( B \left( x,y \right) = 0 \right)\) . The erosion using such a structuring element is equivalent to a local-minimum operator:

\[\left ( A \ominus B \right ) \left( x,y \right) = \textbf{min} \left \{ A \left ( x+x', y+y' \right ) | \left ( x', y'\right ) \subseteq D_B \right \} \]

Note

See dilatation(vpImage<T> &, const int &)

Parameters:
I

The image to which the erosion must be applied, where the erosion corresponds to a min operator on a window of size size .

size

The size of the window on which is performed the min operator for each pixel.