Public Member Functions | Private Member Functions | Private Attributes

CvUtils Class Reference

Image features extractor. More...

#include <cvUtils.h>

List of all members.

Public Member Functions

 CvUtils (string f)
 Default constructor.
 CvUtils (string f, String featureType, String descriptorType)
 Customizable detector The advanced detector can use all the feature detectors currently supported by OpenCV:
"FAST" – FastFeatureDetector
"STAR" – StarFeatureDetector
"SIFT" – SIFT (nonfree module)
"SURF" – SURF (nonfree module)
"ORB" – ORB
"MSER" – MSER
"GFTT" – GoodFeaturesToTrackDetector
"HARRIS" – GoodFeaturesToTrackDetector with Harris detector enabled
"Dense" – DenseFeatureDetector
"SimpleBlob" – SimpleBlobDetector

Also a combined format is supported: feature detector adapter name
("Grid" – GridAdaptedFeatureDetector, "Pyramid" – PyramidAdaptedFeatureDetector) + feature detector name (see above), for example: "GridFAST", "PyramidSTAR".
WARNING: The "Dynamic" feature detectors are only used by the Android version of OpenCV and doesn't exist on other platforms. This feature is not disabled in the constructor and trying to use it crashes the server. The constructor should reject attempts to use this by either throwing an exception or falling back to the non dynamic type of the feature detector.
.
 ~CvUtils ()
String detect ()
 Performs image feature extraction.

Private Member Functions

void toFile (String extension)
 Store the image features to file.
void fromFile ()
 Load file into memory.
Mat list_keypoint_to_Mat (vector< KeyPoint > kp)
 Convenience operation, easing the storage operations in toFile(String extension).

Private Attributes

string thefile
string feature
string descriptor
Mat image
vector< KeyPoint > kps
Mat descs

Detailed Description

Image features extractor.

Currently the CvUtils class only support feature detection and descriptor extraction.

Todo:
BUG: The detector and extractor crashes when the client is trying to use Dynamic keypoint detectors. The bug is not fixed because of development time constraints. Testing can be done by feeding the server these detectors. The maintainer should write some code to disable the ones that crashes the server until the bug is fixed. Possible fixes are: falling back to the non dynamic type, throw exception or close connection.
Version:
0.1
Author:
Mats-Gøran Karlsen

Definition at line 22 of file cvUtils.h.


Constructor & Destructor Documentation

CvUtils::CvUtils ( string  f  ) 

Default constructor.

The default detector constructor uses SURF for feature detection and descriptor extraction.

Parameters:
f String representation of the file location. The file must have one of the following filetype suffixes:
Legal image file: ex. "file.bmp" or "file.jpg"
Legal OpenCV Mat data structure represented as YAML or XML, created using the built in OpenCV serializer.
Legal file suffixes are xml or yml, i.e. "file.xml". Refer to official OpenCV documentation for details.
Version:
0.1
CvUtils::CvUtils ( string  f,
String  featureType,
String  descriptorType 
)

Customizable detector The advanced detector can use all the feature detectors currently supported by OpenCV:
"FAST" – FastFeatureDetector
"STAR" – StarFeatureDetector
"SIFT" – SIFT (nonfree module)
"SURF" – SURF (nonfree module)
"ORB" – ORB
"MSER" – MSER
"GFTT" – GoodFeaturesToTrackDetector
"HARRIS" – GoodFeaturesToTrackDetector with Harris detector enabled
"Dense" – DenseFeatureDetector
"SimpleBlob" – SimpleBlobDetector

Also a combined format is supported: feature detector adapter name
("Grid" – GridAdaptedFeatureDetector, "Pyramid" – PyramidAdaptedFeatureDetector) + feature detector name (see above), for example: "GridFAST", "PyramidSTAR".
WARNING: The "Dynamic" feature detectors are only used by the Android version of OpenCV and doesn't exist on other platforms. This feature is not disabled in the constructor and trying to use it crashes the server. The constructor should reject attempts to use this by either throwing an exception or falling back to the non dynamic type of the feature detector.
.


The advanced detector can use all the descriptor extractors currently supported by OpenCV:
"SIFT" – SIFT
"SURF" – SURF
"ORB" – ORB
"BRIEF" – BriefDescriptorExtractor

A combined format is also supported: descriptor extractor adapter name
( "Opponent" – OpponentColorDescriptorExtractor ) + descriptor extractor name (see above), for example: "OpponentSIFT".

For more info see official OpenCV documentation.

Parameters:
f SString representation of the file location. The file must have one of the following filetype suffixes:
Legal image file: ex. "file.bmp" or "file.jpg"
Legal OpenCV Mat data structure represented as YAML or XML, created using the built in OpenCV serializer.
Legal file suffixes are xml or yml, i.e. "file.xml". Refer to official OpenCV documentation for details.
featureType A legal feature detector supported by OpenCV
descriptorType A legal descriptor extractor supported by OpenCV
Version:
0.1
Todo:
The "Dynamic" feature detectors are only used by the Android version of OpenCV and doesn't exist on other platforms. This feature is not disabled in the constructor and trying to use it crashes the server. The constructor should reject attempts to use this by either throwing an exception or falling back to the non dynamic type of the feature detector.
CvUtils::~CvUtils (  ) 

Definition at line 29 of file cvUtils.cpp.


Member Function Documentation

String CvUtils::detect (  ) 

Performs image feature extraction.

Performs the image feature extraction on the image referenced to in the constructor using the parameters in the constructor.

Returns:
Reference to the extracted features stored in the OpenCV XML format. For more information on this format refer to the official OpenCV documentation.
Version:
0.1

Definition at line 46 of file cvUtils.cpp.

References descriptor, descs, feature, fromFile(), image, kps, thefile, and toFile().

void CvUtils::fromFile (  )  [private]

Load file into memory.

Reads the received file contents and make them available to detect().

Version:
0.1

Definition at line 72 of file cvUtils.cpp.

References image, and thefile.

Referenced by detect().

Mat CvUtils::list_keypoint_to_Mat ( vector< KeyPoint >  kp  )  [private]

Convenience operation, easing the storage operations in toFile(String extension).

Helper function converting the OpenCV keypoint list into a OpenCV Mat structure. This makes the storage operation in toFile(String extension) less cluttered. For more information on the OpenCV data structures refer to the official OpenCV documentation.

Parameters:
kp The OpenCV keypoint list.
Returns:
The list converted to an OpenCV Mat data structure.
Version:
0.1

Definition at line 131 of file cvUtils.cpp.

Referenced by toFile().

void CvUtils::toFile ( String  extension  )  [private]

Store the image features to file.

Stores the detected image features in detect() to file using the built in serializer in OpenCV. For more info refer to official OpenCV documentation.

Parameters:
extension A YAML extension (.yml) of XML extenstion (xml).
Version:
0.1

Definition at line 106 of file cvUtils.cpp.

References descriptor, descs, feature, kps, list_keypoint_to_Mat(), and thefile.

Referenced by detect().


Member Data Documentation

string CvUtils::descriptor [private]

Definition at line 92 of file cvUtils.h.

Referenced by detect(), and toFile().

Mat CvUtils::descs [private]

Definition at line 95 of file cvUtils.h.

Referenced by detect(), and toFile().

string CvUtils::feature [private]

Definition at line 91 of file cvUtils.h.

Referenced by detect(), and toFile().

Mat CvUtils::image [private]

Definition at line 93 of file cvUtils.h.

Referenced by detect(), and fromFile().

vector<KeyPoint> CvUtils::kps [private]

Definition at line 94 of file cvUtils.h.

Referenced by detect(), and toFile().

string CvUtils::thefile [private]

Definition at line 90 of file cvUtils.h.

Referenced by detect(), fromFile(), and toFile().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables