Image features extractor. More...
#include <cvUtils.h>
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 |
Image features extractor.
Currently the CvUtils class only support feature detection and descriptor extraction.
Definition at line 22 of file cvUtils.h.
CvUtils::CvUtils | ( | string | f | ) |
Default constructor.
The default detector constructor uses SURF for feature detection and descriptor extraction.
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. |
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.
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 |
CvUtils::~CvUtils | ( | ) |
Definition at line 29 of file cvUtils.cpp.
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.
Definition at line 46 of file cvUtils.cpp.
References descriptor, descs, feature, fromFile(), image, kps, thefile, and toFile().
void CvUtils::fromFile | ( | ) | [private] |
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.
kp | The OpenCV keypoint list. |
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.
extension | A YAML extension (.yml) of XML extenstion (xml). |
Definition at line 106 of file cvUtils.cpp.
References descriptor, descs, feature, kps, list_keypoint_to_Mat(), and thefile.
Referenced by detect().
string CvUtils::descriptor [private] |
Mat CvUtils::descs [private] |
string CvUtils::feature [private] |
Mat CvUtils::image [private] |
Definition at line 93 of file cvUtils.h.
Referenced by detect(), and fromFile().
vector<KeyPoint> CvUtils::kps [private] |
string CvUtils::thefile [private] |
Definition at line 90 of file cvUtils.h.
Referenced by detect(), fromFile(), and toFile().