src/matching2D_Student.cpp
void descKeypoints(vector<cv::KeyPoint> &keypoints, cv::Mat &img, cv::Mat &descriptors, string descriptorType, double &descTime)
{
    // select appropriate descriptor
    cv::Ptr<cv::DescriptorExtractor> extractor;
    if (descriptorType.compare("BRISK") == 0)
    {
        extractor = cv::BRISK::create();
    }
    else if (descriptorType.compare("ORB") == 0)
    {
        extractor = cv::ORB::create();   
    }
    else if (descriptorType.compare("FREAK") == 0)
    {
        extractor = cv::xfeatures2d::FREAK::create();   
    }
    else if (descriptorType.compare("AKAZE") == 0)
    {
        extractor = cv::AKAZE::create();   
    }
    else if (descriptorType.compare("SIFT") == 0)
    {
        extractor = cv::xfeatures2d::SIFT::create();
    }
    else if (descriptorType.compare("BRIEF") == 0)
    {
        extractor = cv::xfeatures2d::BriefDescriptorExtractor::create();
    }
    else
    {
        cout << "You entered wrong descriptor type" << endl;
    }

    // perform feature description
    double t = (double)cv::getTickCount();
    extractor->compute(img, keypoints, descriptors);
    t = ((double)cv::getTickCount() - t) / cv::getTickFrequency();
    cout << descriptorType << " descriptor extraction in " << 1000 * t / 1.0 << " ms" << endl; 
    descTime += t;
}
// Use one of several types of state-of-art descriptors to uniquely identify keypoints
Use one of several types of state-of-art descriptors to uniquely identify keypoints
Use one of several types of state - of - art descriptors to uniquely identify keypoints
void descKeypoints(vector<cv::KeyPoint> &keypoints, cv::Mat &img, cv::Mat &descriptors, string descriptorType, double &descTime)
{
    cv::Ptr<cv::DescriptorExtractor> extractor;
    if (descriptorType.compare("BRISK") == 0)
    {
        extractor = cv::BRISK::create();
    }
    else if (descriptorType.compare("ORB") == 0)
    {
        extractor = cv::ORB::create();   
    }
    else if (descriptorType.compare("FREAK") == 0)
    {
        extractor = cv::xfeatures2d::FREAK::create();   
    }
    else if (descriptorType.compare("AKAZE") == 0)
    {
        extractor = cv::AKAZE::create();   
    }
    else if (descriptorType.compare("SIFT") == 0)
    {
        extractor = cv::xfeatures2d::SIFT::create();
    }
    else if (descriptorType.compare("BRIEF") == 0)
    {
        extractor = cv::xfeatures2d::BriefDescriptorExtractor::create();
    }
    else
    {
        cout << "You entered wrong descriptor type" << endl;
    }
    double t = (double)cv::getTickCount();
    extractor->compute(img, keypoints, descriptors);
    t = ((double)cv::getTickCount() - t) / cv::getTickFrequency();
    cout << descriptorType << " descriptor extraction in " << 1000 * t / 1.0 << " ms" << endl; 
    descTime += t;
}
void descKeypoints ( vector < cv :: KeyPoint > & keypoints , cv :: Mat & img , cv :: Mat & descriptors , string descriptorType , double & descTime ) { cv :: Ptr < cv :: DescriptorExtractor > extractor ; if ( descriptorType . compare ( " " ) == 0 ) { extractor = cv :: BRISK :: create ( ) ; } else if ( descriptorType . compare ( " " ) == 0 ) { extractor = cv :: ORB :: create ( ) ; } else if ( descriptorType . compare ( " " ) == 0 ) { extractor = cv :: xfeatures2d :: FREAK :: create ( ) ; } else if ( descriptorType . compare ( " " ) == 0 ) { extractor = cv :: AKAZE :: create ( ) ; } else if ( descriptorType . compare ( " " ) == 0 ) { extractor = cv :: xfeatures2d :: SIFT :: create ( ) ; } else if ( descriptorType . compare ( " " ) == 0 ) { extractor = cv :: xfeatures2d :: BriefDescriptorExtractor :: create ( ) ; } else { cout << " " << endl ; } double t = ( double ) cv :: getTickCount ( ) ; extractor -> compute ( img , keypoints , descriptors ) ; t = ( ( double ) cv :: getTickCount ( ) - t ) / cv :: getTickFrequency ( ) ; cout << descriptorType << " " << 1000 * t / 1.0 << " " << endl ; descTime += t ; }
Use one of several types of state-of-art descriptors to uniquely identify keypoints
Use one of several types of state - of - art descriptors to uniquely identify keypoints
// select appropriate descriptor // perform feature description