Direct Graphical Models  v.1.7.0
DirectGraphicalModels::fex::CGlobalFeatureExtractor Class Reference

Interface class for global feature extraction algorithms. More...

#include <GlobalFeatureExtractor.h>

Inheritance diagram for DirectGraphicalModels::fex::CGlobalFeatureExtractor:
Collaboration diagram for DirectGraphicalModels::fex::CGlobalFeatureExtractor:

Public Member Functions

 CGlobalFeatureExtractor (const Mat &img)
 Constructor. More...
 
virtual ~CGlobalFeatureExtractor (void)
 
size_t getNumLines (int threshold1=100, int threshold2=50) const
 Returns the number of staight lines in the image. More...
 
size_t getNumCircles (int threshold1=100, int threshold2=30) const
 Returns the number of circles in the source image. More...
 
float getOpacity (void) const
 Returns the weighted-mean transparancy of the source image. More...
 
float getVariance (void)
 Retunrs the variance of the source image. More...
 
int getArea (void)
 Returns the number of non-zero pixels in the source image. More...
 
int getPerimeter (void)
 Returns the perimeter of an object in the source image. More...
 
float getCompactness (void)
 Returns the compactness of the object in the source image. More...
 
- Public Member Functions inherited from DirectGraphicalModels::fex::IFeatureExtractor
 IFeatureExtractor (const Mat &img)
 Constructor. More...
 
virtual ~IFeatureExtractor (void)
 

Additional Inherited Members

- Protected Attributes inherited from DirectGraphicalModels::fex::IFeatureExtractor
const Mat m_img
 Container for the image, from which the features are to be extracted. More...
 

Detailed Description

Interface class for global feature extraction algorithms.

The derived algorithms are supposed to extract one feature per image

Author
Sergey G. Kosov, serge.nosp@m.y.ko.nosp@m.sov@p.nosp@m.roje.nosp@m.ct-10.nosp@m..de

Definition at line 17 of file GlobalFeatureExtractor.h.

Constructor & Destructor Documentation

◆ CGlobalFeatureExtractor()

DirectGraphicalModels::fex::CGlobalFeatureExtractor::CGlobalFeatureExtractor ( const Mat &  img)
inline

Constructor.

Parameters
imgInput image.

Definition at line 24 of file GlobalFeatureExtractor.h.

◆ ~CGlobalFeatureExtractor()

virtual DirectGraphicalModels::fex::CGlobalFeatureExtractor::~CGlobalFeatureExtractor ( void  )
inlinevirtual

Definition at line 25 of file GlobalFeatureExtractor.h.

Member Function Documentation

◆ getArea()

int DirectGraphicalModels::fex::CGlobalFeatureExtractor::getArea ( void  )
inline

Returns the number of non-zero pixels in the source image.

Returns
The number of non-zero pixels in the source image.

Definition at line 58 of file GlobalFeatureExtractor.h.

Here is the call graph for this function:

◆ getCompactness()

float DirectGraphicalModels::fex::CGlobalFeatureExtractor::getCompactness ( void  )
inline

Returns the compactness of the object in the source image.

The compactness is calculates as follows: \(\frac{P^2}{4\Pi S}\), where P and S are perimeter and area of the object, respectively.

Returns
The compactness of the object in the source image.

Definition at line 70 of file GlobalFeatureExtractor.h.

Here is the call graph for this function:

◆ getNumCircles()

size_t DirectGraphicalModels::fex::CGlobalFeatureExtractor::getNumCircles ( int  threshold1 = 100,
int  threshold2 = 30 
) const
inline

Returns the number of circles in the source image.

Parameters
threshold1The higher threshold of the two, passed to the Canny edge detector (the lower one is twice smaller).
threshold2The accumulator threshold for the circle centers at the detection stage. The smaller it is, the more false circles may be detected.
Returns
The number of circles in the source image

Definition at line 40 of file GlobalFeatureExtractor.h.

Here is the call graph for this function:

◆ getNumLines()

size_t DirectGraphicalModels::fex::CGlobalFeatureExtractor::getNumLines ( int  threshold1 = 100,
int  threshold2 = 50 
) const
inline

Returns the number of staight lines in the image.

Parameters
threshold1The higher threshold of the two, passed to the Canny edge detector(the lower one is twice smaller).
threshold2The accumulator threshold parameter.Only those lines are detected that get enough votes(> threshold2).
Returns
The number of staight lines in the source image

Definition at line 33 of file GlobalFeatureExtractor.h.

Here is the call graph for this function:

◆ getOpacity()

float DirectGraphicalModels::fex::CGlobalFeatureExtractor::getOpacity ( void  ) const
inline

Returns the weighted-mean transparancy of the source image.

The weighted-mean transparancy is evaluated as follows:

\[ \frac{1}{width \times hight} \sum^{width}_{x = 1}\sum^{height}_{y = 1} (1 - d_{x,y}) \cdot (img_{x,y} - \mu), \]

where \(d_{x,y}\) is the normalized distance between a position \((x,y)\) and the image center.

Returns
The weighted-mean transparancy of the source image.

Definition at line 48 of file GlobalFeatureExtractor.h.

Here is the call graph for this function:

◆ getPerimeter()

int DirectGraphicalModels::fex::CGlobalFeatureExtractor::getPerimeter ( void  )
inline

Returns the perimeter of an object in the source image.

This function retunrs the number of edge pixels, assuming a pixel to belong to an edge if any of its neighboring pixels have different value.

Returns
The number of edge pixels in the source image.

Definition at line 64 of file GlobalFeatureExtractor.h.

Here is the call graph for this function:

◆ getVariance()

float DirectGraphicalModels::fex::CGlobalFeatureExtractor::getVariance ( void  )
inline

Retunrs the variance of the source image.

Returns
The variance of the source image

Definition at line 53 of file GlobalFeatureExtractor.h.

Here is the call graph for this function:

The documentation for this class was generated from the following file: