Fulguro Logo Support This Project

Sliding Window
[Core]


Detailed Description

Main functions to slide every kernel and every computation over FLGR_Data2D.
If source and destination are the same, "raster" ("anti_raster") functions will modify Neighborhood definition to comply with a recursive raster (resp. anti_raster) scan way.

nhb_8c.png

A standard neighborhood definition (center in light gray)


nhb_8c_raster.png

Redefined neighborhood definition for recursive raster scan


nhb_8c_antiraster.png

Redefined neighborhood definition for recursive anti_raster scan


Neighborhoods definitions and Images are created in the same way. For Mathematical Morphology, values inside a neighborhood represent which neighbors are taken into account. For Linear processing, values represent coefficient filter ...
The 6-connexity is emulated by processing odd and even rows with differents 8-connexity neighborhoods definitions. A specific function called "flgr2d_fill_nhb_even_rows" allows to fill even neighborhood from an odd one.

mesh_6_8.png

6-connexity mesh emulation throw 8-connexity


Note that a neighborhood must be represented by the user in the even way (in blue in the previous figure)


A C function to define computation over an extracted neighborhood could be define as follow :

 //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);
 }


Functions

FLGR_Ret flgr1d_anti_raster_slide_window (FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym, FLGR_ComputeNhb1D computeNhb)
FLGR_Ret flgr1d_anti_raster_slide_window_unfolded (FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym, FLGR_ComputeNhb1D computeNhb)
FLGR_Ret flgr1d_apply_anti_raster_scan_method (FLGR_Data1D *nhb)
FLGR_Ret flgr1d_apply_raster_scan_method (FLGR_Data1D *nhb)
FLGR_Ret flgr1d_raster_slide_structuring_function (FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *semap, FLGR_Shape shape, FLGR_ComputeNhb1D computeNhb)
FLGR_Ret flgr1d_raster_slide_window (FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym, FLGR_ComputeNhb1D computeNhb)
FLGR_Ret flgr1d_raster_slide_window_unfolded (FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym, FLGR_ComputeNhb1D computeNhb)
FLGR_Ret flgr2d_anti_raster_slide_window (FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym, FLGR_ComputeNhb2D computeNhb)
FLGR_Ret flgr2d_anti_raster_slide_window_unfolded (FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym, FLGR_ComputeNhb2D computeNhb)
FLGR_Ret flgr2d_apply_anti_raster_scan_method (FLGR_Data2D *nhb)
FLGR_Ret flgr2d_apply_raster_scan_method (FLGR_Data2D *nhb)
FLGR_Ret flgr2d_raster_slide_structuring_function (FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *semap, FLGR_Shape shape, FLGR_ComputeNhb2D computeNhb)
FLGR_Ret flgr2d_raster_slide_window (FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym, FLGR_ComputeNhb2D computeNhb)
FLGR_Ret flgr2d_raster_slide_window_unfolded (FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym, FLGR_ComputeNhb2D computeNhb)


Function Documentation

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

Parameters:
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
Returns:
nothing

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

Parameters:
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
Returns:
nothing

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

Parameters:
nhb : a pointer to FLGR_Data1D
Returns:
FLGR_RET_OK, ...

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

Parameters:
nhb : a pointer to FLGR_Data1D
Returns:
FLGR_RET_OK, ...

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

Parameters:
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
Returns:
nothing

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

Parameters:
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
Returns:
nothing

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

Parameters:
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
Returns:
nothing

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

Parameters:
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
Returns:
nothing

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

Parameters:
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
Returns:
nothing

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

Parameters:
nhb : a pointer to FLGR_Data2D
Returns:
FLGR_RET_OK, ...

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

Parameters:
nhb : a pointer to FLGR_Data2D
Returns:
FLGR_RET_OK, ...

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

  • If semap->spp==1 then
    • Channel 1 indicates the width of the square around the shape

  • If semap->spp==2 then
    • Channel 1 indicates the width of the rectangle around the shape
    • Channel 2 indicates the height of the rectangle around the shape

  • If semap->spp==3 then
    • Channel 1 indicates the width of the rectangle around the shape
    • Channel 2 indicates the height of the rectangle around the shape
    • Channel 3 indicates the rotation angle of the shape [-180,180] degrees

Parameters:
*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
Returns:
FLGR_RET_OK, ...

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

Parameters:
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
Returns:
nothing
Examples:
example6.c.

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

Parameters:
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
Returns:
nothing

Definition at line 1245 of file flgrCoreSlideWindow.c.


SourceForge.net Logo
Generated on Tue Nov 11 19:17:28 2008 for Fulguro by doxygen 1.5.6