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

Global-features extraction. More...

Functions

size_t getNumLines (const Mat &img, int threshold1=100, int threshold2=50)
 Returns the number of staight lines in the image. More...
 
size_t getNumCircles (const Mat &img, int threshold1=100, int threshold2=30)
 Returns the number of circles in the source image. More...
 
float getOpacity (const Mat &img)
 Returns the weighted-mean transparancy of the source image. More...
 
float getVariance (const Mat &img)
 Retunrs the variance of the source image. More...
 
int getArea (const Mat &img)
 Returns the number of non-zero pixels in the source image. More...
 
int getPerimeter (const Mat &img)
 Returns the perimeter of an object in the source image. More...
 
float getCompactness (const Mat &img)
 Returns the compactness of the object in the source image. More...
 

Detailed Description

Global-features extraction.

This namespace collects methods for the global features extraction

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

Function Documentation

◆ getArea()

int DirectGraphicalModels::fex::global::getArea ( const Mat &  img)

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

Parameters
imgThe source image of type CV_8UC1 or CV_8UC3.
Returns
The number of non-zero pixels in the source image.

Definition at line 155 of file Global.cpp.

Here is the caller graph for this function:

◆ getCompactness()

float DirectGraphicalModels::fex::global::getCompactness ( const Mat &  img)

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.

Parameters
imgThe source image of type CV_8UC1 or CV_8UC3.
Returns
The compactness of the object in the source image.

Definition at line 194 of file Global.cpp.

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

◆ getNumCircles()

size_t DirectGraphicalModels::fex::global::getNumCircles ( const Mat &  img,
int  threshold1 = 100,
int  threshold2 = 30 
)

Returns the number of circles in the source image.

Parameters
imgThe source image of type CV_8UC1 or CV_8UC3.
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. Circles, corresponding to the larger accumulator values, will be returned first.
Returns
The number of circles in the source image

Definition at line 71 of file Global.cpp.

Here is the caller graph for this function:

◆ getNumLines()

size_t DirectGraphicalModels::fex::global::getNumLines ( const Mat &  img,
int  threshold1 = 100,
int  threshold2 = 50 
)

Returns the number of staight lines in the image.

Parameters
imgThe source image of type CV_8UC1 or CV_8UC3.
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 5 of file Global.cpp.

Here is the caller graph for this function:

◆ getOpacity()

float DirectGraphicalModels::fex::global::getOpacity ( const Mat &  img)

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.

Parameters
imgThe source image of type CV_8UC1 or CV_8UC3.
Returns
The weighted-mean transparancy of the source image.

Definition at line 112 of file Global.cpp.

Here is the caller graph for this function:

◆ getPerimeter()

int DirectGraphicalModels::fex::global::getPerimeter ( const Mat &  img)

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.

Parameters
imgThe source image of type CV_8UC1 or CV_8UC3.
Returns
The number of edge pixels in the source image.

Definition at line 172 of file Global.cpp.

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

◆ getVariance()

float DirectGraphicalModels::fex::global::getVariance ( const Mat &  img)

Retunrs the variance of the source image.

Parameters
imgThe source image of type CV_8UC1 or CV_8UC3.
Returns
The variance of the source image.

Definition at line 141 of file Global.cpp.

Here is the caller graph for this function: