Ask Your Question
0

including own function instead of interrior opencv function

asked 2013-08-20 12:44:11 -0600

hesam gravatar image

I want to use FREAK(an opencv key-point descriptor), generally speaking, a source file which exist in opencv or vc++, on the other hand i need to include the same header file to use the other functions, and when i use that source file i get "ambiguity error" how can i select to use that function from my current directory instead of interior function? thank you so much for your help

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
2

answered 2013-08-20 13:15:17 -0600

berak gravatar image

namespaces míght help:

// myfreak.h

#include "opencv/features2d/features2d.hpp"

namespace my {
    struct FREAK {
         ...
    };
}

// myfreak.cpp

#include "opencv/highgui/highgui.hpp"
#include "freak.h"
namespace my {
    // FREAK impl
}

// main.cpp

#include "opencv/highgui/highgui.hpp"
#include "freak.h"

int main() {
   my::FREAK;
   cv::SURF;
}
edit flag offensive delete link more

Comments

I did what you said(except renaming my freak.h and .cpp to myfreak.h), but i got this error:

object of abstract class type "mycv::FREAK"is not allowed thank you

hesam gravatar imagehesam ( 2013-08-21 01:55:58 -0600 )edit

hard to say why, but it sounds, as if you're using mycv::FREAK before it is actually implemented (abstract class seems to hint at that)

berak gravatar imageberak ( 2013-08-21 02:00:03 -0600 )edit

Question Tools

Stats

Asked: 2013-08-20 12:44:11 -0600

Seen: 187 times

Last updated: Aug 20 '13