#include <lm_filter_bank.h>
Public Member Functions | |
std::vector< TextonFeature > | clusterTextons (std::vector< std::vector< TextonFeature > > samples, int k, int attempts=3) |
std::vector< int > | extractDescriptor (cv::Mat &frame) |
std::vector< TextonFeature > | extractRawFeature (cv::Mat &frame, bool use_all_pixels=false) |
float | featureDist (TextonFeature f1, TextonFeature f2) |
std::vector< TextonFeature > | getCenters () const |
int | getNumCenters () const |
LMFilterBank (int orientations=6, int elongated_scales=1, int gaussian_scales=1, int num_extract_scales=2, int support=7) | |
int | quantizeFeature (TextonFeature feat) |
bool | readTextonCenters (std::string file_name) |
void | saveTextonCenters (std::vector< TextonFeature > centers, std::string file_name) |
cv::Mat | textonQuantizeImage (cv::Mat &frame) |
void | visualizeKernels (void) |
Protected Member Functions | |
cv::Mat | createElongatedFilter (float scale, int phase_x, int phase_y, cv::Mat pts_1, cv::Mat pts_2, int sup) |
void | generateFilters (void) |
cv::Mat | getDOGFilter (int ksize, float sigma, float alpha=3.0) |
cv::Mat | getGaussianDeriv (float sigma, float mu, cv::Mat x, int ord) |
cv::Mat | normalize (cv::Mat &f) |
cv::Mat | upSampleResponse (cv::Mat &down_convolved, int s, cv::Size size0) |
Protected Attributes | |
std::vector< cv::Mat > | bars_ |
std::vector< TextonFeature > | centers_ |
std::vector< cv::Mat > | dogs_ |
std::vector< cv::Mat > | edges_ |
std::vector< cv::Mat > | gaussians_ |
int | n_e_scales_ |
int | n_extract_scales_ |
int | n_filters_ |
int | n_g_scales_ |
int | n_orientations_ |
int | support_ |
Definition at line 51 of file lm_filter_bank.h.
cpl_visual_features::LMFilterBank::LMFilterBank | ( | int | orientations = 6 , |
int | elongated_scales = 1 , |
||
int | gaussian_scales = 1 , |
||
int | num_extract_scales = 2 , |
||
int | support = 7 |
||
) |
Cunstroctor for LMFilterBank class. Implementing the one used in: Leung and Malik. "Representing and recognizing the visual appearance of materials using three-dimensional textons." IJCV, 2001.
Definition at line 50 of file lm_filter_bank.cpp.
vector< TextonFeature > cpl_visual_features::LMFilterBank::clusterTextons | ( | std::vector< std::vector< TextonFeature > > | samples, |
int | k, | ||
int | attempts = 3 |
||
) |
Method to cluster raw extracted feauters into textons
samples | |
k | The number of texton centers to find |
Definition at line 306 of file lm_filter_bank.cpp.
Mat cpl_visual_features::LMFilterBank::createElongatedFilter | ( | float | scale, |
int | phase_x, | ||
int | phase_y, | ||
cv::Mat | pts_1, | ||
cv::Mat | pts_2, | ||
int | sup | ||
) | [protected] |
Definition at line 360 of file lm_filter_bank.cpp.
vector< int > cpl_visual_features::LMFilterBank::extractDescriptor | ( | cv::Mat & | frame | ) |
Extracts a histogram of the texture descriptors over the given image patch
frame | The image patch over which to extract the quantized descriptor |
Definition at line 255 of file lm_filter_bank.cpp.
vector< TextonFeature > cpl_visual_features::LMFilterBank::extractRawFeature | ( | cv::Mat & | frame, |
bool | use_all_pixels = false |
||
) |
Extract a texture feature from the given image using the filter bank.
frame | The image to extract the texture feature |
Definition at line 134 of file lm_filter_bank.cpp.
float cpl_visual_features::LMFilterBank::featureDist | ( | TextonFeature | f1, |
TextonFeature | f2 | ||
) |
Determine the distance between two feature vectors.
f1 | The first feature vector |
f2 | The second feature vector |
Definition at line 452 of file lm_filter_bank.cpp.
void cpl_visual_features::LMFilterBank::generateFilters | ( | void | ) | [protected] |
Definition at line 60 of file lm_filter_bank.cpp.
std::vector<TextonFeature> cpl_visual_features::LMFilterBank::getCenters | ( | ) | const [inline] |
Definition at line 153 of file lm_filter_bank.h.
Mat cpl_visual_features::LMFilterBank::getDOGFilter | ( | int | ksize, |
float | sigma, | ||
float | alpha = 3.0 |
||
) | [protected] |
Definition at line 403 of file lm_filter_bank.cpp.
Mat cpl_visual_features::LMFilterBank::getGaussianDeriv | ( | float | sigma, |
float | mu, | ||
cv::Mat | x, | ||
int | ord | ||
) | [protected] |
Definition at line 371 of file lm_filter_bank.cpp.
int cpl_visual_features::LMFilterBank::getNumCenters | ( | ) | const [inline] |
Definition at line 158 of file lm_filter_bank.h.
Mat cpl_visual_features::LMFilterBank::normalize | ( | cv::Mat & | f | ) | [protected] |
Definition at line 444 of file lm_filter_bank.cpp.
Method to take a raw filter response feature and quantize it to the correct texton value.
feat | A raw texton feature. |
Definition at line 288 of file lm_filter_bank.cpp.
bool cpl_visual_features::LMFilterBank::readTextonCenters | ( | std::string | file_name | ) |
Read the cluster centers into memory that have previously been saved to disk using the method saveTextonCenters. These centers will be stored internally in the lm_filter_bank instance
file_name | The location of the cluster center files |
Definition at line 538 of file lm_filter_bank.cpp.
void cpl_visual_features::LMFilterBank::saveTextonCenters | ( | std::vector< TextonFeature > | centers, |
std::string | file_name | ||
) |
Save the texton centers to a file. Each row of the file corresponds to a different center.
centers | The vector of cluster centers to write to disk. |
file_name | The location to save the centers. |
Definition at line 518 of file lm_filter_bank.cpp.
Mat cpl_visual_features::LMFilterBank::textonQuantizeImage | ( | cv::Mat & | frame | ) |
For a given image associate each pixel with a texture label.
frame | The image on which to perform the feature extraction and quantization. |
Definition at line 267 of file lm_filter_bank.cpp.
Mat cpl_visual_features::LMFilterBank::upSampleResponse | ( | cv::Mat & | down_convolved, |
int | s, | ||
cv::Size | size0 | ||
) | [protected] |
Definition at line 414 of file lm_filter_bank.cpp.
void cpl_visual_features::LMFilterBank::visualizeKernels | ( | void | ) |
Display the different kernels.
Definition at line 471 of file lm_filter_bank.cpp.
std::vector<cv::Mat> cpl_visual_features::LMFilterBank::bars_ [protected] |
Definition at line 181 of file lm_filter_bank.h.
Definition at line 185 of file lm_filter_bank.h.
std::vector<cv::Mat> cpl_visual_features::LMFilterBank::dogs_ [protected] |
Definition at line 184 of file lm_filter_bank.h.
std::vector<cv::Mat> cpl_visual_features::LMFilterBank::edges_ [protected] |
Definition at line 182 of file lm_filter_bank.h.
std::vector<cv::Mat> cpl_visual_features::LMFilterBank::gaussians_ [protected] |
Definition at line 183 of file lm_filter_bank.h.
int cpl_visual_features::LMFilterBank::n_e_scales_ [protected] |
Definition at line 176 of file lm_filter_bank.h.
int cpl_visual_features::LMFilterBank::n_extract_scales_ [protected] |
Definition at line 178 of file lm_filter_bank.h.
int cpl_visual_features::LMFilterBank::n_filters_ [protected] |
Definition at line 180 of file lm_filter_bank.h.
int cpl_visual_features::LMFilterBank::n_g_scales_ [protected] |
Definition at line 177 of file lm_filter_bank.h.
int cpl_visual_features::LMFilterBank::n_orientations_ [protected] |
Definition at line 175 of file lm_filter_bank.h.
int cpl_visual_features::LMFilterBank::support_ [protected] |
Definition at line 179 of file lm_filter_bank.h.