Direct Graphical Models
v.1.7.0
|
NDVI (normalized difference vegetation index) feature extraction class. More...
#include <NDVI.h>
Public Member Functions | |
CNDVI (const Mat &img) | |
Constructor. More... | |
virtual | ~CNDVI (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, byte midPoint=127) |
Extracts the NDVI feature. More... | |
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... | |
NDVI (normalized difference vegetation index) feature extraction class.
|
inline |
|
inlinevirtual |
|
inlinevirtual |
Extracts and returns the required feature.
Implements DirectGraphicalModels::fex::ILocalFeatureExtractor.
Definition at line 24 of file NDVI.h.
|
static |
Extracts the NDVI feature.
This function calculates the NDVI from the input image as follows:
\[ NDVI=\frac{NIR-VIS}{NIR+VIS},\]
where \(NIR\) designates the near-infra-red data, and \(VIS\) - visible data. The algorithm assumes that the near-infra-red data is stored in the red image channel and the visible data - in the remaining two channels:
\begin{eqnarray*}NIR&=&img.RED \\ VIS&=&\frac{1}{2}\,img.GREEN+\frac{1}{2}\,img.BLUE.\end{eqnarray*}
As \(NDVI\in[-1; 1]\), this function performs two-linear mapping of the NDVI values to the interval \([0; 255]\), such that:
\begin{eqnarray*}-1&\rightarrow&0 \\ 0&\rightarrow&midPoint \\ 1&\rightarrow&255\end{eqnarray*}
For more details on mapping refer to the two_linear_mapper() function.
img | Input image of type CV_8UC3, where near-infra-red data is stored in the red channel. |
midPoint | Parameter for the two-linear mapping of the feature (Ref. two_linear_mapper()).
|