|
TPCCLIB
|
Functions for processing mask images. More...
#include "libtpcimgp.h"Go to the source code of this file.
Functions | |
| long long | imgMaskCount (IMG *img) |
| int | imgMaskErode (IMG *img, IMG *se) |
| int | imgMaskDilate (IMG *img, IMG *se) |
| int | imgStructuringElement (IMG *img, const int structuring_element, int verbose) |
| void | imgMaskInvert (IMG *img) |
| int | imgMaskConjunction (IMG *mask1, IMG *mask2) |
| int | imgMaskRegionLabeling (IMG *mask1, IMG *mask2, int *n, int verbose) |
| int | imgMaskFloodFill (IMG *m, int sz, int sy, int sx, int label, long long *n, int verbose) |
| int | imgMaskCloak (IMG *img, int dim, float id) |
Functions for processing mask images.
Definition in file mask.c.
| int imgMaskCloak | ( | IMG * | img, |
| int | dim, | ||
| float | id ) |
Cloak mask.
| img | Pointer to 2D/3D mask image. |
| dim | Cloak the existing mask in xy (2) or xyz (3) dimensions. |
| id | Id number for the cloak mask. Should be different from existing IDs. |
Definition at line 429 of file mask.c.
Conjunction (AND, wedge) for two 3D mask images.
| mask1 | Pointer to IMG structure containing the first mask image; will be overwritten by the conjunction mask. |
| mask2 | Pointer to IMG structure containing the second mask image; not modified. |
| long long imgMaskCount | ( | IMG * | img | ) |
Count the nr of positive values inside 3D mask image.
| img | Pointer to mask IMG structure. |
Dilate the 3D mask image.
| img | Pointer to IMG structure containing the mask image. |
| se | Pointer to IMG structure containing the structuring element; all dimensions must be odd numbers. |
Definition at line 80 of file mask.c.
Erode the 3D mask image.
| img | Pointer to IMG structure containing the mask image. |
| se | Pointer to IMG structure containing the structuring element; all dimensions must be odd numbers. |
Definition at line 34 of file mask.c.
| int imgMaskFloodFill | ( | IMG * | m, |
| int | sz, | ||
| int | sy, | ||
| int | sx, | ||
| int | label, | ||
| long long * | n, | ||
| int | verbose ) |
Flood filling for the Region labelling.
Processes only the first frame, even if several do exist.
Based on Burger W and Burge MJ: Principles of Digital Image Processing - Core Algorithms, Springer, 2009, DOI 10.1007/978-1-84800-195-4.
| m | Pointer to IMG structure containing the mask image to be flood filled. Pixels with value 1 are flood filled with label, pixels with value <1 are considered as background, and pixels with values >1 are considered to belong to another already labelled region. |
| sz | Z coordinate of the starting point [0..dimz-1]. |
| sy | Y coordinate of the starting point [0..dimy-1]. |
| sx | X coordinate of the starting point [0..dimx-1]. |
| label | The label to be assigned to the region; at least 2. |
| n | The number of pixels that got labelled; enter NULL, if not needed. |
| verbose | Verbose level; if zero, then nothing is printed into stdout or stderr. |
Definition at line 352 of file mask.c.
Referenced by imgMaskRegionLabeling().
| void imgMaskInvert | ( | IMG * | img | ) |
Invert the 3D mask image, setting zeroes to ones, and non-zeroes to zeroes.
Processes only the first frame, even if several do exist.
| img | Pointer to mask IMG structure. |
Region labelling with flood filling.
Processes only the first frame, even if several do exist.
Based on Burger W and Burge MJ: Principles of Digital Image Processing - Core Algorithms, Springer, 2009, DOI 10.1007/978-1-84800-195-4.
| mask1 | Pointer to IMG structure containing the mask image to be region labelled; not modified. All pixels with value < 0.1 are considered to belong to background, others to foreground. |
| mask2 | Pointer to an empty but initiated IMG structure for the output, the region labelled mask image. |
| n | The number of regions that were found; enter NULL, if not needed. |
| verbose | Verbose level; if zero, then nothing is printed into stdout or stderr |
Definition at line 279 of file mask.c.
| int imgStructuringElement | ( | IMG * | img, |
| const int | structuring_element, | ||
| int | verbose ) |
Make 3D structuring element for eroding and dilation.
| img | Pointer to empty IMG struct for the element. |
| structuring_element | Structuring element:
|
| verbose | Verbose level; if zero, then only warnings are printed into stderr |
Definition at line 126 of file mask.c.