PCL
|
A structuring element where static strings are used to define custom existence matrices. More...
#include <StructuringElement.h>
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) | |
StructuringElement * | Clone () 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 |
StructuringElement & | operator= (const StructuringElement &x) |
template<typename T > | |
void | PeekElements (T *h1, int &nh1, const T *h, int k) const |
void | Reflect () |
int | Size () const |
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.
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.
Represents a set of bitmaps used to define the structure ways in a BitmapStructure object.
Definition at line 894 of file StructuringElement.h.
|
inline |
Constructs a BitmapStructure object of the specified size and n number of ways.
bitmaps | An 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. |
size | Size of this structure. Must be an odd integer >= 3. |
n | Number of ways in this structure. Must be >= 1. |
Definition at line 913 of file StructuringElement.h.
|
default |
Copy constructor.
|
inlineoverridevirtual |
Returns a pointer to a dynamically allocated duplicate of this structuring element.
Implements pcl::StructuringElement.
Definition at line 929 of file StructuringElement.h.
|
inlineoverridevirtual |
Returns true iff a given element exists in this structure.
i | column position (X-coordinate) of the requested structure element. Must be 0 <= i < n, where n is the structure size. |
j | row position (Y-coordinate) of the requested structure element. Must be 0 <= j < n, where n is the structure size. |
k | Way 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.