siox

siox

Synopsis

#define             SIOX_DEFAULT_SMOOTHNESS
#define             SIOX_DEFAULT_SENSITIVITY_L
#define             SIOX_DEFAULT_SENSITIVITY_A
#define             SIOX_DEFAULT_SENSITIVITY_B
#define             SIOX_DRB_ADD
#define             SIOX_DRB_SUBTRACT
                    SioxState;
void                (*SioxProgressFunc)                 (gpointer progress_data,
                                                         gdouble fraction);
SioxState *         siox_init                           (TileManager *pixels,
                                                         const guchar *colormap,
                                                         gint offset_x,
                                                         gint offset_y,
                                                         gint x,
                                                         gint y,
                                                         gint width,
                                                         gint height);
void                siox_foreground_extract             (SioxState *state,
                                                         SioxRefinementType refinement,
                                                         TileManager *mask,
                                                         gint x1,
                                                         gint y1,
                                                         gint x2,
                                                         gint y2,
                                                         gint smoothness,
                                                         const gdouble sensitivity[3],
                                                         gboolean multiblob,
                                                         SioxProgressFunc progress_callback,
                                                         gpointer progress_data);
void                siox_done                           (SioxState *state);
void                siox_drb                            (SioxState *state,
                                                         TileManager *mask,
                                                         gint x,
                                                         gint y,
                                                         gint brush_radius,
                                                         gint brush_mode,
                                                         gfloat threshold);

Description

Details

SIOX_DEFAULT_SMOOTHNESS

#define SIOX_DEFAULT_SMOOTHNESS     3


SIOX_DEFAULT_SENSITIVITY_L

#define SIOX_DEFAULT_SENSITIVITY_L  0.64


SIOX_DEFAULT_SENSITIVITY_A

#define SIOX_DEFAULT_SENSITIVITY_A  1.28


SIOX_DEFAULT_SENSITIVITY_B

#define SIOX_DEFAULT_SENSITIVITY_B  2.56


SIOX_DRB_ADD

#define SIOX_DRB_ADD                0


SIOX_DRB_SUBTRACT

#define SIOX_DRB_SUBTRACT           1


SioxState

typedef struct _SioxState SioxState;


SioxProgressFunc ()

void                (*SioxProgressFunc)                 (gpointer progress_data,
                                                         gdouble fraction);


siox_init ()

SioxState *         siox_init                           (TileManager *pixels,
                                                         const guchar *colormap,
                                                         gint offset_x,
                                                         gint offset_y,
                                                         gint x,
                                                         gint y,
                                                         gint width,
                                                         gint height);

Initializes the SIOX segmentator. Creates and returns a SioxState struct that has to be passed to all function calls of this module as it maintaines the state.

'* Returns: a new siox state structure.

pixels :

the tiles to extract the foreground from

colormap :

colormap in case pixels are indexed, NULL otherwise

offset_x :

horizontal offset of pixels with respect to the mask

offset_y :

vertical offset of pixels with respect to the mask

x :

horizontal offset into the mask

y :

vertical offset into the mask

width :

width of working area on mask

height :

height of working area on mask

siox_foreground_extract ()

void                siox_foreground_extract             (SioxState *state,
                                                         SioxRefinementType refinement,
                                                         TileManager *mask,
                                                         gint x1,
                                                         gint y1,
                                                         gint x2,
                                                         gint y2,
                                                         gint smoothness,
                                                         const gdouble sensitivity[3],
                                                         gboolean multiblob,
                                                         SioxProgressFunc progress_callback,
                                                         gpointer progress_data);

Writes the resulting segmentation into mask. The region of interest as specified using x1, y1, x2 and y2 defines the bounding box of the background and undecided areas. No changes to the mask are done outside this rectangle.

state :

current state struct as constructed by siox_init

refinement :

SioxRefinementType

mask :

a mask indicating sure foreground (255), sure background (0) and undecided regions ([1..254]).

x1 :

region of interest

y1 :

region of interest

x2 :

region of interest

y2 :

region of interest

smoothness :

boundary smoothness (a good value is 3)

sensitivity :

a double array with three entries specifing the accuracy, a good value is: { 0.64, 1.28, 2.56 }

multiblob :

allow multiple blobs (true) or only one (false)

progress_callback :

a progress callback

progress_data :

data passed to progress_callback

siox_done ()

void                siox_done                           (SioxState *state);

Frees the memory assciated with the state.

state :

The state of this tool.

siox_drb ()

void                siox_drb                            (SioxState *state,
                                                         TileManager *mask,
                                                         gint x,
                                                         gint y,
                                                         gint brush_radius,
                                                         gint brush_mode,
                                                         gfloat threshold);

drb - detail refinement brush, a brush mask for subpixel classification.

FIXME: Now it is assumed that the brush is a square. Should be able to be whatever GIMP offers. TODO: This is still an experimental method. There are more tests needed to evaluate performance of this!

state :

current state struct as constructed by siox_init

brush_radius :

the radius of the brush

brush_mode :

at this time either SIOX_DRB_ADD or SIOX_DRB_SUBTRACT

threshold :

a threshold to be defined by the user. Range for SIOX_DRB_ADD: ]0..1] default: 1.0, range for for SIOX_DRB_SUBTRACT: [0..1[, default: 0.0