<commit_before>/**
 * @file featureselector.h
 * @brief This class is designed to interface with the user through configuration files(.ini).
 * @detail The user can select the method for the detector,descriptor and matcher in conf/vgSLAM.ini
 * and then tune the parameters of the method in the respective ini files contained in the conf
 * folder.
 * @copyright Copyright (C) 2016 iCub Facility - Istituto Italiano di Tecnologia
 * @author <NAME>
 * @email <EMAIL>
 * @date Sept 2016
 * @acknowledgement This research has received funding from the European Union’s 
 * Seventh Framework Programme for research, technological development and demonstration 
 * under grant agreement No. 611909(KoroiBot).
 * @license Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
 */

#ifndef FEATURESELECTOR_H
#define FEATURESELECTOR_H

#define    vgSLAM_KAZE    0 //det
#define    vgSLAM_FAST    1 //det
#define    vgSLAM_SIFT    2 //det & desc
#define    vgSLAM_GFTT    3 //det
#define    vgSLAM_SURF    4 //det & desc 32f
#define    vgSLAM_BRIEF   5 //desc 8U
#define    vgSLAM_ORB     6 //det & desc 8U
#define    vgSLAM_BRISK   7 //det & desc 8U
#define    vgSLAM_FREAK   8 //desc 8U
#define    vgSLAM_FLANN   9 //matcher  works with 32f desc
#define    vgSLAM_BRUTEFORCEL2   10 //matcher
#define    vgSLAM_BRUTEFORCEL1 11 //matcher
#define    vgSLAM_BRUTEFORCEHAMMING   12//matcher works with 8U desc
#define    vgSLAM_AKAZE    13 //det

#include "yarp/os/all.h"
#include "opencvs.h"
#include "cpps.h"


class FeatureSelector
{
    yarp::os::ResourceFinder rf;


public:
    FeatureSelector();
    FeatureSelector(yarp::os::ResourceFinder _rf);
    bool process(cv::Ptr<cv::Feature2D> &detector, cv::Ptr<cv::Feature2D> &descriptor, cv::Ptr<cv::DescriptorMatcher> &matcher);
protected:
    int  parseMap(std::string value, std::map<std::string, int> &m);
    bool checkDetector(std::string str);//check if the method indicated in vgSLAM.ini is one of the available ones.
    bool checkDescriptor(std::string str);//check if the method indicated in vgSLAM.ini is one of the available ones.
    bool checkMatcher(std::string str, int _descID);//check if the method indicated in vgSLAM.ini is one of the available ones.
    void switcher(int detID, int descID, int matchID,
                  cv::Ptr<cv::Feature2D> &detector, cv::Ptr<cv::Feature2D> &descriptor,cv::Ptr<cv::DescriptorMatcher> &matcher);
    //given the id for the detector,descriptor and matcher, create the objects with the parameters taken from respective ini files
    int assignMethod(std::string str);//given the name of the method it returns the id specified by defines on the top.


};

#endif // FEATURESELECTOR_H<commit_msg>updated header<commit_after>/**
 * @file featureselector.h
 * @brief This class is designed to interface with the user through configuration files(.ini).
 * @detail The user can select the method for the detector,descriptor and matcher in conf/vgSLAM.ini
 * and then tune the parameters of the method in the respective ini files contained in the conf
 * folder.
 * @copyright Copyright (C) 2016 iCub Facility - Istituto Italiano di Tecnologia
 * @authors <NAME>, <NAME>
 * @email <EMAIL>, <EMAIL>
 * @date Sept 2016
 * @acknowledgement This research has received funding from the European Union’s 
 * Seventh Framework Programme for research, technological development and demonstration 
 * under grant agreement No. 611909(KoroiBot).
 * @license Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
 */

#ifndef FEATURESELECTOR_H
#define FEATURESELECTOR_H

#define    vgSLAM_KAZE    0 //det
#define    vgSLAM_FAST    1 //det
#define    vgSLAM_SIFT    2 //det & desc
#define    vgSLAM_GFTT    3 //det
#define    vgSLAM_SURF    4 //det & desc 32f
#define    vgSLAM_BRIEF   5 //desc 8U
#define    vgSLAM_ORB     6 //det & desc 8U
#define    vgSLAM_BRISK   7 //det & desc 8U
#define    vgSLAM_FREAK   8 //desc 8U
#define    vgSLAM_FLANN   9 //matcher  works with 32f desc
#define    vgSLAM_BRUTEFORCEL2   10 //matcher
#define    vgSLAM_BRUTEFORCEL1 11 //matcher
#define    vgSLAM_BRUTEFORCEHAMMING   12//matcher works with 8U desc
#define    vgSLAM_AKAZE    13 //det

#include "yarp/os/all.h"
#include "opencvs.h"
#include "cpps.h"


class FeatureSelector
{
    yarp::os::ResourceFinder rf;


public:
    FeatureSelector();
    FeatureSelector(yarp::os::ResourceFinder _rf);
    bool process(cv::Ptr<cv::Feature2D> &detector, cv::Ptr<cv::Feature2D> &descriptor, cv::Ptr<cv::DescriptorMatcher> &matcher);
protected:
    int  parseMap(std::string value, std::map<std::string, int> &m);
    bool checkDetector(std::string str);//check if the method indicated in vgSLAM.ini is one of the available ones.
    bool checkDescriptor(std::string str);//check if the method indicated in vgSLAM.ini is one of the available ones.
    bool checkMatcher(std::string str, int _descID);//check if the method indicated in vgSLAM.ini is one of the available ones.
    void switcher(int detID, int descID, int matchID,
                  cv::Ptr<cv::Feature2D> &detector, cv::Ptr<cv::Feature2D> &descriptor,cv::Ptr<cv::DescriptorMatcher> &matcher);
    //given the id for the detector,descriptor and matcher, create the objects with the parameters taken from respective ini files
    int assignMethod(std::string str);//given the name of the method it returns the id specified by defines on the top.

};

#endif // FEATURESELECTOR_H
{'fraction_non_alphanumeric': 0.09295462928808558, 'fraction_numerical': 0.018074511250461084, 'mean_word_length': 3.872416891284816, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2067882', 'n_tokens_mistral': 1829, 'n_tokens_neox': 1716, 'n_words': 608}