Direct Graphical Models  v.1.7.0
GlobalFeatureExtractor.h
1 // Global-features Extraction class
2 // Writtem by Sergey G. Kosov in 2016 for Project X
3 #pragma once
4 
5 #include "IFeatureExtractor.h"
6 #include "Global.h"
7 
8 namespace DirectGraphicalModels { namespace fex
9 {
10  // ================================ Base GLOBAL Feature Extractor Class ==============================
18  {
19  public:
24  DllExport CGlobalFeatureExtractor(const Mat &img) : IFeatureExtractor(img) { }
25  DllExport virtual ~CGlobalFeatureExtractor(void) { }
26 
33  DllExport size_t getNumLines(int threshold1 = 100, int threshold2 = 50) const { return global::getNumLines(m_img, threshold1, threshold2); }
40  DllExport size_t getNumCircles(int threshold1 = 100, int threshold2 = 30) const { return global::getNumCircles(m_img, threshold1, threshold2); }
48  DllExport float getOpacity(void) const { return global::getOpacity(m_img); }
53  DllExport float getVariance(void) { return global::getVariance(m_img); }
58  DllExport int getArea(void) { return global::getArea(m_img); }
64  DllExport int getPerimeter(void) { return global::getPerimeter(m_img); }
70  DllExport float getCompactness(void) { return global::getCompactness(m_img); }
71  };
72 
73 } }
float getOpacity(void) const
Returns the weighted-mean transparancy of the source image.
float getCompactness(void)
Returns the compactness of the object in the source image.
int getArea(void)
Returns the number of non-zero pixels in the source image.
float getCompactness(const Mat &img)
Returns the compactness of the object in the source image.
Definition: Global.cpp:194
float getOpacity(const Mat &img)
Returns the weighted-mean transparancy of the source image.
Definition: Global.cpp:112
float getVariance(void)
Retunrs the variance of the source image.
size_t getNumCircles(int threshold1=100, int threshold2=30) const
Returns the number of circles in the source image.
size_t getNumLines(int threshold1=100, int threshold2=50) const
Returns the number of staight lines in the image.
int getArea(const Mat &img)
Returns the number of non-zero pixels in the source image.
Definition: Global.cpp:155
int getPerimeter(const Mat &img)
Returns the perimeter of an object in the source image.
Definition: Global.cpp:172
float getVariance(const Mat &img)
Retunrs the variance of the source image.
Definition: Global.cpp:141
Interface class for global feature extraction algorithms.
size_t getNumCircles(const Mat &img, int threshold1, int threshold2)
Returns the number of circles in the source image.
Definition: Global.cpp:71
int getPerimeter(void)
Returns the perimeter of an object in the source image.
size_t getNumLines(const Mat &img, int threshold1, int threshold2)
Returns the number of staight lines in the image.
Definition: Global.cpp:5
const Mat m_img
Container for the image, from which the features are to be extracted.
Interface class for feature extraction algorithms.