Ask Your Question

How to use cv::ml::RTrees::getVotes()

asked 2017-11-21 03:04:46 -0500

Hi there,

I need help with the new method cv::ml::RTrees::getVotes() method introduced in version 3.3. for Random Forests.

I am using Microsoft Visual Studio 2015 for compiling. My program works very well with the methods in the previous OpenCV versions, but as soon as I include getVotes(), the following error occurs during linking process:

Error LNK2001 unresolved external symbol "public: void __cdecl cv::ml::RTrees::getVotes(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,int)const " ([email protected]@[email protected]@@[email protected][email protected]@[email protected]@[email protected])

I assume it's missing a library. However, I have included all libraries provided by OpenCV.

Does anyone have the same problem? If yes, did you find a solution?

Thank you very much

edit retag flag offensive close merge delete


how do you call it, exactly ?

do you link opencv_ml330d.lib ?

berak gravatar imageberak ( 2017-11-21 03:25:15 -0500 )edit

I call it like this: classifier->getVotes(sample, outputMat, 0) and I link it with opencv_ml330.lib (Release version)

The problem is, I'm not sure which flag to use as the 3rd argument, so I keep it zero for the time being.

edit: I also used the prebuilt binaries and linked with opencv_world331.lib (latest version), but still nothing changed.

Deltanullnull gravatar imageDeltanullnull ( 2017-11-21 04:20:32 -0500 )edit

release version

why does it complain about cv::debug_build_guard:: then ? debug project, but release lib ? that has to match !

berak gravatar imageberak ( 2017-11-21 04:31:09 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-11-22 02:28:17 -0500

Linking with Debug configuration is working! Also, when including debug libraries in the Release configuration. Thank you very much :)

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-11-21 03:04:46 -0500

Seen: 449 times

Last updated: Nov 21 '17