NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
upm::BAD Class Reference

#include <BAD.h>

Inheritance diagram for upm::BAD:
Inheritance graph

Classes

struct  BoxPairParams
 

Public Types

enum  BadSize { SIZE_512_BITS = 100, SIZE_256_BITS = 101 }
 Descriptor number of bits, each bit is a weak-descriptor. The user can choose between 512 or 256 bits. More...
 

Public Member Functions

 BAD (float scale_factor=1.0f, BadSize n_bits=SIZE_512_BITS)
 
void compute (cv::InputArray image, CV_OUT CV_IN_OUT std::vector< cv::KeyPoint > &keypoints, cv::OutputArray descriptors) override
 Computes the descriptors for a set of keypoints detected in an image (first variant) or image set (second variant). More...
 
int descriptorSize () const override
 
int descriptorType () const override
 
int defaultNorm () const override
 
bool empty () const override
 
cv::String getDefaultName () const override
 

Static Public Member Functions

static cv::Ptr< BADcreate (float scale_factor=1.0f, BadSize n_bits=SIZE_512_BITS)
 Creates the BAD descriptor. More...
 

Protected Member Functions

void computeBAD (const cv::Mat &integral_img, const std::vector< cv::KeyPoint > &keypoints, cv::Mat &descriptors)
 

Protected Attributes

std::vector< float > thresholds_
 
std::vector< BoxPairParamsbox_params_
 
float scale_factor_ = 1
 
cv::Size patch_size_ = {32, 32}
 

Detailed Description

Implementation of the Box Average Difference (BAD) descriptor. The method uses features computed from the difference of the average gray values of two boxes in the patch.

Each pair of boxes is represented with a BoxPairParams struct. After obtaining the feature from them, the i'th feature is thresholded with thresholds_[i], producing the binary weak-descriptor.

Member Enumeration Documentation

◆ BadSize

Descriptor number of bits, each bit is a weak-descriptor. The user can choose between 512 or 256 bits.

Enumerator
SIZE_512_BITS 
SIZE_256_BITS 

Constructor & Destructor Documentation

◆ BAD()

upm::BAD::BAD ( float  scale_factor = 1.0f,
BadSize  n_bits = SIZE_512_BITS 
)
explicit
Parameters
scale_factorAdjust the sampling window around detected keypoints:
  • 1.00f should be the scale for ORB keypoints
  • 6.75f should be the scale for SIFT detected keypoints
  • 6.25f is default and fits for KAZE, SURF detected keypoints
  • 5.00f should be the scale for AKAZE, MSD, AGAST, FAST, BRISK keypoints
n_bitsDetermine the number of bits in the descriptor. Should be either BAD::SIZE_512_BITS or BAD::SIZE_256_BITS.

Member Function Documentation

◆ compute()

void upm::BAD::compute ( cv::InputArray  image,
CV_OUT CV_IN_OUT std::vector< cv::KeyPoint > &  keypoints,
cv::OutputArray  descriptors 
)
override

Computes the descriptors for a set of keypoints detected in an image (first variant) or image set (second variant).

Parameters
imageImage.
keypointsInput collection of keypoints. Keypoints for which a descriptor cannot be computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint with several dominant orientations (for each orientation).
descriptorsComputed descriptors. In the second variant of the method descriptors[i] are descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the descriptor for keypoint j-th keypoint.

◆ computeBAD()

void upm::BAD::computeBAD ( const cv::Mat &  integral_img,
const std::vector< cv::KeyPoint > &  keypoints,
cv::Mat &  descriptors 
)
protected

◆ create()

static cv::Ptr<BAD> upm::BAD::create ( float  scale_factor = 1.0f,
BadSize  n_bits = SIZE_512_BITS 
)
inlinestatic

Creates the BAD descriptor.

Parameters
scale_factorAdjust the sampling window around detected keypoints:
  • 1.00f should be the scale for ORB keypoints
  • 6.75f should be the scale for SIFT detected keypoints
  • 6.25f is default and fits for KAZE, SURF detected keypoints
  • 5.00f should be the scale for AKAZE, MSD, AGAST, FAST, BRISK keypoints
n_bits
Returns

◆ defaultNorm()

int upm::BAD::defaultNorm ( ) const
inlineoverride

◆ descriptorSize()

int upm::BAD::descriptorSize ( ) const
inlineoverride

◆ descriptorType()

int upm::BAD::descriptorType ( ) const
inlineoverride

◆ empty()

bool upm::BAD::empty ( ) const
inlineoverride

◆ getDefaultName()

cv::String upm::BAD::getDefaultName ( ) const
inlineoverride

Member Data Documentation

◆ box_params_

std::vector<BoxPairParams> upm::BAD::box_params_
protected

◆ patch_size_

cv::Size upm::BAD::patch_size_ = {32, 32}
protected

◆ scale_factor_

float upm::BAD::scale_factor_ = 1
protected

◆ thresholds_

std::vector<float> upm::BAD::thresholds_
protected

The documentation for this class was generated from the following files: