A standard neighborhood definition (center in light gray)
Redefined neighborhood definition for recursive raster scan
Redefined neighborhood definition for recursive anti_raster scan
6-connexity mesh emulation throw 8-connexity
//minimum over an extracted neighborhood of an image void flgr2d_get_nhb_minimum_fgUINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) { int i,k; int spp = extr->spp; dtype *presult = (dtype *) result->array; dtype *list_data_val; int *size = extr->size; dtype mini; for(k=0 ; k<spp ; k++) { // for each channel list_data_val = (dtype *) extr->list_data_val[k]; mini = list_data_val[0]; for(i=1 ; i<size[k] ; i++){ // for each neighbor, find minimum mini = mini < list_data_val[i] ? mini : list_data_val[i]; } flgr_set_array_##dtype(presult,k,mini); //store minimum in vector result } }
To define an erode function using the previous kernel operation:
void flgr2d_erode_fgUINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) { flgr2d_raster_slide_window_fgUINT8(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr_get_nhb_minimum_fgUINT8); }
FLGR_Ret flgr1d_anti_raster_slide_window | ( | FLGR_Data1D * | datdest, | |
FLGR_Data1D * | datsrc, | |||
FLGR_Data1D * | nhb, | |||
int | nhb_sym, | |||
FLGR_ComputeNhb1D | computeNhb | |||
) |
Slide a computation kernel on a FLGR_Data1D in a anti_raster scan way
datdest | : pointer to destination image | |
datsrc | : pointer to source image | |
nhb | : pointer to neighborhood definition or convolution kernel definition | |
nhb_sym | : flag to specify if the given Nhb must be symetrized (FLGR_NHB_SYM, FLGR_NHB_NO_SYM) | |
computeNhb | : Pointer to a function where neighborhood or convolution computation is made |
Definition at line 449 of file flgrCoreSlideWindow.c.
FLGR_Ret flgr1d_anti_raster_slide_window_unfolded | ( | FLGR_Data1D * | datdest, | |
FLGR_Data1D * | datsrc, | |||
FLGR_Data1D * | nhb, | |||
int | nhb_sym, | |||
FLGR_ComputeNhb1D | computeNhb | |||
) |
Slide a computation kernel on a FLGR_Data1D in a anti_raster scan way
datdest | : pointer to destination image | |
datsrc | : pointer to source image | |
nhb | : pointer to neighborhood definition or convolution kernel definition | |
nhb_sym | : flag to specify if the given Nhb must be symetrized (FLGR_NHB_SYM, FLGR_NHB_NO_SYM) | |
computeNhb | : Pointer to a function where neighborhood or convolution computation is made |
Definition at line 611 of file flgrCoreSlideWindow.c.
FLGR_Ret flgr1d_apply_anti_raster_scan_method | ( | FLGR_Data1D * | nhb | ) |
Apply a anti_raster scan method on a neighborhood definition. Some nhb values are unset to satisfy the anti_raster scan order
nhb | : a pointer to FLGR_Data1D |
Definition at line 1621 of file flgrCoreSlideWindow.c.
FLGR_Ret flgr1d_apply_raster_scan_method | ( | FLGR_Data1D * | nhb | ) |
Apply a raster scan method on a neighborhood definition. Some nhb values are unset to satisfy the raster scan order
nhb | : a pointer to FLGR_Data1D |
Definition at line 1556 of file flgrCoreSlideWindow.c.
FLGR_Ret flgr1d_raster_slide_structuring_function | ( | FLGR_Data1D * | datdest, | |
FLGR_Data1D * | datsrc, | |||
FLGR_Data1D * | semap, | |||
FLGR_Shape | shape, | |||
FLGR_ComputeNhb1D | computeNhb | |||
) |
Slide a resizable kernel on a FLGR_Data1D in a raster scan way
datdest | : pointer to destination image | |
datsrc | : pointer to source image | |
semap | : pointer to image containing each kernel topology information (fgINT32 type) | |
shape | : FLGR_DISC, FLGR_RECT, ... | |
computeNhb | : Pointer to a function where neighborhood or convolution computation is made |
Definition at line 1879 of file flgrCoreSlideWindow.c.
FLGR_Ret flgr1d_raster_slide_window | ( | FLGR_Data1D * | datdest, | |
FLGR_Data1D * | datsrc, | |||
FLGR_Data1D * | nhb, | |||
int | nhb_sym, | |||
FLGR_ComputeNhb1D | computeNhb | |||
) |
Slide a computation kernel on a FLGR_Data1D in a raster scan way
datdest | : pointer to destination image | |
datsrc | : pointer to source image | |
nhb | : pointer to neighborhood definition or convolution kernel definition | |
nhb_sym | : flag to specify if the given Nhb must be symetrized (FLGR_NHB_SYM, FLGR_NHB_NO_SYM) | |
computeNhb | : Pointer to a function where neighborhood or convolution computation is made |
Definition at line 365 of file flgrCoreSlideWindow.c.
FLGR_Ret flgr1d_raster_slide_window_unfolded | ( | FLGR_Data1D * | datdest, | |
FLGR_Data1D * | datsrc, | |||
FLGR_Data1D * | nhb, | |||
int | nhb_sym, | |||
FLGR_ComputeNhb1D | computeNhb | |||
) |
Slide a computation kernel on a FLGR_Data1D in a raster scan way
datdest | : pointer to destination image | |
datsrc | : pointer to source image | |
nhb | : pointer to neighborhood definition or convolution kernel definition | |
nhb_sym | : flag to specify if the given Nhb must be symetrized (FLGR_NHB_SYM, FLGR_NHB_NO_SYM) | |
computeNhb | : Pointer to a function where neighborhood or convolution computation is made |
Definition at line 527 of file flgrCoreSlideWindow.c.
FLGR_Ret flgr2d_anti_raster_slide_window | ( | FLGR_Data2D * | imgdest, | |
FLGR_Data2D * | imgsrc, | |||
FLGR_Data2D * | nhb, | |||
int | nhb_sym, | |||
FLGR_ComputeNhb2D | computeNhb | |||
) |
Slide a computation kernel on a FLGR_Data2D in a anti_raster scan way
imgdest | : pointer to destination image | |
imgsrc | : pointer to source image | |
nhb | : pointer to neighborhood definition or convolution kernel definition | |
nhb_sym | : flag to specify if the given Nhb must be symetrized (FLGR_NHB_SYM, FLGR_NHB_NO_SYM) | |
computeNhb | : Pointer to a function where neighborhood or convolution computation is made |
Definition at line 1162 of file flgrCoreSlideWindow.c.
FLGR_Ret flgr2d_anti_raster_slide_window_unfolded | ( | FLGR_Data2D * | imgdest, | |
FLGR_Data2D * | imgsrc, | |||
FLGR_Data2D * | nhb, | |||
int | nhb_sym, | |||
FLGR_ComputeNhb2D | computeNhb | |||
) |
Slide a computation kernel on a FLGR_Data2D in a anti_raster scan way
imgdest | : pointer to destination image | |
imgsrc | : pointer to source image | |
nhb | : pointer to neighborhood definition or convolution kernel definition | |
nhb_sym | : flag to specify if the given Nhb must be symetrized (FLGR_NHB_SYM, FLGR_NHB_NO_SYM) | |
computeNhb | : Pointer to a function where neighborhood or convolution computation is made |
Definition at line 1329 of file flgrCoreSlideWindow.c.
FLGR_Ret flgr2d_apply_anti_raster_scan_method | ( | FLGR_Data2D * | nhb | ) |
Apply a anti_raster scan method on a neighborhood definition. Some nhb values are unset to satisfy the anti_raster scan order
nhb | : a pointer to FLGR_Data2D |
Definition at line 1765 of file flgrCoreSlideWindow.c.
FLGR_Ret flgr2d_apply_raster_scan_method | ( | FLGR_Data2D * | nhb | ) |
Apply a raster scan method on a neighborhood definition. Some nhb values are unset to satisfy the raster scan order
nhb | : a pointer to FLGR_Data2D |
Definition at line 1695 of file flgrCoreSlideWindow.c.
FLGR_Ret flgr2d_raster_slide_structuring_function | ( | FLGR_Data2D * | datdest, | |
FLGR_Data2D * | datsrc, | |||
FLGR_Data2D * | semap, | |||
FLGR_Shape | shape, | |||
FLGR_ComputeNhb2D | computeNhb | |||
) |
Slide a resizable kernel on a FLGR_Data2D in a raster scan way
SE width for each pixel are stored in semap. semap could have one to three channel
*datdest | : image output | |
*datsrc | : image input | |
*semap | : maps of the neighborhood size evolution | |
shape | : shape | |
computeNhb | : Pointer to a function where neighborhood or convolution computation is done |
Definition at line 2054 of file flgrCoreSlideWindow.c.
FLGR_Ret flgr2d_raster_slide_window | ( | FLGR_Data2D * | imgdest, | |
FLGR_Data2D * | imgsrc, | |||
FLGR_Data2D * | nhb, | |||
int | nhb_sym, | |||
FLGR_ComputeNhb2D | computeNhb | |||
) |
Slide a computation kernel on a FLGR_Data2D in a raster scan way
imgdest | : pointer to destination image | |
imgsrc | : pointer to source image | |
nhb | : pointer to neighborhood definition or convolution kernel definition | |
nhb_sym | : flag to specify if the given Nhb must be symetrized (FLGR_NHB_SYM, FLGR_NHB_NO_SYM) | |
computeNhb | : Pointer to a function where neighborhood or convolution computation is made |
Definition at line 1078 of file flgrCoreSlideWindow.c.
FLGR_Ret flgr2d_raster_slide_window_unfolded | ( | FLGR_Data2D * | imgdest, | |
FLGR_Data2D * | imgsrc, | |||
FLGR_Data2D * | nhb, | |||
int | nhb_sym, | |||
FLGR_ComputeNhb2D | computeNhb | |||
) |
Slide a computation kernel on a FLGR_Data2D in a raster scan way
imgdest | : pointer to destination image | |
imgsrc | : pointer to source image | |
nhb | : pointer to neighborhood definition or convolution kernel definition | |
nhb_sym | : flag to specify if the given Nhb must be symetrized (FLGR_NHB_SYM, FLGR_NHB_NO_SYM) | |
computeNhb | : Pointer to a function where neighborhood or convolution computation is made |
Definition at line 1245 of file flgrCoreSlideWindow.c.