Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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)
{
   ....