Ask Your Question
0

How can I compile the evaluation.cpp in opencv?

asked 2016-06-02 05:11:04 -0600

lovaj gravatar image

evaluation.cpp contains an useful function for computing a detector through evaluateFeatureDetector and even computeRecallPrecisionCurve.

Any useful alternative to compute these metrics is well accepted (possibly in C++)

Anyway, it includes precomp.hpp which includes private.hpp which cannot be included and the following error is returned:

/usr/local/include/opencv2/core/private.hpp:48:4: error: #error this is a private header which should not be used from outside of the OpenCV library
 #  error this is a private header which should not be used from outside of the OpenCV library
    ^
In file included from precomp.hpp:50:0,
                 from evaluation.cpp:45,
                 from Main.cpp:1:
/usr/local/include/opencv2/core/private.hpp:58:24: fatal error: Eigen/Core: No such file or directory
compilation terminated.
In file included from precomp.hpp:50:0,
                 from evaluation.cpp:45:
/usr/local/include/opencv2/core/private.hpp:48:4: error: #error this is a private header which should not be used from outside of the OpenCV library
 #  error this is a private header which should not be used from outside of the OpenCV library
    ^
In file included from precomp.hpp:50:0,
                 from evaluation.cpp:45:
/usr/local/include/opencv2/core/private.hpp:58:24: fatal error: Eigen/Core: No such file or directory
compilation terminated.

How can I compile and use it?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-06-02 05:37:17 -0600

berak gravatar image

do not try to include the private headers, rather "steal" some stuff.

add some public includes, and the BlockRange class, like this:

#include "opencv2/features2d.hpp"
#include "opencv2/imgproc.hpp"

#include <algorithm>
#include <limits>

using namespace cv;

namespace cv {
    class BlockedRange
    {
    public:
        BlockedRange() : _begin(0), _end(0), _grainsize(0) {}
        BlockedRange(int b, int e, int g=1) : _begin(b), _end(e), _grainsize(g) {}
        int begin() const { return _begin; }
        int end() const { return _end; }
        int grainsize() const { return _grainsize; }

    protected:
        int _begin, _end, _grainsize;
    };

    template<typename Body> static inline
    void parallel_for( const BlockedRange& range, const Body& body )
    {
        body(range);
    }
    typedef std::vector<Rect> ConcurrentRectVector;

    class Split {};

    template<typename Body> static inline
    void parallel_reduce( const BlockedRange& range, Body& body )
    {
        body(range);
    }
} //namespace cv



//
// anything below goes unchanged.
//
template<typename _Tp> static int solveQuadratic(_Tp a, _Tp b, _Tp c, _Tp& x1, _Tp& x2)
{
   ....
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-06-02 05:11:04 -0600

Seen: 728 times

Last updated: Jun 02 '16