Feature detection and tracking basics
1. Description
A set of features is represented in MRPT with the class mrpt::vision::CFeatureList
(for features with patches, descriptors, etc.) or with the more light-weighted structure mrpt::vision::TSimpleFeatureList
for a plain list of feature points without descriptors.
Those two are the central data types in feature detection and tracking classes. In the case of mrpt::vision::CFeatureList
, it consists of a list of individual feature structures (of type mrpt::vision::CFeature), each holding a (x,y) pixel coordinates, a unique ID, and, optionally, one or more descriptors. So it’s important to tell the difference between a feature detector and its descriptors.
Refer to the module ‘Features’ (within the library mrpt-vision) for further documentation.
2. Detection & descriptors
Use the class mrpt::vision::CFeatureExtraction for detecting, and optionally extracting descriptors, from an image.
See also the program track-video-features.
3. Tracking
For efficient feature tracking, see the class mrpt::vision::CGenericFeatureTracker, a virtual base class for tracking frameworks that, independently of the specific tracking algorithm, implement common stages such as detection of new features with FAST in areas of the image where old features have been lost, recalculation of KLT scores and deletion of badly-tracked features, etc.
4. Loading/saving to text files
A sequence of features in an object of type CFeatureList can be saved and loaded to/from text files, in a human-friendly format. These files can be also loaded from MATLAB/octave. See the functionsmrpt::vision::CFeatureList::loadFromTextFile() and mrpt::vision::CFeatureList::saveToTextFile(). Example of the contents of such a file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
% Dump of mrpt::vision::CFeatureList. Each line format is: % ID TYPE X Y ORIENTATION SCALE TRACK_STATUS RESPONSE HAS_SIFT [SIFT] HAS_SURF [SURF] % \---------------------- feature ------------------/ \--------- descriptors -------/ % with: % TYPE : The used detector: 0:KLT, 1: Harris, 2: BCD, 3: SIFT, 4: SURF, 5: Beacon, 6: FAST % HAS_* : 1 if a descriptor of that type is associated to the feature. % SIFT : Present if HAS_SIFT=1: N DESC_0 ... DESC_N-1 % SURF : Present if HAS_SURF=1: N DESC_0 ... DESC_N-1 %------------------------------------------------------------------------------------------- 0 0 8.816 202.564 1.42 25.60 5 0.000 1 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 1 0 0 0 0 0 3 52 5 0 0 2 0 0 0 1 0 0 0 12 1 0 0 0 0 0 0 3 0 0 0 182 3 0 0 0 0 0 182 182 27 16 12 6 0 0 149 10 6 23 30 46 3 0 0 0 0 0 2 15 0 0 0 182 11 10 0 0 0 0 182 182 57 105 19 0 0 0 102 39 19 36 17 3 5 5 23 0 0 0 1 7 7 2 1 0 1 0 21.781 205.529 1.41 25.60 5 0.000 1 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 45 1 0 0 0 0 0 8 81 8 0 0 2 0 0 2 1 0 0 0 17 2 0 0 0 0 0 0 4 0 0 0 180 3 0 0 0 0 0 180 180 29 20 15 5 0 0 153 9 6 28 34 40 3 0 1 0 0 0 3 14 0 0 0 180 13 13 1 0 0 0 180 173 65 116 19 0 0 0 79 49 21 31 12 3 6 6 25 0 0 0 0 7 8 2 1 0 ... |