OpponentSIFT does not work as the others

asked 2014-09-25 09:49:30 -0600

thdrksdfthmn gravatar image

updated 2014-09-25 09:55:50 -0600

I am verifying a detector based on features, descriptors and matching. I have tried more, but now, when I tried OpponentSIFT, I am getting an assertion failure:

OpenCV Error: Assertion failed (!descriptorExtractor.empty()) in OpponentColorDescriptorExtractor

I am using an object that looks like this:

class MyObj
{
private:
    ConfigFile m_configFile;

    cv::Ptr< cv::FeatureDetector > m_detector;
    cv::Ptr< cv::DescriptorExtractor > m_extractor;
    cv::Ptr< cv::DescriptorMatcher > m_matcher;

public:
    /** The constructor initialize the config file member and the detector, extractor and matcher based on the values in the ConfigFile
     * 
     * @Param configFile : input ConfigFile
     */
    MyObj(const ConfigFile& configFile) : m_configFile(configFile)
    {
        // initialize the feature detector
        m_detector = cv::FeatureDetector::create(m_configFile.getFeatureDetectorType());
        if (m_detector.empty())
        {
            throw MyException("Feature detector of type " + m_configFile.getFeatureDetectorType() + " was not created!");
        }
        // initialize the descriptors exctractor
        if (!m_extractor.empty())
        {
            m_extractor.release();
        }
        m_extractor = cv::DescriptorExtractor::create(m_configFile.getDescriptorsType()); // error here
        if (m_extractor.empty())
        {
            throw MyException("Descriptors exctractor of type " + m_configFile.getDescriptorsType() + " was not created!");
        }
        // initialize the descriptors matcher
        m_matcher = cv::DescriptorMatcher::create(m_configFile.getMatcherType());
        if (m_matcher.empty())
        {
            throw MyException("Descriptors matcher of type " + m_configFile.getMatcherType() + " was not created!");
        }
    }
    ~MyObj() {}
}

I have tried it using:

  • Detector: Dense
  • Extractor: BRISK, BRIEF, FREAK, OpponentBRIEF, OpponentBRISK, OpponentFREAK, OpponentORB (all)
  • Matcher: BruteForce-SL2

Everything worked fine.

Now I am trying to use Dense, OpponentSIFT and FlannBased, and when it is trying to create the extractor, the assertion is not passed. The value from the ConfigFile is having the right value "OpponentSIFT". Can anyone help me, what is the problem here?

I have also tried OpponentSURF and it is the same... Is there a problem with them? I am using OpenCV 2.4.9, Ubuntu and Kdevelop (If the last 2 matter).

edit retag flag offensive close merge delete