mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 03:00:14 +08:00
Move non-CV functionality from core.hpp to separate utility.hpp header
This commit is contained in:
parent
1ad7af3c3b
commit
89356ff16d
@ -44,6 +44,7 @@
|
||||
#define __SFT_COMMON_HPP__
|
||||
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include <opencv2/softcascade.hpp>
|
||||
|
||||
namespace cv {using namespace softcascade;}
|
||||
|
@ -62,6 +62,7 @@
|
||||
|
||||
#include "opencv2/core/core_c.h"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/video.hpp"
|
||||
|
@ -49,8 +49,11 @@
|
||||
#include "opencv2/calib3d.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
#include "opencv2/features2d.hpp"
|
||||
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
#ifdef HAVE_TEGRA_OPTIMIZATION
|
||||
|
@ -9,12 +9,12 @@
|
||||
#ifndef __OPENCV_TEST_PRECOMP_HPP__
|
||||
#define __OPENCV_TEST_PRECOMP_HPP__
|
||||
|
||||
#include <iostream>
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/calib3d.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
|
||||
namespace cvtest
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID)
|
||||
#include "opencv2/contrib/detection_based_tracker.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
|
@ -52,6 +52,8 @@
|
||||
#include "opencv2/objdetect.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
|
||||
namespace cv
|
||||
|
@ -101,13 +101,6 @@ template<typename _Tp> class CV_EXPORTS MatIterator_;
|
||||
template<typename _Tp> class CV_EXPORTS MatConstIterator_;
|
||||
template<typename _Tp> class CV_EXPORTS MatCommaInitializer_;
|
||||
|
||||
template<typename _Tp, size_t fixed_size = 1024/sizeof(_Tp)+8> class CV_EXPORTS AutoBuffer;
|
||||
|
||||
CV_EXPORTS std::string format( const char* fmt, ... );
|
||||
CV_EXPORTS std::string tempfile( const char* suffix CV_DEFAULT(0));
|
||||
|
||||
CV_EXPORTS void glob(std::string pattern, std::vector<std::string>& result, bool recursive = false);
|
||||
|
||||
// matrix decomposition types
|
||||
enum { DECOMP_LU=0, DECOMP_SVD=1, DECOMP_EIG=2, DECOMP_CHOLESKY=3, DECOMP_QR=4, DECOMP_NORMAL=16 };
|
||||
enum { NORM_INF=1, NORM_L1=2, NORM_L2=4, NORM_L2SQR=5, NORM_HAMMING=6, NORM_HAMMING2=7, NORM_TYPE_MASK=7, NORM_RELATIVE=8, NORM_MINMAX=32 };
|
||||
@ -162,34 +155,6 @@ public:
|
||||
*/
|
||||
CV_EXPORTS void error( const Exception& exc );
|
||||
|
||||
//! Sets/resets the break-on-error mode.
|
||||
|
||||
/*!
|
||||
When the break-on-error mode is set, the default error handler
|
||||
issues a hardware exception, which can make debugging more convenient.
|
||||
|
||||
\return the previous state
|
||||
*/
|
||||
CV_EXPORTS bool setBreakOnError(bool flag);
|
||||
|
||||
typedef int (CV_CDECL *ErrorCallback)( int status, const char* func_name,
|
||||
const char* err_msg, const char* file_name,
|
||||
int line, void* userdata );
|
||||
|
||||
//! Sets the new error handler and the optional user data.
|
||||
|
||||
/*!
|
||||
The function sets the new error handler, called from cv::error().
|
||||
|
||||
\param errCallback the new error handler. If NULL, the default error handler is used.
|
||||
\param userdata the optional user data pointer, passed to the callback.
|
||||
\param prevUserdata the optional output parameter where the previous user data pointer is stored
|
||||
|
||||
\return the previous error handler
|
||||
*/
|
||||
CV_EXPORTS ErrorCallback redirectError( ErrorCallback errCallback,
|
||||
void* userdata=0, void** prevUserdata=0);
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define CV_Error( code, msg ) cv::error( cv::Exception(code, msg, __func__, __FILE__, __LINE__) )
|
||||
#define CV_Error_( code, args ) cv::error( cv::Exception(code, cv::format args, __func__, __FILE__, __LINE__) )
|
||||
@ -206,70 +171,6 @@ CV_EXPORTS ErrorCallback redirectError( ErrorCallback errCallback,
|
||||
#define CV_DbgAssert(expr)
|
||||
#endif
|
||||
|
||||
CV_EXPORTS void setNumThreads(int nthreads);
|
||||
CV_EXPORTS int getNumThreads();
|
||||
CV_EXPORTS int getThreadNum();
|
||||
|
||||
CV_EXPORTS_W const std::string& getBuildInformation();
|
||||
|
||||
//! Returns the number of ticks.
|
||||
|
||||
/*!
|
||||
The function returns the number of ticks since the certain event (e.g. when the machine was turned on).
|
||||
It can be used to initialize cv::RNG or to measure a function execution time by reading the tick count
|
||||
before and after the function call. The granularity of ticks depends on the hardware and OS used. Use
|
||||
cv::getTickFrequency() to convert ticks to seconds.
|
||||
*/
|
||||
CV_EXPORTS_W int64 getTickCount();
|
||||
|
||||
/*!
|
||||
Returns the number of ticks per seconds.
|
||||
|
||||
The function returns the number of ticks (as returned by cv::getTickCount()) per second.
|
||||
The following code computes the execution time in milliseconds:
|
||||
|
||||
\code
|
||||
double exec_time = (double)getTickCount();
|
||||
// do something ...
|
||||
exec_time = ((double)getTickCount() - exec_time)*1000./getTickFrequency();
|
||||
\endcode
|
||||
*/
|
||||
CV_EXPORTS_W double getTickFrequency();
|
||||
|
||||
/*!
|
||||
Returns the number of CPU ticks.
|
||||
|
||||
On platforms where the feature is available, the function returns the number of CPU ticks
|
||||
since the certain event (normally, the system power-on moment). Using this function
|
||||
one can accurately measure the execution time of very small code fragments,
|
||||
for which cv::getTickCount() granularity is not enough.
|
||||
*/
|
||||
CV_EXPORTS_W int64 getCPUTickCount();
|
||||
|
||||
/*!
|
||||
Returns SSE etc. support status
|
||||
|
||||
The function returns true if certain hardware features are available.
|
||||
Currently, the following features are recognized:
|
||||
- CV_CPU_MMX - MMX
|
||||
- CV_CPU_SSE - SSE
|
||||
- CV_CPU_SSE2 - SSE 2
|
||||
- CV_CPU_SSE3 - SSE 3
|
||||
- CV_CPU_SSSE3 - SSSE 3
|
||||
- CV_CPU_SSE4_1 - SSE 4.1
|
||||
- CV_CPU_SSE4_2 - SSE 4.2
|
||||
- CV_CPU_POPCNT - POPCOUNT
|
||||
- CV_CPU_AVX - AVX
|
||||
|
||||
\note {Note that the function output is not static. Once you called cv::useOptimized(false),
|
||||
most of the hardware acceleration is disabled and thus the function will returns false,
|
||||
until you call cv::useOptimized(true)}
|
||||
*/
|
||||
CV_EXPORTS_W bool checkHardwareSupport(int feature);
|
||||
|
||||
//! returns the number of CPUs (including hyper-threading)
|
||||
CV_EXPORTS_W int getNumberOfCPUs();
|
||||
|
||||
/*!
|
||||
Allocates memory buffer
|
||||
|
||||
@ -300,45 +201,6 @@ template<typename _Tp> static inline void deallocate(_Tp* ptr, size_t)
|
||||
delete[] ptr;
|
||||
}
|
||||
|
||||
/*!
|
||||
Aligns pointer by the certain number of bytes
|
||||
|
||||
This small inline function aligns the pointer by the certian number of bytes by shifting
|
||||
it forward by 0 or a positive offset.
|
||||
*/
|
||||
template<typename _Tp> static inline _Tp* alignPtr(_Tp* ptr, int n=(int)sizeof(_Tp))
|
||||
{
|
||||
return (_Tp*)(((size_t)ptr + n-1) & -n);
|
||||
}
|
||||
|
||||
/*!
|
||||
Aligns buffer size by the certain number of bytes
|
||||
|
||||
This small inline function aligns a buffer size by the certian number of bytes by enlarging it.
|
||||
*/
|
||||
static inline size_t alignSize(size_t sz, int n)
|
||||
{
|
||||
return (sz + n-1) & -n;
|
||||
}
|
||||
|
||||
/*!
|
||||
Turns on/off available optimization
|
||||
|
||||
The function turns on or off the optimized code in OpenCV. Some optimization can not be enabled
|
||||
or disabled, but, for example, most of SSE code in OpenCV can be temporarily turned on or off this way.
|
||||
|
||||
\note{Since optimization may imply using special data structures, it may be unsafe
|
||||
to call this function anywhere in the code. Instead, call it somewhere at the top level.}
|
||||
*/
|
||||
CV_EXPORTS_W void setUseOptimized(bool onoff);
|
||||
|
||||
/*!
|
||||
Returns the current optimization status
|
||||
|
||||
The function returns the current optimization status, which is controlled by cv::setUseOptimized().
|
||||
*/
|
||||
CV_EXPORTS_W bool useOptimized();
|
||||
|
||||
/*!
|
||||
The STL-compilant memory Allocator based on cv::fastMalloc() and cv::fastFree()
|
||||
*/
|
||||
@ -1421,8 +1283,6 @@ CV_EXPORTS OutputArray noArray();
|
||||
|
||||
enum { MAGIC_MASK=0xFFFF0000, TYPE_MASK=0x00000FFF, DEPTH_MASK=7 };
|
||||
|
||||
static inline size_t getElemSize(int type) { return CV_ELEM_SIZE(type); }
|
||||
|
||||
/*!
|
||||
Custom array allocator
|
||||
|
||||
@ -2084,10 +1944,6 @@ CV_EXPORTS BinaryFunc getCopyMaskFunc(size_t esz);
|
||||
//! swaps two matrices
|
||||
CV_EXPORTS void swap(Mat& a, Mat& b);
|
||||
|
||||
//! converts array (CvMat or IplImage) to cv::Mat
|
||||
CV_EXPORTS Mat cvarrToMat(const CvArr* arr, bool copyData=false,
|
||||
bool allowND=true, int coiMode=0,
|
||||
AutoBuffer<double>* buf=0);
|
||||
//! extracts Channel of Interest from CvMat or IplImage and makes cv::Mat out of it.
|
||||
CV_EXPORTS void extractImageCOI(const CvArr* arr, OutputArray coiimg, int coi=-1);
|
||||
//! inserts single-channel cv::Mat into a multi-channel CvMat or IplImage
|
||||
@ -3088,73 +2944,6 @@ public:
|
||||
Vec<_Tp, m> operator *() const;
|
||||
};
|
||||
|
||||
/*!
|
||||
Automatically Allocated Buffer Class
|
||||
|
||||
The class is used for temporary buffers in functions and methods.
|
||||
If a temporary buffer is usually small (a few K's of memory),
|
||||
but its size depends on the parameters, it makes sense to create a small
|
||||
fixed-size array on stack and use it if it's large enough. If the required buffer size
|
||||
is larger than the fixed size, another buffer of sufficient size is allocated dynamically
|
||||
and released after the processing. Therefore, in typical cases, when the buffer size is small,
|
||||
there is no overhead associated with malloc()/free().
|
||||
At the same time, there is no limit on the size of processed data.
|
||||
|
||||
This is what AutoBuffer does. The template takes 2 parameters - type of the buffer elements and
|
||||
the number of stack-allocated elements. Here is how the class is used:
|
||||
|
||||
\code
|
||||
void my_func(const cv::Mat& m)
|
||||
{
|
||||
cv::AutoBuffer<float> buf; // create automatic buffer containing 1000 floats
|
||||
|
||||
buf.allocate(m.rows); // if m.rows <= 1000, the pre-allocated buffer is used,
|
||||
// otherwise the buffer of "m.rows" floats will be allocated
|
||||
// dynamically and deallocated in cv::AutoBuffer destructor
|
||||
...
|
||||
}
|
||||
\endcode
|
||||
*/
|
||||
template<typename _Tp, size_t fixed_size> class CV_EXPORTS AutoBuffer
|
||||
{
|
||||
public:
|
||||
typedef _Tp value_type;
|
||||
|
||||
//! the default contructor
|
||||
AutoBuffer();
|
||||
//! constructor taking the real buffer size
|
||||
AutoBuffer(size_t _size);
|
||||
|
||||
//! the copy constructor
|
||||
AutoBuffer(const AutoBuffer<_Tp, fixed_size>& buf);
|
||||
//! the assignment operator
|
||||
AutoBuffer<_Tp, fixed_size>& operator = (const AutoBuffer<_Tp, fixed_size>& buf);
|
||||
|
||||
//! destructor. calls deallocate()
|
||||
~AutoBuffer();
|
||||
|
||||
//! allocates the new buffer of size _size. if the _size is small enough, stack-allocated buffer is used
|
||||
void allocate(size_t _size);
|
||||
//! deallocates the buffer if it was dynamically allocated
|
||||
void deallocate();
|
||||
//! resizes the buffer and preserves the content
|
||||
void resize(size_t _size);
|
||||
//! returns the current buffer size
|
||||
size_t size() const;
|
||||
//! returns pointer to the real buffer, stack-allocated or head-allocated
|
||||
operator _Tp* ();
|
||||
//! returns read-only pointer to the real buffer, stack-allocated or head-allocated
|
||||
operator const _Tp* () const;
|
||||
|
||||
protected:
|
||||
//! pointer to the real buffer, can point to buf if the buffer is small enough
|
||||
_Tp* ptr;
|
||||
//! size of the real buffer
|
||||
size_t sz;
|
||||
//! pre-allocated buffer
|
||||
_Tp buf[fixed_size];
|
||||
};
|
||||
|
||||
/////////////////////////// multi-dimensional dense matrix //////////////////////////
|
||||
|
||||
/*!
|
||||
@ -4628,91 +4417,7 @@ template<> struct ParamType<uchar>
|
||||
enum { type = Param::UCHAR };
|
||||
};
|
||||
|
||||
// The CommandLineParser class is designed for command line arguments parsing
|
||||
|
||||
class CV_EXPORTS CommandLineParser
|
||||
{
|
||||
public:
|
||||
CommandLineParser(int argc, const char* const argv[], const std::string& keys);
|
||||
CommandLineParser(const CommandLineParser& parser);
|
||||
CommandLineParser& operator = (const CommandLineParser& parser);
|
||||
|
||||
std::string getPathToApplication() const;
|
||||
|
||||
template <typename T>
|
||||
T get(const std::string& name, bool space_delete = true) const
|
||||
{
|
||||
T val = T();
|
||||
getByName(name, space_delete, ParamType<T>::type, (void*)&val);
|
||||
return val;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T get(int index, bool space_delete = true) const
|
||||
{
|
||||
T val = T();
|
||||
getByIndex(index, space_delete, ParamType<T>::type, (void*)&val);
|
||||
return val;
|
||||
}
|
||||
|
||||
bool has(const std::string& name) const;
|
||||
|
||||
bool check() const;
|
||||
|
||||
void about(const std::string& message);
|
||||
|
||||
void printMessage() const;
|
||||
void printErrors() const;
|
||||
|
||||
protected:
|
||||
void getByName(const std::string& name, bool space_delete, int type, void* dst) const;
|
||||
void getByIndex(int index, bool space_delete, int type, void* dst) const;
|
||||
|
||||
struct Impl;
|
||||
Impl* impl;
|
||||
};
|
||||
|
||||
/////////////////////////////// Parallel Primitives //////////////////////////////////
|
||||
|
||||
// a base body class
|
||||
class CV_EXPORTS ParallelLoopBody
|
||||
{
|
||||
public:
|
||||
virtual ~ParallelLoopBody();
|
||||
virtual void operator() (const Range& range) const = 0;
|
||||
};
|
||||
|
||||
CV_EXPORTS void parallel_for_(const Range& range, const ParallelLoopBody& body, double nstripes=-1.);
|
||||
|
||||
/////////////////////////// Synchronization Primitives ///////////////////////////////
|
||||
|
||||
class CV_EXPORTS Mutex
|
||||
{
|
||||
public:
|
||||
Mutex();
|
||||
~Mutex();
|
||||
Mutex(const Mutex& m);
|
||||
Mutex& operator = (const Mutex& m);
|
||||
|
||||
void lock();
|
||||
bool trylock();
|
||||
void unlock();
|
||||
|
||||
struct Impl;
|
||||
protected:
|
||||
Impl* impl;
|
||||
};
|
||||
|
||||
class CV_EXPORTS AutoLock
|
||||
{
|
||||
public:
|
||||
AutoLock(Mutex& m) : mutex(&m) { mutex->lock(); }
|
||||
~AutoLock() { mutex->unlock(); }
|
||||
protected:
|
||||
Mutex* mutex;
|
||||
};
|
||||
|
||||
}
|
||||
} //namespace cv
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
|
@ -1696,18 +1696,6 @@ CVAPI(double) cvGetTickFrequency( void );
|
||||
|
||||
/*********************************** CPU capabilities ***********************************/
|
||||
|
||||
#define CV_CPU_NONE 0
|
||||
#define CV_CPU_MMX 1
|
||||
#define CV_CPU_SSE 2
|
||||
#define CV_CPU_SSE2 3
|
||||
#define CV_CPU_SSE3 4
|
||||
#define CV_CPU_SSSE3 5
|
||||
#define CV_CPU_SSE4_1 6
|
||||
#define CV_CPU_SSE4_2 7
|
||||
#define CV_CPU_POPCNT 8
|
||||
#define CV_CPU_AVX 10
|
||||
#define CV_HARDWARE_MAX_FEATURE 255
|
||||
|
||||
CVAPI(int) cvCheckHardwareSupport(int feature);
|
||||
|
||||
/*********************************** Multi-Threading ************************************/
|
||||
|
@ -97,7 +97,20 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* intrinsics support */
|
||||
/* CPU features and intrinsics support */
|
||||
#define CV_CPU_NONE 0
|
||||
#define CV_CPU_MMX 1
|
||||
#define CV_CPU_SSE 2
|
||||
#define CV_CPU_SSE2 3
|
||||
#define CV_CPU_SSE3 4
|
||||
#define CV_CPU_SSSE3 5
|
||||
#define CV_CPU_SSE4_1 6
|
||||
#define CV_CPU_SSE4_2 7
|
||||
#define CV_CPU_POPCNT 8
|
||||
#define CV_CPU_AVX 10
|
||||
#define CV_CPU_NEON 11
|
||||
#define CV_HARDWARE_MAX_FEATURE 255
|
||||
|
||||
#if defined __SSE2__ || defined _M_X64 || (defined _M_IX86_FP && _M_IX86_FP >= 2)
|
||||
# include "emmintrin.h"
|
||||
# define CV_SSE 1
|
||||
@ -421,4 +434,4 @@ CV_INLINE int cvIsInf( double value )
|
||||
CV_INLINE CV_XADD(int* addr, int delta) { int tmp = *addr; *addr += delta; return tmp; }
|
||||
#endif
|
||||
|
||||
#endif // __OPENCV_CORE_CVDEF_H__
|
||||
#endif // __OPENCV_CORE_CVDEF_H__
|
||||
|
@ -748,11 +748,6 @@ inline Mat::MStep& Mat::MStep::operator = (size_t s)
|
||||
return *this;
|
||||
}
|
||||
|
||||
static inline Mat cvarrToMatND(const CvArr* arr, bool copyData=false, int coiMode=0)
|
||||
{
|
||||
return cvarrToMat(arr, copyData, true, coiMode);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////// SVD //////////////////////////////////////////////////////
|
||||
|
||||
inline SVD::SVD() {}
|
||||
|
@ -2482,114 +2482,6 @@ inline Point LineIterator::pos() const
|
||||
return p;
|
||||
}
|
||||
|
||||
/////////////////////////////// AutoBuffer ////////////////////////////////////////
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline
|
||||
AutoBuffer<_Tp, fixed_size>::AutoBuffer()
|
||||
{
|
||||
ptr = buf;
|
||||
sz = fixed_size;
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline
|
||||
AutoBuffer<_Tp, fixed_size>::AutoBuffer(size_t _size)
|
||||
{
|
||||
ptr = buf;
|
||||
sz = fixed_size;
|
||||
allocate(_size);
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline
|
||||
AutoBuffer<_Tp, fixed_size>::AutoBuffer(const AutoBuffer<_Tp, fixed_size>& abuf )
|
||||
{
|
||||
ptr = buf;
|
||||
sz = fixed_size;
|
||||
allocate(abuf.size);
|
||||
for( size_t i = 0; i < sz; i++ )
|
||||
ptr[i] = abuf.ptr[i];
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline AutoBuffer<_Tp, fixed_size>&
|
||||
AutoBuffer<_Tp, fixed_size>::operator = (const AutoBuffer<_Tp, fixed_size>& abuf)
|
||||
{
|
||||
if( this != &abuf )
|
||||
{
|
||||
deallocate();
|
||||
allocate(abuf.size);
|
||||
for( size_t i = 0; i < sz; i++ )
|
||||
ptr[i] = abuf.ptr[i];
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline
|
||||
AutoBuffer<_Tp, fixed_size>::~AutoBuffer()
|
||||
{ deallocate(); }
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline void
|
||||
AutoBuffer<_Tp, fixed_size>::allocate(size_t _size)
|
||||
{
|
||||
if(_size <= sz)
|
||||
{
|
||||
sz = _size;
|
||||
return;
|
||||
}
|
||||
deallocate();
|
||||
if(_size > fixed_size)
|
||||
{
|
||||
ptr = new _Tp[_size];
|
||||
sz = _size;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline void
|
||||
AutoBuffer<_Tp, fixed_size>::deallocate()
|
||||
{
|
||||
if( ptr != buf )
|
||||
{
|
||||
delete[] ptr;
|
||||
ptr = buf;
|
||||
sz = fixed_size;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline void
|
||||
AutoBuffer<_Tp, fixed_size>::resize(size_t _size)
|
||||
{
|
||||
if(_size <= sz)
|
||||
{
|
||||
sz = _size;
|
||||
return;
|
||||
}
|
||||
size_t i, prevsize = sz, minsize = MIN(prevsize, _size);
|
||||
_Tp* prevptr = ptr;
|
||||
|
||||
ptr = _size > fixed_size ? new _Tp[_size] : buf;
|
||||
sz = _size;
|
||||
|
||||
if( ptr != prevptr )
|
||||
for( i = 0; i < minsize; i++ )
|
||||
ptr[i] = prevptr[i];
|
||||
for( i = prevsize; i < _size; i++ )
|
||||
ptr[i] = _Tp();
|
||||
|
||||
if( prevptr != buf )
|
||||
delete[] prevptr;
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline size_t
|
||||
AutoBuffer<_Tp, fixed_size>::size() const
|
||||
{ return sz; }
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline
|
||||
AutoBuffer<_Tp, fixed_size>::operator _Tp* ()
|
||||
{ return ptr; }
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline
|
||||
AutoBuffer<_Tp, fixed_size>::operator const _Tp* () const
|
||||
{ return ptr; }
|
||||
|
||||
|
||||
/////////////////////////////////// Ptr ////////////////////////////////////////
|
||||
|
||||
template<typename _Tp> inline Ptr<_Tp>::Ptr() : obj(0), refcount(0) {}
|
||||
|
459
modules/core/include/opencv2/core/utility.hpp
Normal file
459
modules/core/include/opencv2/core/utility.hpp
Normal file
@ -0,0 +1,459 @@
|
||||
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||
//
|
||||
// By downloading, copying, installing or using the software you agree to this license.
|
||||
// If you do not agree to this license, do not download, install,
|
||||
// copy or use the software.
|
||||
//
|
||||
//
|
||||
// License Agreement
|
||||
// For Open Source Computer Vision Library
|
||||
//
|
||||
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
|
||||
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
|
||||
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
|
||||
// Third party copyrights are property of their respective owners.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistribution's of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// * The name of the copyright holders may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// This software is provided by the copyright holders and contributors "as is" and
|
||||
// any express or implied warranties, including, but not limited to, the implied
|
||||
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
||||
// indirect, incidental, special, exemplary, or consequential damages
|
||||
// (including, but not limited to, procurement of substitute goods or services;
|
||||
// loss of use, data, or profits; or business interruption) however caused
|
||||
// and on any theory of liability, whether in contract, strict liability,
|
||||
// or tort (including negligence or otherwise) arising in any way out of
|
||||
// the use of this software, even if advised of the possibility of such damage.
|
||||
//
|
||||
//M*/
|
||||
|
||||
#ifndef __OPENCV_CORE_UTILITY_H__
|
||||
#define __OPENCV_CORE_UTILITY_H__
|
||||
|
||||
#include "opencv2/core.hpp"
|
||||
|
||||
namespace cv
|
||||
{
|
||||
|
||||
/*!
|
||||
Automatically Allocated Buffer Class
|
||||
|
||||
The class is used for temporary buffers in functions and methods.
|
||||
If a temporary buffer is usually small (a few K's of memory),
|
||||
but its size depends on the parameters, it makes sense to create a small
|
||||
fixed-size array on stack and use it if it's large enough. If the required buffer size
|
||||
is larger than the fixed size, another buffer of sufficient size is allocated dynamically
|
||||
and released after the processing. Therefore, in typical cases, when the buffer size is small,
|
||||
there is no overhead associated with malloc()/free().
|
||||
At the same time, there is no limit on the size of processed data.
|
||||
|
||||
This is what AutoBuffer does. The template takes 2 parameters - type of the buffer elements and
|
||||
the number of stack-allocated elements. Here is how the class is used:
|
||||
|
||||
\code
|
||||
void my_func(const cv::Mat& m)
|
||||
{
|
||||
cv::AutoBuffer<float> buf; // create automatic buffer containing 1000 floats
|
||||
|
||||
buf.allocate(m.rows); // if m.rows <= 1000, the pre-allocated buffer is used,
|
||||
// otherwise the buffer of "m.rows" floats will be allocated
|
||||
// dynamically and deallocated in cv::AutoBuffer destructor
|
||||
...
|
||||
}
|
||||
\endcode
|
||||
*/
|
||||
template<typename _Tp, size_t fixed_size = 1024/sizeof(_Tp)+8> class CV_EXPORTS AutoBuffer
|
||||
{
|
||||
public:
|
||||
typedef _Tp value_type;
|
||||
|
||||
//! the default contructor
|
||||
AutoBuffer();
|
||||
//! constructor taking the real buffer size
|
||||
AutoBuffer(size_t _size);
|
||||
|
||||
//! the copy constructor
|
||||
AutoBuffer(const AutoBuffer<_Tp, fixed_size>& buf);
|
||||
//! the assignment operator
|
||||
AutoBuffer<_Tp, fixed_size>& operator = (const AutoBuffer<_Tp, fixed_size>& buf);
|
||||
|
||||
//! destructor. calls deallocate()
|
||||
~AutoBuffer();
|
||||
|
||||
//! allocates the new buffer of size _size. if the _size is small enough, stack-allocated buffer is used
|
||||
void allocate(size_t _size);
|
||||
//! deallocates the buffer if it was dynamically allocated
|
||||
void deallocate();
|
||||
//! resizes the buffer and preserves the content
|
||||
void resize(size_t _size);
|
||||
//! returns the current buffer size
|
||||
size_t size() const;
|
||||
//! returns pointer to the real buffer, stack-allocated or head-allocated
|
||||
operator _Tp* ();
|
||||
//! returns read-only pointer to the real buffer, stack-allocated or head-allocated
|
||||
operator const _Tp* () const;
|
||||
|
||||
protected:
|
||||
//! pointer to the real buffer, can point to buf if the buffer is small enough
|
||||
_Tp* ptr;
|
||||
//! size of the real buffer
|
||||
size_t sz;
|
||||
//! pre-allocated buffer
|
||||
_Tp buf[fixed_size];
|
||||
};
|
||||
|
||||
//! Sets/resets the break-on-error mode.
|
||||
|
||||
/*!
|
||||
When the break-on-error mode is set, the default error handler
|
||||
issues a hardware exception, which can make debugging more convenient.
|
||||
|
||||
\return the previous state
|
||||
*/
|
||||
CV_EXPORTS bool setBreakOnError(bool flag);
|
||||
|
||||
typedef int (CV_CDECL *ErrorCallback)( int status, const char* func_name,
|
||||
const char* err_msg, const char* file_name,
|
||||
int line, void* userdata );
|
||||
|
||||
//! Sets the new error handler and the optional user data.
|
||||
|
||||
/*!
|
||||
The function sets the new error handler, called from cv::error().
|
||||
|
||||
\param errCallback the new error handler. If NULL, the default error handler is used.
|
||||
\param userdata the optional user data pointer, passed to the callback.
|
||||
\param prevUserdata the optional output parameter where the previous user data pointer is stored
|
||||
|
||||
\return the previous error handler
|
||||
*/
|
||||
CV_EXPORTS ErrorCallback redirectError( ErrorCallback errCallback, void* userdata=0, void** prevUserdata=0);
|
||||
|
||||
CV_EXPORTS std::string format( const char* fmt, ... );
|
||||
CV_EXPORTS std::string tempfile( const char* suffix CV_DEFAULT(0));
|
||||
CV_EXPORTS void glob(std::string pattern, std::vector<std::string>& result, bool recursive = false);
|
||||
CV_EXPORTS void setNumThreads(int nthreads);
|
||||
CV_EXPORTS int getNumThreads();
|
||||
CV_EXPORTS int getThreadNum();
|
||||
|
||||
CV_EXPORTS_W const std::string& getBuildInformation();
|
||||
|
||||
//! Returns the number of ticks.
|
||||
|
||||
/*!
|
||||
The function returns the number of ticks since the certain event (e.g. when the machine was turned on).
|
||||
It can be used to initialize cv::RNG or to measure a function execution time by reading the tick count
|
||||
before and after the function call. The granularity of ticks depends on the hardware and OS used. Use
|
||||
cv::getTickFrequency() to convert ticks to seconds.
|
||||
*/
|
||||
CV_EXPORTS_W int64 getTickCount();
|
||||
|
||||
/*!
|
||||
Returns the number of ticks per seconds.
|
||||
|
||||
The function returns the number of ticks (as returned by cv::getTickCount()) per second.
|
||||
The following code computes the execution time in milliseconds:
|
||||
|
||||
\code
|
||||
double exec_time = (double)getTickCount();
|
||||
// do something ...
|
||||
exec_time = ((double)getTickCount() - exec_time)*1000./getTickFrequency();
|
||||
\endcode
|
||||
*/
|
||||
CV_EXPORTS_W double getTickFrequency();
|
||||
|
||||
/*!
|
||||
Returns the number of CPU ticks.
|
||||
|
||||
On platforms where the feature is available, the function returns the number of CPU ticks
|
||||
since the certain event (normally, the system power-on moment). Using this function
|
||||
one can accurately measure the execution time of very small code fragments,
|
||||
for which cv::getTickCount() granularity is not enough.
|
||||
*/
|
||||
CV_EXPORTS_W int64 getCPUTickCount();
|
||||
|
||||
/*!
|
||||
Returns SSE etc. support status
|
||||
|
||||
The function returns true if certain hardware features are available.
|
||||
Currently, the following features are recognized:
|
||||
- CV_CPU_MMX - MMX
|
||||
- CV_CPU_SSE - SSE
|
||||
- CV_CPU_SSE2 - SSE 2
|
||||
- CV_CPU_SSE3 - SSE 3
|
||||
- CV_CPU_SSSE3 - SSSE 3
|
||||
- CV_CPU_SSE4_1 - SSE 4.1
|
||||
- CV_CPU_SSE4_2 - SSE 4.2
|
||||
- CV_CPU_POPCNT - POPCOUNT
|
||||
- CV_CPU_AVX - AVX
|
||||
|
||||
\note {Note that the function output is not static. Once you called cv::useOptimized(false),
|
||||
most of the hardware acceleration is disabled and thus the function will returns false,
|
||||
until you call cv::useOptimized(true)}
|
||||
*/
|
||||
CV_EXPORTS_W bool checkHardwareSupport(int feature);
|
||||
|
||||
//! returns the number of CPUs (including hyper-threading)
|
||||
CV_EXPORTS_W int getNumberOfCPUs();
|
||||
|
||||
|
||||
/*!
|
||||
Aligns pointer by the certain number of bytes
|
||||
|
||||
This small inline function aligns the pointer by the certian number of bytes by shifting
|
||||
it forward by 0 or a positive offset.
|
||||
*/
|
||||
template<typename _Tp> static inline _Tp* alignPtr(_Tp* ptr, int n=(int)sizeof(_Tp))
|
||||
{
|
||||
return (_Tp*)(((size_t)ptr + n-1) & -n);
|
||||
}
|
||||
|
||||
/*!
|
||||
Aligns buffer size by the certain number of bytes
|
||||
|
||||
This small inline function aligns a buffer size by the certian number of bytes by enlarging it.
|
||||
*/
|
||||
static inline size_t alignSize(size_t sz, int n)
|
||||
{
|
||||
return (sz + n-1) & -n;
|
||||
}
|
||||
|
||||
/*!
|
||||
Turns on/off available optimization
|
||||
|
||||
The function turns on or off the optimized code in OpenCV. Some optimization can not be enabled
|
||||
or disabled, but, for example, most of SSE code in OpenCV can be temporarily turned on or off this way.
|
||||
|
||||
\note{Since optimization may imply using special data structures, it may be unsafe
|
||||
to call this function anywhere in the code. Instead, call it somewhere at the top level.}
|
||||
*/
|
||||
CV_EXPORTS_W void setUseOptimized(bool onoff);
|
||||
|
||||
/*!
|
||||
Returns the current optimization status
|
||||
|
||||
The function returns the current optimization status, which is controlled by cv::setUseOptimized().
|
||||
*/
|
||||
CV_EXPORTS_W bool useOptimized();
|
||||
|
||||
static inline size_t getElemSize(int type) { return CV_ELEM_SIZE(type); }
|
||||
|
||||
/////////////////////////////// Parallel Primitives //////////////////////////////////
|
||||
|
||||
// a base body class
|
||||
class CV_EXPORTS ParallelLoopBody
|
||||
{
|
||||
public:
|
||||
virtual ~ParallelLoopBody();
|
||||
virtual void operator() (const Range& range) const = 0;
|
||||
};
|
||||
|
||||
CV_EXPORTS void parallel_for_(const Range& range, const ParallelLoopBody& body, double nstripes=-1.);
|
||||
|
||||
/////////////////////////// Synchronization Primitives ///////////////////////////////
|
||||
|
||||
class CV_EXPORTS Mutex
|
||||
{
|
||||
public:
|
||||
Mutex();
|
||||
~Mutex();
|
||||
Mutex(const Mutex& m);
|
||||
Mutex& operator = (const Mutex& m);
|
||||
|
||||
void lock();
|
||||
bool trylock();
|
||||
void unlock();
|
||||
|
||||
struct Impl;
|
||||
protected:
|
||||
Impl* impl;
|
||||
};
|
||||
|
||||
class CV_EXPORTS AutoLock
|
||||
{
|
||||
public:
|
||||
AutoLock(Mutex& m) : mutex(&m) { mutex->lock(); }
|
||||
~AutoLock() { mutex->unlock(); }
|
||||
protected:
|
||||
Mutex* mutex;
|
||||
};
|
||||
|
||||
// The CommandLineParser class is designed for command line arguments parsing
|
||||
|
||||
class CV_EXPORTS CommandLineParser
|
||||
{
|
||||
public:
|
||||
CommandLineParser(int argc, const char* const argv[], const std::string& keys);
|
||||
CommandLineParser(const CommandLineParser& parser);
|
||||
CommandLineParser& operator = (const CommandLineParser& parser);
|
||||
|
||||
std::string getPathToApplication() const;
|
||||
|
||||
template <typename T>
|
||||
T get(const std::string& name, bool space_delete = true) const
|
||||
{
|
||||
T val = T();
|
||||
getByName(name, space_delete, ParamType<T>::type, (void*)&val);
|
||||
return val;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T get(int index, bool space_delete = true) const
|
||||
{
|
||||
T val = T();
|
||||
getByIndex(index, space_delete, ParamType<T>::type, (void*)&val);
|
||||
return val;
|
||||
}
|
||||
|
||||
bool has(const std::string& name) const;
|
||||
|
||||
bool check() const;
|
||||
|
||||
void about(const std::string& message);
|
||||
|
||||
void printMessage() const;
|
||||
void printErrors() const;
|
||||
|
||||
protected:
|
||||
void getByName(const std::string& name, bool space_delete, int type, void* dst) const;
|
||||
void getByIndex(int index, bool space_delete, int type, void* dst) const;
|
||||
|
||||
struct Impl;
|
||||
Impl* impl;
|
||||
};
|
||||
|
||||
/////////////////////////////// AutoBuffer implementation ////////////////////////////////////////
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline
|
||||
AutoBuffer<_Tp, fixed_size>::AutoBuffer()
|
||||
{
|
||||
ptr = buf;
|
||||
sz = fixed_size;
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline
|
||||
AutoBuffer<_Tp, fixed_size>::AutoBuffer(size_t _size)
|
||||
{
|
||||
ptr = buf;
|
||||
sz = fixed_size;
|
||||
allocate(_size);
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline
|
||||
AutoBuffer<_Tp, fixed_size>::AutoBuffer(const AutoBuffer<_Tp, fixed_size>& abuf )
|
||||
{
|
||||
ptr = buf;
|
||||
sz = fixed_size;
|
||||
allocate(abuf.size);
|
||||
for( size_t i = 0; i < sz; i++ )
|
||||
ptr[i] = abuf.ptr[i];
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline AutoBuffer<_Tp, fixed_size>&
|
||||
AutoBuffer<_Tp, fixed_size>::operator = (const AutoBuffer<_Tp, fixed_size>& abuf)
|
||||
{
|
||||
if( this != &abuf )
|
||||
{
|
||||
deallocate();
|
||||
allocate(abuf.size);
|
||||
for( size_t i = 0; i < sz; i++ )
|
||||
ptr[i] = abuf.ptr[i];
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline
|
||||
AutoBuffer<_Tp, fixed_size>::~AutoBuffer()
|
||||
{ deallocate(); }
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline void
|
||||
AutoBuffer<_Tp, fixed_size>::allocate(size_t _size)
|
||||
{
|
||||
if(_size <= sz)
|
||||
{
|
||||
sz = _size;
|
||||
return;
|
||||
}
|
||||
deallocate();
|
||||
if(_size > fixed_size)
|
||||
{
|
||||
ptr = new _Tp[_size];
|
||||
sz = _size;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline void
|
||||
AutoBuffer<_Tp, fixed_size>::deallocate()
|
||||
{
|
||||
if( ptr != buf )
|
||||
{
|
||||
delete[] ptr;
|
||||
ptr = buf;
|
||||
sz = fixed_size;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline void
|
||||
AutoBuffer<_Tp, fixed_size>::resize(size_t _size)
|
||||
{
|
||||
if(_size <= sz)
|
||||
{
|
||||
sz = _size;
|
||||
return;
|
||||
}
|
||||
size_t i, prevsize = sz, minsize = MIN(prevsize, _size);
|
||||
_Tp* prevptr = ptr;
|
||||
|
||||
ptr = _size > fixed_size ? new _Tp[_size] : buf;
|
||||
sz = _size;
|
||||
|
||||
if( ptr != prevptr )
|
||||
for( i = 0; i < minsize; i++ )
|
||||
ptr[i] = prevptr[i];
|
||||
for( i = prevsize; i < _size; i++ )
|
||||
ptr[i] = _Tp();
|
||||
|
||||
if( prevptr != buf )
|
||||
delete[] prevptr;
|
||||
}
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline size_t
|
||||
AutoBuffer<_Tp, fixed_size>::size() const
|
||||
{ return sz; }
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline
|
||||
AutoBuffer<_Tp, fixed_size>::operator _Tp* ()
|
||||
{ return ptr; }
|
||||
|
||||
template<typename _Tp, size_t fixed_size> inline
|
||||
AutoBuffer<_Tp, fixed_size>::operator const _Tp* () const
|
||||
{ return ptr; }
|
||||
|
||||
// TODO: move them to core_c.h
|
||||
//! converts array (CvMat or IplImage) to cv::Mat
|
||||
CV_EXPORTS Mat cvarrToMat(const CvArr* arr, bool copyData=false,
|
||||
bool allowND=true, int coiMode=0,
|
||||
AutoBuffer<double>* buf=0);
|
||||
|
||||
static inline Mat cvarrToMatND(const CvArr* arr, bool copyData=false, int coiMode=0)
|
||||
{
|
||||
return cvarrToMat(arr, copyData, true, coiMode);
|
||||
}
|
||||
|
||||
} //namespace cv
|
||||
|
||||
#endif //__OPENCV_CORE_UTILITY_H__
|
@ -48,6 +48,7 @@
|
||||
#endif
|
||||
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/core_c.h"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
#ifndef __OPENCV_TEST_PRECOMP_HPP__
|
||||
#define __OPENCV_TEST_PRECOMP_HPP__
|
||||
|
||||
#include <iostream>
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/core/core_c.h"
|
||||
#include <iostream>
|
||||
|
||||
#endif
|
||||
|
@ -50,6 +50,8 @@
|
||||
#include "opencv2/features2d.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -9,6 +9,7 @@
|
||||
# include "cvconfig.h"
|
||||
#endif
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
|
||||
#include "opencv2/flann/miniflann.hpp"
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define __OPENCV_TEST_PRECOMP_HPP__
|
||||
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/flann.hpp"
|
||||
#include <iostream>
|
||||
|
||||
|
@ -47,6 +47,8 @@
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/highgui/highgui_c.h"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -13,10 +13,10 @@
|
||||
# include "cvconfig.h"
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include <iostream>
|
||||
|
||||
#if defined(HAVE_VIDEOINPUT) || \
|
||||
defined(HAVE_TYZX) || \
|
||||
|
@ -49,6 +49,8 @@
|
||||
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
|
@ -9,11 +9,11 @@
|
||||
#ifndef __OPENCV_TEST_PRECOMP_HPP__
|
||||
#define __OPENCV_TEST_PRECOMP_HPP__
|
||||
|
||||
#include <iostream>
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/highgui/highgui_c.h"
|
||||
#include <iostream>
|
||||
|
||||
#endif
|
||||
|
@ -1,2 +1,3 @@
|
||||
include/opencv2/core.hpp
|
||||
include/opencv2/core/utility.hpp
|
||||
../java/generator/src/cpp/core_manual.hpp
|
||||
|
@ -20,6 +20,8 @@
|
||||
# define LOGD(...)
|
||||
#endif
|
||||
|
||||
#include "opencv2/core/utility.hpp"
|
||||
|
||||
#include "converters.h"
|
||||
|
||||
#include "core_manual.hpp"
|
||||
|
@ -1,6 +1,8 @@
|
||||
#define LOG_TAG "org.opencv.core.Core"
|
||||
#include "common.h"
|
||||
|
||||
#include "opencv2/core/utility.hpp"
|
||||
|
||||
static int quietCallback( int, const char*, const char*, const char*, int, void* )
|
||||
{
|
||||
return 0;
|
||||
|
@ -47,15 +47,14 @@
|
||||
|
||||
#include "opencv2/legacy.hpp"
|
||||
|
||||
#include "opencv2/core/internal.hpp"
|
||||
#include "opencv2/video.hpp"
|
||||
|
||||
#include "opencv2/legacy/blobtrack.hpp"
|
||||
#include "opencv2/legacy/compat.hpp"
|
||||
|
||||
#include "_matrix.h"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
|
||||
typedef unsigned short ushort;
|
||||
#include "_matrix.h"
|
||||
|
||||
CV_INLINE bool operator == (CvSize size1, CvSize size2 );
|
||||
CV_INLINE bool operator == (CvSize size1, CvSize size2 )
|
||||
|
@ -9,12 +9,12 @@
|
||||
#ifndef __OPENCV_TEST_PRECOMP_HPP__
|
||||
#define __OPENCV_TEST_PRECOMP_HPP__
|
||||
|
||||
#include <iostream>
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/highgui/highgui_c.h"
|
||||
#include "opencv2/legacy.hpp"
|
||||
#include <iostream>
|
||||
|
||||
#endif
|
||||
|
@ -47,6 +47,7 @@
|
||||
|
||||
#include "opencv2/ml.hpp"
|
||||
#include "opencv2/core/core_c.h"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
|
||||
#include <assert.h>
|
||||
|
@ -9,11 +9,11 @@
|
||||
#ifndef __OPENCV_TEST_PRECOMP_HPP__
|
||||
#define __OPENCV_TEST_PRECOMP_HPP__
|
||||
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/ml.hpp"
|
||||
#include "opencv2/core/core_c.h"
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
|
||||
#define CV_NBAYES "nbayes"
|
||||
#define CV_KNEAREST "knearest"
|
||||
|
@ -49,6 +49,8 @@
|
||||
|
||||
#include "opencv2/nonfree.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
|
||||
#endif
|
||||
|
@ -9,10 +9,10 @@
|
||||
#ifndef __OPENCV_TEST_PRECOMP_HPP__
|
||||
#define __OPENCV_TEST_PRECOMP_HPP__
|
||||
|
||||
#include <iostream>
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/nonfree.hpp"
|
||||
#include <iostream>
|
||||
|
||||
#endif
|
||||
|
@ -51,6 +51,8 @@
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/core/core_c.h"
|
||||
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
|
||||
#include "opencv2/opencv_modules.hpp"
|
||||
|
@ -62,14 +62,12 @@
|
||||
#include <string>
|
||||
#include <cstdarg>
|
||||
#include "cvconfig.h"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
//#include "opencv2/calib3d.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/video.hpp"
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/ts/ts_perf.hpp"
|
||||
#include "opencv2/ocl.hpp"
|
||||
//#include "opencv2/calib3d.hpp"
|
||||
//#include "opencv2/nonfree.hpp"
|
||||
|
||||
#include "utility.hpp"
|
||||
|
@ -69,6 +69,7 @@
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/core/core_c.h"
|
||||
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
//#include "opencv2/highgui.hpp"
|
||||
|
||||
|
@ -62,14 +62,12 @@
|
||||
#include <string>
|
||||
#include <cstdarg>
|
||||
#include "cvconfig.h"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
//#include "opencv2/calib3d.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/video.hpp"
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/ts/ts_perf.hpp"
|
||||
#include "opencv2/ocl.hpp"
|
||||
//#include "opencv2/calib3d.hpp"
|
||||
//#include "opencv2/nonfree.hpp"
|
||||
|
||||
#include "utility.hpp"
|
||||
|
@ -9,9 +9,9 @@
|
||||
#ifndef __OPENCV_TEST_PRECOMP_HPP__
|
||||
#define __OPENCV_TEST_PRECOMP_HPP__
|
||||
|
||||
#include <iostream>
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/photo.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
|
||||
#endif
|
||||
|
@ -24,6 +24,7 @@ ocv_module_include_directories(
|
||||
|
||||
set(opencv_hdrs
|
||||
"${OPENCV_MODULE_opencv_core_LOCATION}/include/opencv2/core.hpp"
|
||||
"${OPENCV_MODULE_opencv_core_LOCATION}/include/opencv2/core/utility.hpp"
|
||||
"${OPENCV_MODULE_opencv_flann_LOCATION}/include/opencv2/flann/miniflann.hpp"
|
||||
"${OPENCV_MODULE_opencv_imgproc_LOCATION}/include/opencv2/imgproc.hpp"
|
||||
"${OPENCV_MODULE_opencv_video_LOCATION}/include/opencv2/video/background_segm.hpp"
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "numpy/ndarrayobject.h"
|
||||
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/contrib.hpp"
|
||||
#include "opencv2/flann/miniflann.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
@ -36,6 +36,7 @@
|
||||
#endif
|
||||
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
|
||||
namespace cvtest
|
||||
{
|
||||
@ -478,26 +479,10 @@ protected:
|
||||
virtual int run_test_case( int expected_code, const string& descr );
|
||||
virtual void run_func(void) = 0;
|
||||
int test_case_idx;
|
||||
int progress;
|
||||
double t, freq;
|
||||
|
||||
template<class F>
|
||||
int run_test_case( int expected_code, const string& _descr, F f)
|
||||
{
|
||||
double new_t = (double)cv::getTickCount(), dt;
|
||||
if( test_case_idx < 0 )
|
||||
{
|
||||
test_case_idx = 0;
|
||||
progress = 0;
|
||||
dt = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dt = (new_t - t)/(freq*1000);
|
||||
t = new_t;
|
||||
}
|
||||
progress = update_progress(progress, test_case_idx, 0, dt);
|
||||
|
||||
int errcount = 0;
|
||||
bool thrown = false;
|
||||
const char* descr = _descr.c_str() ? _descr.c_str() : "";
|
||||
|
@ -1,6 +1,9 @@
|
||||
#include "opencv2/core/core_c.h"
|
||||
#include "opencv2/ts.hpp"
|
||||
|
||||
#include "opencv2/core/core_c.h"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
|
||||
|
||||
#ifdef GTEST_LINKED_AS_SHARED_LIBRARY
|
||||
#error ts module should not have GTEST_LINKED_AS_SHARED_LIBRARY defined
|
||||
#endif
|
||||
|
@ -321,9 +321,7 @@ int BaseTest::update_progress( int progress, int test_case_idx, int count, doubl
|
||||
|
||||
BadArgTest::BadArgTest()
|
||||
{
|
||||
progress = -1;
|
||||
test_case_idx = -1;
|
||||
freq = cv::getTickFrequency();
|
||||
// oldErrorCbk = 0;
|
||||
// oldErrorCbkData = 0;
|
||||
}
|
||||
@ -334,20 +332,6 @@ BadArgTest::~BadArgTest(void)
|
||||
|
||||
int BadArgTest::run_test_case( int expected_code, const string& _descr )
|
||||
{
|
||||
double new_t = (double)cv::getTickCount(), dt;
|
||||
if( test_case_idx < 0 )
|
||||
{
|
||||
test_case_idx = 0;
|
||||
progress = 0;
|
||||
dt = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dt = (new_t - t)/(freq*1000);
|
||||
t = new_t;
|
||||
}
|
||||
progress = update_progress(progress, test_case_idx, 0, dt);
|
||||
|
||||
int errcount = 0;
|
||||
bool thrown = false;
|
||||
const char* descr = _descr.c_str() ? _descr.c_str() : "";
|
||||
|
@ -9,10 +9,10 @@
|
||||
#ifndef __OPENCV_VIDEO_PRECOMP_HPP__
|
||||
#define __OPENCV_VIDEO_PRECOMP_HPP__
|
||||
|
||||
#include "opencv2/ts.hpp"
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/video.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include "opencv2/ts.hpp"
|
||||
|
||||
#ifdef GTEST_CREATE_SHARED_LIBRARY
|
||||
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
|
||||
|
@ -47,9 +47,10 @@
|
||||
#include "cvconfig.h"
|
||||
#endif
|
||||
|
||||
#include "opencv2/video/tracking.hpp"
|
||||
#include "opencv2/video/background_segm.hpp"
|
||||
#include "opencv2/video.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
|
||||
#include <list>
|
||||
|
@ -9,11 +9,11 @@
|
||||
#ifndef __OPENCV_TEST_PRECOMP_HPP__
|
||||
#define __OPENCV_TEST_PRECOMP_HPP__
|
||||
|
||||
#include <iostream>
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/video.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
|
||||
#endif
|
||||
|
@ -20,11 +20,12 @@
|
||||
Or: http://oreilly.com/catalog/9780596516130/
|
||||
ISBN-10: 0596516134 or: ISBN-13: 978-0596516130
|
||||
************************************************** */
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/video/background_segm.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/legacy/legacy.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/legacy.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "opencv2/objdetect/objdetect.hpp"
|
||||
#include "opencv2/legacy/legacy.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/features2d.hpp"
|
||||
#include "opencv2/objdetect.hpp"
|
||||
#include "opencv2/legacy.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
@ -2,9 +2,10 @@
|
||||
* Copyright (C) 2009, Liu Liu All rights reserved.
|
||||
*/
|
||||
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/features2d.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include <iostream>
|
||||
|
||||
using namespace cv;
|
||||
|
@ -1,7 +1,8 @@
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/video/background_segm.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace std;
|
||||
|
@ -4,11 +4,12 @@
|
||||
* Created on: Oct 17, 2010
|
||||
* Author: ethan
|
||||
*/
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/calib3d.hpp"
|
||||
#include "opencv2/features2d.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/calib3d.hpp"
|
||||
#include "opencv2/features2d.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <map>
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/calib3d.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <cctype>
|
||||
#include <stdio.h>
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/video/tracking.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <ctype.h>
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/contrib.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace cv;
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID)
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include <opencv2/core/internal.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/objdetect/objdetect.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/objdetect.hpp>
|
||||
#include "opencv2/contrib/detection_based_tracker.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
@ -39,9 +39,10 @@
|
||||
//
|
||||
//M*/
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/features2d.hpp"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -16,9 +16,10 @@
|
||||
* See <http://www.opensource.org/licenses/bsd-license>
|
||||
*/
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/contrib.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
@ -38,11 +38,12 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#include <opencv2/nonfree/features2d.hpp>
|
||||
#include <opencv2/legacy/legacy.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/features2d.hpp>
|
||||
#include <opencv2/nonfree.hpp>
|
||||
#include <opencv2/legacy.hpp>
|
||||
|
||||
using namespace cv;
|
||||
|
||||
|
@ -13,10 +13,10 @@
|
||||
* Authors: G. Evangelidis, INRIA, Grenoble, France
|
||||
* M. Asbach, Fraunhofer IAIS, St. Augustin, Germany
|
||||
*/
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/video/video.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/video.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/core/utility.hpp>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
@ -1,8 +1,9 @@
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include <opencv2/imgproc/imgproc_c.h> // cvFindContours
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/objdetect/objdetect.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/objdetect.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <iterator>
|
||||
#include <set>
|
||||
#include <cstdio>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include <iostream>
|
||||
|
||||
const char* keys =
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/objdetect.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
|
@ -8,10 +8,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/calib3d.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/video/tracking.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -45,7 +45,8 @@
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include "opencv2/opencv_modules.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/stitching/detail/autocalib.hpp"
|
||||
#include "opencv2/stitching/detail/blenders.hpp"
|
||||
#include "opencv2/stitching/detail/camera.hpp"
|
||||
|
@ -3,10 +3,11 @@
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/calib3d.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
@ -1,10 +1,11 @@
|
||||
#include <iostream> // Console I/O
|
||||
#include <sstream> // String to number conversion
|
||||
|
||||
#include <opencv2/core/core.hpp> // Basic OpenCV structures
|
||||
#include <opencv2/imgproc/imgproc.hpp>// Image processing methods for the CPU
|
||||
#include <opencv2/highgui/highgui.hpp>// Read images
|
||||
#include <opencv2/gpu/gpu.hpp> // GPU structures and methods
|
||||
#include <opencv2/core.hpp> // Basic OpenCV structures
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include <opencv2/imgproc.hpp>// Image processing methods for the CPU
|
||||
#include <opencv2/highgui.hpp>// Read images
|
||||
#include <opencv2/gpu.hpp> // GPU structures and methods
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
@ -1,8 +1,9 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include "opencv2/video/tracking.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/video.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include "opencv2/core.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/video.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
|
@ -1,9 +1,10 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/gpu.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
@ -3,10 +3,10 @@
|
||||
#include <string>
|
||||
#include <cctype>
|
||||
|
||||
#include "cvconfig.h"
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/gpu.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
@ -2,10 +2,11 @@
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/video/video.hpp"
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/video.hpp"
|
||||
#include "opencv2/gpu.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
@ -2,11 +2,12 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/gpu.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/contrib.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
@ -4,8 +4,9 @@
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <stdexcept>
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/gpu.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
@ -1,10 +1,11 @@
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/gpu.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
@ -1,9 +1,10 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/gpu.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
@ -6,8 +6,8 @@
|
||||
#include <vector>
|
||||
#include <numeric>
|
||||
#include <string>
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/gpu.hpp"
|
||||
|
||||
#define TAB " "
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include "cvconfig.h"
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/video/video.hpp"
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/video.hpp"
|
||||
#include "opencv2/gpu.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include <opencv2/gpu.hpp>
|
||||
#include <opencv2/softcascade.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
|
@ -3,8 +3,9 @@
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <stdexcept>
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/gpu.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
@ -4,8 +4,9 @@
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <stdexcept>
|
||||
#include "opencv2/ocl/ocl.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/ocl.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
@ -5,17 +5,17 @@
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
#include <numeric>
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/video/video.hpp"
|
||||
#include "opencv2/nonfree/nonfree.hpp"
|
||||
#include "opencv2/objdetect/objdetect.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/calib3d.hpp"
|
||||
#include "opencv2/video.hpp"
|
||||
#include "opencv2/nonfree.hpp"
|
||||
#include "opencv2/objdetect.hpp"
|
||||
#include "opencv2/features2d.hpp"
|
||||
#define USE_OPENCL
|
||||
#ifdef USE_OPENCL
|
||||
#include "opencv2/ocl/ocl.hpp"
|
||||
#include "opencv2/ocl.hpp"
|
||||
#endif
|
||||
|
||||
#define TAB " "
|
||||
|
Loading…
Reference in New Issue
Block a user