BRIEF descriptor
| 37 | |
| 38 | /// BRIEF descriptor |
| 39 | class BRIEF { |
| 40 | public: |
| 41 | /// Bitset type |
| 42 | typedef boost::dynamic_bitset<> bitset; |
| 43 | |
| 44 | /// Type of pairs |
| 45 | enum Type { |
| 46 | RANDOM, // random pairs (Calonder's original version) |
| 47 | RANDOM_CLOSE, // random but close pairs (used in GalvezIROS11) |
| 48 | }; |
| 49 | |
| 50 | public: |
| 51 | /** |
| 52 | * Creates the BRIEF a priori data for descriptors of nbits length |
| 53 | * @param nbits descriptor length in bits |
| 54 | * @param patch_size |
| 55 | * @param type type of pairs to generate |
| 56 | */ |
| 57 | BRIEF(int nbits = 256, int patch_size = 48, Type type = RANDOM_CLOSE); |
| 58 | virtual ~BRIEF(); |
| 59 | |
| 60 | /** |
| 61 | * Returns the descriptor length in bits |
| 62 | * @return descriptor length in bits |
| 63 | */ |
| 64 | inline int getDescriptorLengthInBits() const { return m_bit_length; } |
| 65 | |
| 66 | /** |
| 67 | * Returns the type of classifier |
| 68 | */ |
| 69 | inline Type getType() const { return m_type; } |
| 70 | |
| 71 | /** |
| 72 | * Returns the size of the patch |
| 73 | */ |
| 74 | inline int getPatchSize() const { return m_patch_size; } |
| 75 | |
| 76 | /** |
| 77 | * Returns the BRIEF descriptors of the given keypoints in the given image |
| 78 | * @param image |
| 79 | * @param points |
| 80 | * @param descriptors |
| 81 | * @param treat_image (default: true) if true, the image is converted to |
| 82 | * grayscale if needed and smoothed. If not, it is assumed the image has |
| 83 | * been treated by the user |
| 84 | * @note this function is similar to BRIEF::compute |
| 85 | */ |
| 86 | inline void operator()(const cv::Mat& image, |
| 87 | const std::vector<cv::KeyPoint>& points, |
| 88 | std::vector<bitset>& descriptors, |
| 89 | bool treat_image = true) const { |
| 90 | compute(image, points, descriptors, treat_image); |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * Returns the BRIEF descriptors of the given keypoints in the given image |
| 95 | * @param image |
| 96 | * @param points |
nothing calls this directly
no outgoing calls
no test coverage detected