| Bsoft 1.9 Bernard's software package

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Functions | Variables
img_graphseg.cpp File Reference

Segment images into density regions using a nondirected graph. More...

`#include "Bimage.h"`
`#include "img_graphseg.h"`
`#include "utilities.h"`

Go to the source code of this file.

## Functions
int | QsortSmallToLargeEdge (const void *x, const void *y)
size_t | region_find (Region *region, size_t i)
int | region_join (Region *region, size_t i, size_t j)
Region * | img_region_setup (Bimage *p, Bimage *pmask)
Edge * | img_edge_setup (Bimage *p, Bimage *pmask, int connect_type, size_t &me, size_t &ne)
size_t | region_merging (Region *region, Edge *edge, size_t nrc, size_t ne, float threshold)
size_t | statistical_region_merging (Region *region, Edge *edge, size_t nr, size_t ne, double fac)
size_t | region_merge_small (Region *region, Edge *edge, size_t nrc, size_t ne, int min_size)
size_t | img_graph_segment (int type, Bimage *p, Bimage *pmask, int connect_type, double complexity, int min_size)
| Graph-based segmentation of an image. More...

## Variables
int | verbose

## Detailed Description

Segment images into density regions using a nondirected graph.

Author
  Bernard Heymann

Date
  Created: 20110318
  Modified: 20110810

Definition in file img_graphseg.cpp.

## Function Documentation

Edge* img_edge_setup | ( | Bimage * | p,
|  | Bimage * | pmask,
|  | int | connect_type,
|  | size_t & | me,
|  | size_t & | ne
| ) |  |

Definition at line 78 of file img_graphseg.cpp.

size_t img_graph_segment | ( | int | type,
|  | Bimage * | p,
|  | Bimage * | pmask,
|  | int | connect_type,
|  | double | complexity,
|  | int | min_size
| ) |  |

Graph-based segmentation of an image.

Parameters

  type | segmentation type: 1=threshold, 2=statistical region merging.
  *p | image.
  *pmask | mask to limit areas for segmentation.
  connect_type | connection type: 0=direct neighbors, 1=all neighbors.
  complexity | a value determining the number of segments.
  min_size | minimum segment size.

Returns
  size_t number of segments.

      An array of edges between neighboring voxels is set up and sorted in
      non-decreasing order. The voxels are then aggregated into regions based
      on two selectable criteria:
      simple      edge difference with adjustable threshold.
      srm         statistical region merging.
      Regions below a given cutoff size are merged.
      Only the first sub-image is segmented.

      IEEE Trans. Pattern Anal. Mach. Intell. 26(11): 1452-1458 (2004)

  Reference: R. Nock, F. Nielsen: Statistical Region Merging.

Definition at line 233 of file img_graphseg.cpp.

Region* img_region_setup | ( | Bimage * | p,
|  | Bimage * | pmask
| ) |  |

Definition at line 56 of file img_graphseg.cpp.

int QsortSmallToLargeEdge | ( | const void * | x,
|  | const void * | y
| ) |  |

Definition at line 16 of file img_graphseg.cpp.

size_t region_find | ( | Region * | region,
|  | size_t | i
| ) |  |

Definition at line 24 of file img_graphseg.cpp.

int region_join | ( | Region * | region,
|  | size_t | i,
|  | size_t | j
| ) |  |

Definition at line 32 of file img_graphseg.cpp.

size_t region_merge_small | ( | Region * | region,
|  | Edge * | edge,
|  | size_t | nrc,
|  | size_t | ne,
|  | int | min_size
| ) |  |

Definition at line 191 of file img_graphseg.cpp.

size_t region_merging | ( | Region * | region,
|  | Edge * | edge,
|  | size_t | nrc,
|  | size_t | ne,
|  | float | threshold
| ) |  |

Definition at line 141 of file img_graphseg.cpp.

size_t statistical_region_merging | ( | Region * | region,
|  | Edge * | edge,
|  | size_t | nr,
|  | size_t | ne,
|  | double | fac
| ) |  |

Definition at line 164 of file img_graphseg.cpp.

## Variable Documentation

int verbose