PCL
pcl::BitmapStructure Class Reference

A structuring element where static strings are used to define custom existence matrices. More...

#include <StructuringElement.h>

+ Inheritance diagram for pcl::BitmapStructure:

Public Types

using bitmap = IsoString
 
using bitmap_set = IsoStringList
 
- Public Types inherited from pcl::StructuringElement
using existence_mask = GenericVector< existence_mask_element >
 
using existence_mask_count = GenericVector< int >
 
using existence_mask_element = uint32
 
using existence_mask_set = GenericVector< existence_mask >
 

Public Member Functions

 BitmapStructure (const BitmapStructure &)=default
 
 BitmapStructure (const char **bitmaps, int size, int n=1)
 
StructuringElementClone () const override
 
bool ElementExists (int i, int j, int k) const override
 
- Public Member Functions inherited from pcl::StructuringElement
 StructuringElement (const StructuringElement &x)
 
 StructuringElement (int size=3, int n=1)
 
virtual ~StructuringElement ()
 
void Initialize () const
 
virtual bool IsBox (int k) const
 
bool IsReflected () const
 
int NumberOfElements () const
 
int NumberOfWays () const
 
StructuringElementoperator= (const StructuringElement &x)
 
template<typename T >
void PeekElements (T *h1, int &nh1, const T *h, int k) const
 
void Reflect ()
 
int Size () const
 

Detailed Description

BitmapStructure allows you to build a structuring element using character strings to define the existence of structure elements. Each string defines a structure way, where 'x' characters correspond to existing structure elements. For example, the following array of static strings:

const char* B[] = { "--x--"
                    "-xxx-"
                    "xxxxx"
                    "-xxx-"
                    "--x--",
                    //
                    "-xxx-"
                    "xxxxx"
                    "xxxxx"
                    "xxxxx"
                    "-xxx-" };

would define a 5x5 structure with two ways. 'x' characters define existing elements; other character values ('-' in this case) are interpreted as nonexistent elements. The corresponding BitmapStructure object would be constructed as follows:

BitmapStructure S( B, 5, 2 );

This class is a convenient, straightforward approach to defining multi-way custom structuring elements that can be used directly with the MorphologicalTransformation class.

Definition at line 880 of file StructuringElement.h.

Member Typedef Documentation

◆ bitmap

Represents a structure bitmap. Each bitmap defines the existence matrix for a way of the structuring element.

Definition at line 888 of file StructuringElement.h.

◆ bitmap_set

Represents a set of bitmaps used to define the structure ways in a BitmapStructure object.

Definition at line 894 of file StructuringElement.h.

Constructor & Destructor Documentation

◆ BitmapStructure() [1/2]

pcl::BitmapStructure::BitmapStructure ( const char **  bitmaps,
int  size,
int  n = 1 
)
inline

Constructs a BitmapStructure object of the specified size and n number of ways.

Parameters
bitmapsAn array of null-terminated strings representing the set of ways in this structuring element. There must be n contiguous null-terminated strings of length size*size characters at the address specified by this argument. In these strings, 'x' characters correspond to existing structure elements; other character values will be interpreted as nonexistent structure elements.
sizeSize of this structure. Must be an odd integer >= 3.
nNumber of ways in this structure. Must be >= 1.

Definition at line 913 of file StructuringElement.h.

◆ BitmapStructure() [2/2]

pcl::BitmapStructure::BitmapStructure ( const BitmapStructure )
default

Copy constructor.

Member Function Documentation

◆ Clone()

StructuringElement* pcl::BitmapStructure::Clone ( ) const
inlineoverridevirtual

Returns a pointer to a dynamically allocated duplicate of this structuring element.

Implements pcl::StructuringElement.

Definition at line 929 of file StructuringElement.h.

◆ ElementExists()

bool pcl::BitmapStructure::ElementExists ( int  i,
int  j,
int  k 
) const
inlineoverridevirtual

Returns true iff a given element exists in this structure.

Parameters
icolumn position (X-coordinate) of the requested structure element. Must be 0 <= i < n, where n is the structure size.
jrow position (Y-coordinate) of the requested structure element. Must be 0 <= j < n, where n is the structure size.
kWay index. Must be 0 <= k < m, where m is the number of ways defined in this structure.

Reimplemented from pcl::StructuringElement.

Definition at line 936 of file StructuringElement.h.


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