MagickCore  6.7.5
segment.c File Reference
Include dependency graph for segment.c:

Go to the source code of this file.

Data Structures

struct  _ExtentPacket
struct  _Cluster
struct  _IntervalTree
struct  _ZeroCrossing

Defines

#define MaxDimension   3
#define DeltaTau   0.5f
#define WeightingExponent   2.5
#define SegmentPower(ratio)   pow(ratio,(double) (1.0/(weighting_exponent-1.0)));
#define Tau   5.2f
#define SegmentImageTag   "Segment/Image"

Typedefs

typedef struct _ExtentPacket ExtentPacket
typedef struct _Cluster Cluster
typedef struct _IntervalTree IntervalTree
typedef struct _ZeroCrossing ZeroCrossing

Functions

static MagickRealType OptimalTau (const ssize_t *, const double, const double, const double, const double, short *)
static ssize_t DefineRegion (const short *, ExtentPacket *)
static void InitializeHistogram (const Image *, ssize_t **, ExceptionInfo *)
static void ScaleSpace (const ssize_t *, const MagickRealType, MagickRealType *)
static void ZeroCrossHistogram (MagickRealType *, const MagickRealType, short *)
static MagickBooleanType Classify (Image *image, short **extrema, const MagickRealType cluster_threshold, const MagickRealType weighting_exponent, const MagickBooleanType verbose, ExceptionInfo *exception)
static ssize_t MagickAbsoluteValue (const ssize_t x)
static ssize_t MagickMax (const ssize_t x, const ssize_t y)
static ssize_t MagickMin (const ssize_t x, const ssize_t y)
static void ConsolidateCrossings (ZeroCrossing *zero_crossing, const size_t number_crossings)
static void DerivativeHistogram (const MagickRealType *histogram, MagickRealType *derivative)
MagickExport MagickBooleanType GetImageDynamicThreshold (const Image *image, const double cluster_threshold, const double smooth_threshold, PixelInfo *pixel, ExceptionInfo *exception)
static void InitializeList (IntervalTree **list, ssize_t *number_nodes, IntervalTree *node)
static void MeanStability (IntervalTree *node)
static void Stability (IntervalTree *node)
static IntervalTreeInitializeIntervalTree (const ZeroCrossing *zero_crossing, const size_t number_crossings)
static void ActiveNodes (IntervalTree **list, ssize_t *number_nodes, IntervalTree *node)
static void FreeNodes (IntervalTree *node)
MagickExport MagickBooleanType SegmentImage (Image *image, const ColorspaceType colorspace, const MagickBooleanType verbose, const double cluster_threshold, const double smooth_threshold, ExceptionInfo *exception)

Variables

static const int Blue = 2
static const int Green = 1
static const int Red = 0
static const int SafeMargin = 3
static const int TreeLength = 600

Define Documentation

#define DeltaTau   0.5f

Definition at line 109 of file segment.c.

Referenced by GetImageDynamicThreshold(), and SegmentImage().

#define MaxDimension   3

Definition at line 108 of file segment.c.

Referenced by Classify(), GetImageDynamicThreshold(), and SegmentImage().

#define SegmentImageTag   "Segment/Image"
#define SegmentPower (   ratio)    pow(ratio,(double) (1.0/(weighting_exponent-1.0)));

Definition at line 115 of file segment.c.

Referenced by Classify().

#define Tau   5.2f

Definition at line 117 of file segment.c.

Referenced by GetImageDynamicThreshold(), and SegmentImage().

#define WeightingExponent   2.5

Definition at line 114 of file segment.c.

Referenced by SegmentImage().


Typedef Documentation

typedef struct _Cluster Cluster
typedef struct _ExtentPacket ExtentPacket
typedef struct _IntervalTree IntervalTree
typedef struct _ZeroCrossing ZeroCrossing

Function Documentation

static void ActiveNodes ( IntervalTree **  list,
ssize_t *  number_nodes,
IntervalTree node 
) [static]
static void ConsolidateCrossings ( ZeroCrossing zero_crossing,
const size_t  number_crossings 
) [static]

Definition at line 717 of file segment.c.

References MagickMax(), MagickMin(), and _ZeroCrossing::crossings.

Referenced by OptimalTau().

static ssize_t DefineRegion ( const short *  extrema,
ExtentPacket extents 
) [static]
static void DerivativeHistogram ( const MagickRealType histogram,
MagickRealType derivative 
) [static]

Definition at line 890 of file segment.c.

Referenced by OptimalTau().

static void FreeNodes ( IntervalTree node) [static]

Definition at line 1496 of file segment.c.

References _IntervalTree::sibling, _IntervalTree::child, and RelinquishMagickMemory().

Referenced by OptimalTau().

static void InitializeHistogram ( const Image image,
ssize_t **  histogram,
ExceptionInfo exception 
) [static]
static IntervalTree* InitializeIntervalTree ( const ZeroCrossing zero_crossing,
const size_t  number_crossings 
) [static]
static void InitializeList ( IntervalTree **  list,
ssize_t *  number_nodes,
IntervalTree node 
) [static]

Definition at line 1301 of file segment.c.

References _IntervalTree::child, and _IntervalTree::sibling.

Referenced by InitializeIntervalTree().

static ssize_t MagickAbsoluteValue ( const ssize_t  x) [inline, static]

Definition at line 696 of file segment.c.

Referenced by ScaleSpace().

static ssize_t MagickMax ( const ssize_t  x,
const ssize_t  y 
) [inline, static]

Definition at line 703 of file segment.c.

Referenced by ConsolidateCrossings().

static ssize_t MagickMin ( const ssize_t  x,
const ssize_t  y 
) [inline, static]

Definition at line 710 of file segment.c.

Referenced by ConsolidateCrossings().

static void MeanStability ( IntervalTree node) [static]
static void ScaleSpace ( const ssize_t *  histogram,
const MagickRealType  tau,
MagickRealType scale_histogram 
)
static void Stability ( IntervalTree node) [static]
static void ZeroCrossHistogram ( MagickRealType second_derivative,
const MagickRealType  smooth_threshold,
short *  crossings 
)

Definition at line 1891 of file segment.c.

Referenced by OptimalTau().


Variable Documentation

const int Blue = 2 [static]

Definition at line 180 of file segment.c.

Referenced by Classify(), GetImageDynamicThreshold(), InitializeHistogram(), and SegmentImage().

const int Green = 1

Definition at line 181 of file segment.c.

Referenced by Classify(), GetImageDynamicThreshold(), InitializeHistogram(), and SegmentImage().

const int Red = 0

Definition at line 182 of file segment.c.

Referenced by Classify(), GetImageDynamicThreshold(), InitializeHistogram(), and SegmentImage().

const int SafeMargin = 3

Definition at line 183 of file segment.c.

Referenced by Classify(), and GetImageDynamicThreshold().

const int TreeLength = 600

Definition at line 184 of file segment.c.

Referenced by InitializeIntervalTree(), and OptimalTau().