Geogram  Version 1.9.1
A programming library of geometric algorithms
GEO::StructuringElement Class Reference

A structuring element, that is the definition of neighborhood used by a morphological operation. More...

#include <geogram/image/morpho_math.h>

Public Member Functions

 StructuringElement (Image *source)
 StructuringElement constructor. More...
 
index_t radius () const
 Gets the radius. More...
 
void add_neighbor (int xrel, int yrel)
 Adds a neighbor to this structuting element. More...
 
void convolve (Memory::byte *from, Memory::byte *to) const
 Computes the convolution at a given memory location. More...
 
void convolve (int x, int y, Image *target_img) const
 Computes the convolution at a given pixel. More...
 

Detailed Description

A structuring element, that is the definition of neighborhood used by a morphological operation.

Definition at line 57 of file morpho_math.h.

Constructor & Destructor Documentation

◆ StructuringElement()

GEO::StructuringElement::StructuringElement ( Image source)
inline

StructuringElement constructor.

Parameters
[in]sourcea pointer to the source image.

Definition at line 64 of file morpho_math.h.

Member Function Documentation

◆ add_neighbor()

void GEO::StructuringElement::add_neighbor ( int  xrel,
int  yrel 
)
inline

Adds a neighbor to this structuting element.

Parameters
[in]xrel,yrelthe coordinates of the neighbor, relative to the center of this structuring element.

Definition at line 85 of file morpho_math.h.

◆ convolve() [1/2]

void GEO::StructuringElement::convolve ( int  x,
int  y,
Image target_img 
) const
inline

Computes the convolution at a given pixel.

The source image is the one that was specified to the constructor of this StructuringElement.

Parameters
[in]x,ythe coordinates of the pixel.
[in]target_imga pointer to the target image.

Definition at line 109 of file morpho_math.h.

◆ convolve() [2/2]

void GEO::StructuringElement::convolve ( Memory::byte from,
Memory::byte to 
) const

Computes the convolution at a given memory location.

Parameters
[in]froma pointer to the source pixel at the center of the structuring element.
[in]toa pointer to the target pixel at the center of the structuring element.

◆ radius()

index_t GEO::StructuringElement::radius ( ) const
inline

Gets the radius.

Returns
the maximum difference of coordinate between the center and one of the neighbors.

Definition at line 76 of file morpho_math.h.


The documentation for this class was generated from the following file: