Direct Graphical Models  v.1.7.0
DirectGraphicalModels::fex Namespace Reference

Namespaces

 global
 Global-features extraction.
 

Classes

class  CCommonFeatureExtractor
 Common class, which unites feature extraction algorithms. More...
 
class  CCoordinate
 Coordinate feature extraction class. More...
 
class  CDistance
 Distance feature extraction class. More...
 
class  CGlobalFeatureExtractor
 Interface class for global feature extraction algorithms. More...
 
class  CGradient
 Gradient feature extraction class. More...
 
class  CHOG
 HOG (histogram of oriented gradients) feature extraction class. More...
 
class  CHSV
 Hue, Saturation and Value feature extraction class. More...
 
class  CIntensity
 Intensity feature extraction class. More...
 
class  CNDVI
 NDVI (normalized difference vegetation index) feature extraction class. More...
 
class  CScale
 Scale feature extraction class. More...
 
class  CSIFT
 SIFT (scale-invariant feature transform) feature extraction class. More...
 
class  CSparseCoding
 Sparse Coding feature extraction class. More...
 
class  CSparseDictionary
 Sparse Dictionary Learning class. More...
 
class  CVariance
 Variance feature extraction class. More...
 
class  IFeatureExtractor
 Interface class for feature extraction algorithms. More...
 
class  ILocalFeatureExtractor
 Interface class for local feature extraction algorithms. More...
 
struct  SqNeighbourhood
 Square neighborhood structure. More...
 

Typedefs

typedef struct DirectGraphicalModels::fex::SqNeighbourhood SqNeighbourhood
 Square neighborhood structure. More...
 

Enumerations

enum  ChannelsRGB { CH_BLUE, CH_GREEN, CH_RED }
 Channels in the BGR color space. More...
 
enum  ChannelsHSV { CH_HUE, CH_SATURATION, CH_VALUE }
 Channels in the HSV color space. More...
 
enum  coordinateType { COORDINATE_ORDINATE, COORDINATE_ABSCISS, COORDINATE_RADIUS }
 Types of the coordinate feature. More...
 
enum  BasePointLocation {
  BP_CENTER, BP_LEFT, BP_RIGHT, BP_TOP,
  BP_BOTTOM
}
 Some special cases of the base point location inside the neighborhood. More...
 

Functions

template<typename T >
linear_mapper (float val, float min, float max)
 Linear 1D mapping. More...
 
template<typename T >
two_linear_mapper (float val, float min, float max, float mid, T midPoint)
 Two-linear 1D mapping. More...
 
SqNeighbourhood sqNeighbourhood (int leftGap, int rightGap, int upperGap, int lowerGap)
 Initializes the square neighborhood structure. More...
 
SqNeighbourhood sqNeighbourhoodAll (int R)
 Initializes the square neighborhood structure with all the same values (base point in the center) More...
 
SqNeighbourhood sqNeighbourhood (int R, BasePointLocation location=BP_CENTER)
 Initializes the square neighborhood structure with a pre-define shape. More...
 

Variables

const float SC_LRATE_W = 5e-2f
 Learning rate (speed) for weights \(W\). More...
 
const float SC_LRATE_D = 1e-2f
 Learning rate (speed) for dictionary \(D\). More...
 
const float SC_LAMBDA = 5e-5f
 \(\lambda\): L1-regularisation parameter (on features) More...
 
const float SC_EPSILON = 1e-5f
 \(\epsilon\): L1-regularisation epsilon \( \left\|x\right\|_1 \approx \sqrt{x^2 + \epsilon} \) More...
 
const float SC_GAMMA = 1e-2f
 \(\gamma\): L2-regularisation parameter (on dictionary words) More...
 

Typedef Documentation

◆ SqNeighbourhood

Square neighborhood structure.

This structure defines rectangular neighborhood around its base point. The size of the neighborhoood is given via four gap values: \((leftGap+rightGap+1)\times(upperGap+lowerGap+1)\), and its shape is defines as depicted at Figure 1.

This definition of a neighbourhood extends the classical one, where the neighborhood is represented as a square with the base point in the center.

square_neighborhood.gif
Fig. 1

Enumeration Type Documentation

◆ BasePointLocation

Some special cases of the base point location inside the neighborhood.

Enumerator
BP_CENTER 

The base point is located in the neighborhood's center.

BP_LEFT 

The base point is located at the neighborhood's left boundry.

BP_RIGHT 

The base point is located in the neighborhood's right boundry.

BP_TOP 

The base point is located in the neighborhood's upper boundry.

BP_BOTTOM 

The base point is located in the neighborhood's lower boundry.

Definition at line 26 of file SquareNeighborhood.h.

◆ ChannelsHSV

Channels in the HSV color space.

Enumerator
CH_HUE 

Hue channel.

CH_SATURATION 

Saturation channel.

CH_VALUE 

Value channel.

Definition at line 30 of file CommonFeatureExtractor.h.

◆ ChannelsRGB

Channels in the BGR color space.

Enumerator
CH_BLUE 

Blue channel.

CH_GREEN 

Green channel.

CH_RED 

Red channel.

Definition at line 23 of file CommonFeatureExtractor.h.

◆ coordinateType

Types of the coordinate feature.

Enumerator
COORDINATE_ORDINATE 

Coordinate feature depend on the pixel's ordinate (y-coordinate).

COORDINATE_ABSCISS 

Coordinate feature depend on the pixel's absciss (x-coordinate).

COORDINATE_RADIUS 

Coordinate feature depend on the pixel's distance to the image center.

Definition at line 12 of file Coordinate.h.

Function Documentation

◆ linear_mapper()

template<typename T >
T DirectGraphicalModels::fex::linear_mapper ( float  val,
float  min,
float  max 
)
inline

Linear 1D mapping.

This function perform linear mapping of the value val from one interval to another: \(val\in[min; max]\rightarrow res\in[T.min; T.max]\), such that:

\begin{eqnarray*} min&\rightarrow&T.min \\ max&\rightarrow&T.max \end{eqnarray*}

Template Parameters
TThe type of the resulting value. Usually byte or word. It also defines the resulting interval, e.g for byte it is [0; 255] and for word it is [0; 65535].
Parameters
valThe value to map.
minThe lower boundary of the val.
maxThe higher bounday of the val.
Returns
The mapped value res.

Definition at line 22 of file LinearMapper.h.

◆ sqNeighbourhood() [1/2]

SqNeighbourhood DirectGraphicalModels::fex::sqNeighbourhood ( int  leftGap,
int  rightGap,
int  upperGap,
int  lowerGap 
)
inline

Initializes the square neighborhood structure.

Parameters
leftGapDistance from the base point to the neighborhood's left boundary.
rightGapDistance from the base point to the neighborhood's right boundary.
upperGapDistance from the base point to the neighborhood's upper boundary.
lowerGapDistance from the base point to the neighborhood's lower boundary.
Returns
Initialized square neighborhood of the size: \((leftGap+rightGap+1)\times(upperGap+lowerGap+1)\) (Ref. SqNeighbourhood).

Definition at line 42 of file SquareNeighborhood.h.

Here is the caller graph for this function:

◆ sqNeighbourhood() [2/2]

SqNeighbourhood DirectGraphicalModels::fex::sqNeighbourhood ( int  R,
BasePointLocation  location = BP_CENTER 
)
inline

Initializes the square neighborhood structure with a pre-define shape.

Parameters
RDistance from the base point to the neighborhood's boundaries
locationFlag describing the location of the base point (Ref. BasePointLocation and Figure 2)
base_point_location.gif
Fig. 2
Returns
Initialized square neighborhood of the size \((2R + 1)\times(2R + 1)\) (Ref. SqNeighbourhood)

Definition at line 64 of file SquareNeighborhood.h.

Here is the call graph for this function:

◆ sqNeighbourhoodAll()

SqNeighbourhood DirectGraphicalModels::fex::sqNeighbourhoodAll ( int  R)
inline

Initializes the square neighborhood structure with all the same values (base point in the center)

Parameters
RDistance from the base point to the neighborhood's boundaries (radius)
Returns
Initialized square neighborhood of the size \((2R + 1)\times(2R + 1)\) (Ref. SqNeighbourhood)

Definition at line 56 of file SquareNeighborhood.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ two_linear_mapper()

template<typename T >
T DirectGraphicalModels::fex::two_linear_mapper ( float  val,
float  min,
float  max,
float  mid,
midPoint 
)
inline

Two-linear 1D mapping.

This function perform linear mapping of the value val from one interval to another: \(val\in[min; max]\rightarrow res\in[T.min; T.max]\), such that:

\begin{eqnarray*} min&\rightarrow&T.min \\ mid&\rightarrow&midPoint \\ max&\rightarrow&T.max \end{eqnarray*}

For more detail please refer to the Figure 1.

two_linear_mapping.gif
Fig. 1
Parameters
valThe value to map.
minThe lower boundary of the val.
maxThe higher bounday of the val.
midThe x-coordinate of the intersection point, \(mid\in(min; max)\) (Ref. Figure 1).
midPointThe y-coordinate of the intersection point, \(midPoint\in[T.min; T.max]\) (Ref. Figure 1).
Returns
The mapped value res.

Definition at line 47 of file LinearMapper.h.

Variable Documentation

◆ SC_EPSILON

const float DirectGraphicalModels::fex::SC_EPSILON = 1e-5f

\(\epsilon\): L1-regularisation epsilon \( \left\|x\right\|_1 \approx \sqrt{x^2 + \epsilon} \)

Definition at line 13 of file SparseDictionary.h.

◆ SC_GAMMA

const float DirectGraphicalModels::fex::SC_GAMMA = 1e-2f

\(\gamma\): L2-regularisation parameter (on dictionary words)

Definition at line 14 of file SparseDictionary.h.

◆ SC_LAMBDA

const float DirectGraphicalModels::fex::SC_LAMBDA = 5e-5f

\(\lambda\): L1-regularisation parameter (on features)

Definition at line 12 of file SparseDictionary.h.

◆ SC_LRATE_D

const float DirectGraphicalModels::fex::SC_LRATE_D = 1e-2f

Learning rate (speed) for dictionary \(D\).

Definition at line 10 of file SparseDictionary.h.

◆ SC_LRATE_W

const float DirectGraphicalModels::fex::SC_LRATE_W = 5e-2f

Learning rate (speed) for weights \(W\).

Definition at line 9 of file SparseDictionary.h.