Merge pull request #7370 from souch55:Fixxn
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Sat, 1 Oct 2016 10:44:55 +0000 (10:44 +0000)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Sat, 1 Oct 2016 10:44:56 +0000 (10:44 +0000)
42 files changed:
1  2 
include/opencv2/opencv.hpp
modules/calib3d/include/opencv2/calib3d.hpp
modules/core/include/opencv2/core.hpp
modules/core/include/opencv2/core/base.hpp
modules/core/include/opencv2/core/core_c.h
modules/core/include/opencv2/core/cuda.hpp
modules/core/include/opencv2/core/cvdef.h
modules/core/include/opencv2/core/fast_math.hpp
modules/core/include/opencv2/core/hal/hal.hpp
modules/core/include/opencv2/core/hal/intrin_cpp.hpp
modules/core/include/opencv2/core/hal/intrin_neon.hpp
modules/core/include/opencv2/core/hal/intrin_sse.hpp
modules/core/include/opencv2/core/mat.hpp
modules/core/include/opencv2/core/mat.inl.hpp
modules/core/include/opencv2/core/persistence.hpp
modules/core/include/opencv2/core/private.cuda.hpp
modules/core/include/opencv2/core/private.hpp
modules/core/include/opencv2/core/ptr.inl.hpp
modules/core/include/opencv2/core/types.hpp
modules/core/include/opencv2/core/types_c.h
modules/core/include/opencv2/core/utility.hpp
modules/core/include/opencv2/core/version.hpp
modules/cudaarithm/include/opencv2/cudaarithm.hpp
modules/cudev/include/opencv2/cudev/functional/functional.hpp
modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp
modules/features2d/include/opencv2/features2d.hpp
modules/flann/include/opencv2/flann.hpp
modules/highgui/include/opencv2/highgui.hpp
modules/highgui/include/opencv2/highgui/highgui_c.h
modules/imgcodecs/include/opencv2/imgcodecs.hpp
modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs_c.h
modules/imgproc/include/opencv2/imgproc.hpp
modules/ml/include/opencv2/ml.hpp
modules/objdetect/include/opencv2/objdetect.hpp
modules/stitching/include/opencv2/stitching/detail/util.hpp
modules/stitching/include/opencv2/stitching/detail/warpers_inl.hpp
modules/ts/include/opencv2/ts/ocl_perf.hpp
modules/ts/include/opencv2/ts/ocl_test.hpp
modules/ts/include/opencv2/ts/ts_perf.hpp
modules/video/include/opencv2/video/tracking.hpp
modules/videoio/include/opencv2/videoio.hpp
modules/videoio/include/opencv2/videoio/videoio_c.h

  //
  //M*/
  
- #ifndef __OPENCV_ALL_HPP__
- #define __OPENCV_ALL_HPP__
+ #ifndef OPENCV_ALL_HPP
+ #define OPENCV_ALL_HPP
  
 +// File that defines what modules where included during the build of OpenCV
 +// These are purely the defines of the correct HAVE_OPENCV_modulename values
  #include "opencv2/opencv_modules.hpp"
  
 +// Then the list of defines is checked to include the correct headers
 +// Core library is always included --> without no OpenCV functionality available
  #include "opencv2/core.hpp"
 +
 +// Then the optional modules are checked
 +#ifdef HAVE_OPENCV_CALIB3D
 +#include "opencv2/calib3d.hpp"
 +#endif
 +#ifdef HAVE_OPENCV_FEATURES2D
 +#include "opencv2/features2d.hpp"
 +#endif
 +#ifdef HAVE_OPENCV_FLANN
 +#include "opencv2/flann.hpp"
 +#endif
 +#ifdef HAVE_OPENCV_HIGHGUI
 +#include "opencv2/highgui.hpp"
 +#endif
 +#ifdef HAVE_OPENCV_IMGCODECS
 +#include "opencv2/imgcodecs.hpp"
 +#endif
  #ifdef HAVE_OPENCV_IMGPROC
  #include "opencv2/imgproc.hpp"
  #endif
Simple merge
@@@ -1261,4 -1253,4 +1261,4 @@@ CV_EXPORTS void cvWriteMatND_Base64(::C
  
  } // cv
  
- #endif // __OPENCV_CORE_PERSISTENCE_HPP__
 -#endif // OPENCV_CORE_PERSISTENCE_HPP
++#endif // OPENCV_CORE_PERSISTENCE_HPP
@@@ -438,139 -432,6 +438,139 @@@ CV_EXPORTS void setUseTegra(bool flag)
  }
  #endif
  
 +#ifdef ENABLE_INSTRUMENTATION
 +namespace cv
 +{
 +namespace instr
 +{
 +struct InstrTLSStruct
 +{
 +    InstrTLSStruct()
 +    {
 +        pCurrentNode = NULL;
 +    }
 +    InstrNode* pCurrentNode;
 +};
 +
 +class InstrStruct
 +{
 +public:
 +    InstrStruct()
 +    {
 +        useInstr         = false;
 +        enableMapping    = true;
 +
 +        rootNode.m_payload = NodeData("ROOT", NULL, 0, TYPE_GENERAL, IMPL_PLAIN);
 +        tlsStruct.get()->pCurrentNode = &rootNode;
 +    }
 +
 +    Mutex mutexCreate;
 +    Mutex mutexCount;
 +
 +    bool       useInstr;
 +    bool       enableMapping;
 +    InstrNode  rootNode;
 +    TLSData<InstrTLSStruct> tlsStruct;
 +};
 +
 +class CV_EXPORTS IntrumentationRegion
 +{
 +public:
 +    IntrumentationRegion(const char* funName, const char* fileName, int lineNum, TYPE instrType = TYPE_GENERAL, IMPL implType = IMPL_PLAIN);
 +    ~IntrumentationRegion();
 +
 +private:
 +    bool    m_disabled; // region status
 +    uint64  m_regionTicks;
 +};
 +
 +InstrStruct&    getInstrumentStruct();
 +InstrTLSStruct& getInstrumentTLSStruct();
 +CV_EXPORTS InstrNode* getCurrentNode();
 +}
 +}
 +
 +///// General instrumentation
 +// Instrument region
 +#define CV_INSTRUMENT_REGION_META(NAME, TYPE, IMPL)      ::cv::instr::IntrumentationRegion __instr_region__(NAME, __FILE__, __LINE__, TYPE, IMPL);
 +// Instrument functions with non-void return type
 +#define CV_INSTRUMENT_FUN_RT_META(TYPE, IMPL, ERROR_COND, FUN, ...) ([&]()\
 +{\
 +    if(::cv::instr::useInstrumentation()){\
 +        ::cv::instr::IntrumentationRegion __instr__(#FUN, __FILE__, __LINE__, TYPE, IMPL);\
 +        try{\
 +            auto status = ((FUN)(__VA_ARGS__));\
 +            if(ERROR_COND){\
 +                ::cv::instr::getCurrentNode()->m_payload.m_funError = true;\
 +                CV_INSTRUMENT_MARK_META(IMPL, #FUN " - BadExit");\
 +            }\
 +            return status;\
 +        }catch(...){\
 +            ::cv::instr::getCurrentNode()->m_payload.m_funError = true;\
 +            CV_INSTRUMENT_MARK_META(IMPL, #FUN " - BadExit");\
 +            throw;\
 +        }\
 +    }else{\
 +        return ((FUN)(__VA_ARGS__));\
 +    }\
 +}())
 +// Instrument functions with void return type
 +#define CV_INSTRUMENT_FUN_RV_META(TYPE, IMPL, FUN, ...) ([&]()\
 +{\
 +    if(::cv::instr::useInstrumentation()){\
 +        ::cv::instr::IntrumentationRegion __instr__(#FUN, __FILE__, __LINE__, TYPE, IMPL);\
 +        try{\
 +            (FUN)(__VA_ARGS__);\
 +        }catch(...){\
 +            ::cv::instr::getCurrentNode()->m_payload.m_funError = true;\
 +            CV_INSTRUMENT_MARK_META(IMPL, #FUN "- BadExit");\
 +            throw;\
 +        }\
 +    }else{\
 +        (FUN)(__VA_ARGS__);\
 +    }\
 +}())
 +// Instrumentation information marker
 +#define CV_INSTRUMENT_MARK_META(IMPL, NAME, ...) {::cv::instr::IntrumentationRegion __instr_mark__(NAME, __FILE__, __LINE__, ::cv::instr::TYPE_MARKER, IMPL);}
 +
 +///// General instrumentation
 +// General OpenCV region instrumentation macro
 +#define CV_INSTRUMENT_REGION()              CV_INSTRUMENT_REGION_META(__FUNCTION__, cv::instr::TYPE_GENERAL, cv::instr::IMPL_PLAIN)
 +// Parallel OpenCV region instrumentation macro
 +#define CV_INSTRUMENT_REGION_MT()           CV_INSTRUMENT_REGION_MT_META(cv::instr::TYPE_GENERAL, cv::instr::IMPL_PLAIN)
 +
 +///// IPP instrumentation
 +// Wrapper region instrumentation macro
 +#define CV_INSTRUMENT_REGION_IPP()          CV_INSTRUMENT_REGION_META(__FUNCTION__, ::cv::instr::TYPE_WRAPPER, ::cv::instr::IMPL_IPP)
 +// Function instrumentation macro
 +#define CV_INSTRUMENT_FUN_IPP(FUN, ...)     CV_INSTRUMENT_FUN_RT_META(::cv::instr::TYPE_FUN, ::cv::instr::IMPL_IPP, status < 0, FUN, __VA_ARGS__)
 +// Diagnostic markers
 +#define CV_INSTRUMENT_MARK_IPP(NAME)        CV_INSTRUMENT_MARK_META(::cv::instr::IMPL_IPP, NAME)
 +
 +///// OpenCL instrumentation
 +// Wrapper region instrumentation macro
 +#define CV_INSTRUMENT_REGION_OPENCL()              CV_INSTRUMENT_REGION_META(__FUNCTION__, ::cv::instr::TYPE_WRAPPER, ::cv::instr::IMPL_OPENCL)
 +#define CV_INSTRUMENT_REGION_OPENCL_(NAME)         CV_INSTRUMENT_REGION_META(NAME, ::cv::instr::TYPE_WRAPPER, ::cv::instr::IMPL_OPENCL)
 +// Function instrumentation macro
 +#define CV_INSTRUMENT_FUN_OPENCL_KERNEL(FUN, ...)  CV_INSTRUMENT_FUN_RT_META(::cv::instr::TYPE_FUN, ::cv::instr::IMPL_OPENCL, status == 0, FUN, __VA_ARGS__)
 +// Diagnostic markers
 +#define CV_INSTRUMENT_MARK_OPENCL(NAME)            CV_INSTRUMENT_MARK_META(::cv::instr::IMPL_OPENCL, NAME)
 +#else
 +#define CV_INSTRUMENT_REGION_META(...)
 +
 +#define CV_INSTRUMENT_REGION()
 +#define CV_INSTRUMENT_REGION_MT()
 +
 +#define CV_INSTRUMENT_REGION_IPP()
 +#define CV_INSTRUMENT_FUN_IPP(FUN, ...) ((FUN)(__VA_ARGS__))
 +#define CV_INSTRUMENT_MARK_IPP(NAME)
 +
 +#define CV_INSTRUMENT_REGION_OPENCL()
 +#define CV_INSTRUMENT_REGION_OPENCL_(...)
 +#define CV_INSTRUMENT_FUN_OPENCL_KERNEL(FUN, ...) ((FUN)(__VA_ARGS__))
 +#define CV_INSTRUMENT_MARK_OPENCL(NAME)
 +#endif
 +
  //! @endcond
  
- #endif // __OPENCV_CORE_PRIVATE_HPP__
+ #endif // OPENCV_CORE_PRIVATE_HPP
  //
  //M*/
  
- #ifndef __OPENCV_HIGHGUI_HPP__
- #define __OPENCV_HIGHGUI_HPP__
+ #ifndef OPENCV_HIGHGUI_HPP
+ #define OPENCV_HIGHGUI_HPP
  
  #include "opencv2/core.hpp"
 +#ifdef HAVE_OPENCV_IMGCODECS
  #include "opencv2/imgcodecs.hpp"
 +#endif
 +#ifdef HAVE_OPENCV_VIDEOIO
  #include "opencv2/videoio.hpp"
 +#endif
  
  /**
  @defgroup highgui High-level GUI
Simple merge