Ask Your Question
0

InitModule_nonFree() - unresolved externel symbol.

asked 2013-07-14 06:32:40 -0600

Hi,

I'm writing a small program that extracts descriptors from images and writes them to files.

I'm using (example) detector_descriptor_matcher_evaluation as reference.

I guess this is a very simple problem, but I just can't solve it, I'm probably missing something:

Everything compiled and worked fine (I used FAST and ORB) but I had to use sift so I added a call to cv::initModule_nonfree(); and an include :#include "opencv2/nonfree/nonfree.hpp"

but now I'm getting a linker error:
unresolved external symbol initModule_nonfree(void).

I'm quite sure all the definitions in the project properties are ok since it worked with ORB before I added the call to initModule_nonfree().

Can someone please tell me what I might be missing here and what could be the problem?

Thanks.

Also, another small question: what's the purpose of

saveloadDDM( params_filename, detector, descriptor, matcher );

in the example detector_descriptor_matcher_evaluation ?

here's the code

static void saveloadDDM( const string& params_filename,
                        Ptr<FeatureDetector>& detector,
                        Ptr<DescriptorExtractor>& descriptor,
                        Ptr<DescriptorMatcher>& matcher )
{
    FileStorage fs(params_filename, FileStorage::READ);
    if( fs.isOpened() )
    {
        detector->read(fs["detector"]);
        descriptor->read(fs["descriptor"]);
        matcher->read(fs["matcher"]);
    }
    else
    {
        fs.open(params_filename, FileStorage::WRITE);
        fs << "detector" << "{";
        detector->write(fs);
        fs << "}" << "descriptor" << "{";
        descriptor->write(fs);
        fs << "}" << "matcher" << "{";
        matcher->write(fs);
        fs << "}";
    }
}

I commented it out since it throws and exception. Is it ok not to use it?

Thanks, Gil

edit retag flag offensive close merge delete

Comments

OK, this is embarrassing. I forgot to add the lib opencv_nonfree245.lib to additional libraries.

But the second small questions still remains:)

Thanks, Gil.

GilLevi gravatar imageGilLevi ( 2013-07-14 06:38:26 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-07-15 00:28:13 -0600

updated 2013-07-15 00:34:57 -0600

The function saveloadDDM is for saving (or loading) the results. See the doc of FileStorage, which is the implementation of serialization for almost everything related or not to OpenCV. See the samples of save and load to understand the huge interest.

But is safe not using it for the purpose of the tests... It prevents from computing multiple times descriptors & keypoints for an image.

edit flag offensive delete link more

Comments

Thank you for your help!

GilLevi gravatar imageGilLevi ( 2013-07-16 11:06:38 -0600 )edit

Thank you for your help!

GilLevi gravatar imageGilLevi ( 2013-07-16 11:07:13 -0600 )edit
0

answered 2013-07-16 11:21:08 -0600

OK, this is embarrassing. I forgot to add the lib opencv_nonfree245.lib to additional libraries.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-07-14 06:32:40 -0600

Seen: 2,420 times

Last updated: Jul 16 '13