Ask Your Question
0

cv::Algorithm Errors [closed]

asked 2017-04-12 15:10:55 -0600

rbfigueira gravatar image

Hi,

I have this errors on cv::Algorithm - Expected '(' for function-style cast or type construction - No member named 'create' in 'cv::Algorithm')

Here is the code:

//Initialise detector, descriptor, matcher
detector = cv::Algorithm::create<cv::FeatureDetector>(detectorType.c_str());
descriptorExtractor = cv::Algorithm::create<cv::DescriptorExtractor>(descriptorType.c_str());
descriptorMatcher = cv::DescriptorMatcher::create(matcherType.c_str());
std::vector<cv::String> list;
cv::Algorithm::getList(list);

Showing All Errors:

detector = cv::Algorithm::create<cv::FeatureDetector>(detectorType.c_str());

Expected '(' for function-style cast or type construction No member named 'create' in 'cv::Algorithm'

descriptorExtractor = cv::Algorithm::create<cv::DescriptorExtractor>(descriptorType.c_str());

Expected '(' for function-style cast or type construction No member named 'create' in 'cv::Algorithm'

cv::Algorithm::getList(list);

No type named 'getList' in 'cv::Algorithm'

What I have to do ? Many Thanks

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by rbfigueira
close date 2017-04-15 08:39:53.521214

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-04-13 02:21:37 -0600

berak gravatar image

looks like you try to run opencv2.4 code with opencv3.

the api has changed slightly, all Algorithm::create(some_string) functions are gone.

please have a look at the feature2d tutorials for working examples.

edit flag offensive delete link more

Comments

Yes you are right. I am using opencv-3.2.0. Do you know any simple the work around ? Many Thanks!

rbfigueira gravatar imagerbfigueira ( 2017-04-13 02:29:32 -0600 )edit

again, have a look at the matching tutorial , and update your code.

berak gravatar imageberak ( 2017-04-13 02:37:12 -0600 )edit

Hi berak I saw all the tutorials from that link and I didn't find any with the Algorithm class. Sorry but I am newbie on openCV ... can you please simple convert one of them to know what I have to do ? thanks

rbfigueira gravatar imagerbfigueira ( 2017-04-13 03:23:52 -0600 )edit
1

the Algorithm class is no more used here, and trying to convert the code does not make any sense.

start with the tutorials, please.

berak gravatar imageberak ( 2017-04-13 03:30:26 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-04-12 15:10:55 -0600

Seen: 401 times

Last updated: Apr 13 '17