FeaturesDetector and DescriptorExtractor returns a null pointer (opencv 2.4.9) (Bug #2280)
Description
When you run the following code, cv::DescriptorExtractor::сreate
and cv::FeatureDetector::create
return a pointer to NULL, but it is not an throw exception. Library version OpenCV 2.4.9. On older versions of the library code works correctly.
Source:
1#include <iostream>
2#include <opencv2/core/core.hpp>
3#include <opencv2/features2d/features2d.hpp>
4
5int main()
6{
7 cv::Ptr<cv::FeatureDetector> detector;
8 cv::Ptr<cv::DescriptorExtractor> descriptorExtractor;
9
10 try
11 {
12 descriptorExtractor = cv::DescriptorExtractor::create("SURF");
13 if(descriptorExtractor==NULL){std::cout<<"descriptorExtractor NULL"<<std::endl;}
14 }
15 catch(...)
16 {
17 std::cout << "Can't initialize descriptor!" << std::endl;
18 return 1;
19 }
20
21 try
22 {
23 detector = cv::FeatureDetector::create("SURF");
24 if(detector==NULL){std::cout<<"detector NULL"<<std::endl;}
25 }
26 catch(...)
27 {
28 std::cout << "Can't initialize detector!" << std::endl;
29 return 1;
30 }
31}
Associated revisions
Merge pull request #2280 from ilya-lavrenov:attempt_pvc
History
Updated by Andrey Kamaev over 12 years ago
Please, read wiki formatting page and use proper syntax for code blocks.
What version you mean by "older versions"? Is it 2.3.x or 2.4.2?
- Priority changed from High to Normal
- Target version set to 2.4.3
- Description changed from When you run the following code, cv::DescriptorExtractor::Ñreate and cv::Fea... to When you run the following code, @cv::DescriptorExtractor::Ñreate@ and @cv::... More
- Assignee set to Vadim Pisarevsky
- Category set to features2d
Updated by Sergei Belousov over 12 years ago
Thanks for comment on a design.
For version 2.3.x this code works correctly.
Updated by Stefano Fabri over 12 years ago
Probably is not documented but you need to use initModule_features2d now.
Take a look here:
https://github.com/Itseez/opencv/blob/master/modules/features2d/src/features2d_init.cpp
Updated by Vadim Pisarevsky over 12 years ago
- Target version deleted (
2.4.3) - Assignee deleted (
Vadim Pisarevsky)
Updated by Daniil Osokin over 12 years ago
- Assignee set to Daniil Osokin
Updated by Daniil Osokin over 12 years ago
- Assignee deleted (
Daniil Osokin)
Updated by Kirill Kornyakov over 12 years ago
- Target version set to Next Hackathon
Updated by Vadim Pisarevsky about 12 years ago
- Assignee set to Vadim Pisarevsky
- Affected version set to branch 'master'
- Target version deleted (
Next Hackathon)
Updated by Vadim Pisarevsky about 12 years ago
- Assignee deleted (
Vadim Pisarevsky)
Updated by Alexander Smorkalov about 12 years ago
- Affected version changed from branch 'master' to 2.4.3
- Assignee set to Alexander Smorkalov
Updated by Alexander Smorkalov about 12 years ago
cv::initModule_nonfree() call before constructors fixes the problem.
- Status changed from Open to Cancelled
Updated by Kirill Kornyakov about 12 years ago
- Target version set to 2.4.4