Direct Graphical Models
v.1.7.0
|
Gradient feature extraction class. More...
#include <Gradient.h>
Public Member Functions | |
CGradient (const Mat &img) | |
Constructor. More... | |
virtual | ~CGradient (void) |
virtual Mat | get (void) const |
Extracts and returns the required feature. More... | |
Public Member Functions inherited from DirectGraphicalModels::fex::ILocalFeatureExtractor | |
ILocalFeatureExtractor (const Mat &img) | |
Constructor. More... | |
virtual | ~ILocalFeatureExtractor (void) |
Public Member Functions inherited from DirectGraphicalModels::fex::IFeatureExtractor | |
IFeatureExtractor (const Mat &img) | |
Constructor. More... | |
virtual | ~IFeatureExtractor (void) |
Static Public Member Functions | |
static Mat | get (const Mat &img, float mid=GRADIENT_MAX_VALUE) |
Extracts the gradient feature. More... | |
Static Protected Member Functions | |
static Mat | getDerivativeX (const Mat &img) |
static Mat | getDerivativeY (const Mat &img) |
Friends | |
class | CHOG |
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... | |
Gradient feature extraction class.
Definition at line 15 of file Gradient.h.
|
inline |
Constructor.
img | Input image of type CV_8UC1 or CV_8UC3. |
Definition at line 23 of file Gradient.h.
|
inlinevirtual |
Definition at line 24 of file Gradient.h.
|
inlinevirtual |
Extracts and returns the required feature.
Implements DirectGraphicalModels::fex::ILocalFeatureExtractor.
Definition at line 26 of file Gradient.h.
|
static |
Extracts the gradient feature.
This function calculates the magnitude of gradient of the input image as follows:
\[gradient=\sqrt{\left(\frac{d\,img}{dx}\right)^2+\left(\frac{d\,img}{dy}\right)^2},\]
where \(\frac{d\,img}{dx}\) and \(\frac{d\,img}{dy}\) are the first x and y central derivatives of the input image.
As \(gradient\in[0; 255\,\sqrt{2}]\), this function performs two-linear mapping of the gradient values to the interval \([0; 255]\), such that:
\begin{eqnarray*}0&\rightarrow&0 \\ mid&\rightarrow&255 \\ 255\,\sqrt{2}&\rightarrow&255\end{eqnarray*}
For more details on mapping refer to the two_linear_mapper() function.
img | Input image of type CV_8UC1 or CV_8UC3. |
mid | Parameter for the two-linear mapping of the feature: \(mid\in(0;255\sqrt{2}]\). (Ref. two_linear_mapper()). |
Definition at line 7 of file Gradient.cpp.
|
staticprotected |
|
staticprotected |
|
friend |
Definition at line 17 of file Gradient.h.