#include "opencv2/core/types_c.h"
#ifdef __cplusplus
+#ifdef _MSC_VER
+/* disable warning C4190: 'function' has C-linkage specified, but returns UDT 'typename'
+ which is incompatible with C
+
+ It is OK to disable it because we only extend few plain structures with
+ C++ construrtors for simpler interoperability with C++ API of the library
+*/
+# pragma warning(disable:4190)
+#endif
extern "C" {
#endif
/*!
Utility methods
*/
-template<typename _Tp, int m> double determinant(const Matx<_Tp, m, m>& a);
-template<typename _Tp, int m, int n> double trace(const Matx<_Tp, m, n>& a);
-template<typename _Tp, int m, int n> double norm(const Matx<_Tp, m, n>& M);
-template<typename _Tp, int m, int n> double norm(const Matx<_Tp, m, n>& M, int normType);
+template<typename _Tp, int m> static double determinant(const Matx<_Tp, m, m>& a);
+template<typename _Tp, int m, int n> static double trace(const Matx<_Tp, m, n>& a);
+template<typename _Tp, int m, int n> static double norm(const Matx<_Tp, m, n>& M);
+template<typename _Tp, int m, int n> static double norm(const Matx<_Tp, m, n>& M, int normType);
/*!
Utility methods
*/
-template<typename _Tp, int cn> Vec<_Tp, cn> normalize(const Vec<_Tp, cn>& v);
+template<typename _Tp, int cn> static Vec<_Tp, cn> normalize(const Vec<_Tp, cn>& v);
typedef _Tp channel_type;
enum { generic_type = 0,
- depth = DataType<channel_type>::value,
+ depth = DataType<channel_type>::depth,
channels = 4,
fmt = DataType<channel_type>::fmt + ((channels - 1) << 8),
type = CV_MAKETYPE(depth, channels)
#define IPL_BORDER_REFLECT 2
#define IPL_BORDER_WRAP 3
-typedef struct _IplImage
+typedef struct CV_EXPORTS _IplImage
{
int nSize; /* sizeof(IplImage) */
int ID; /* version (=0)*/
#define CV_MAX_DIM 32
#define CV_MAX_DIM_HEAP 1024
-typedef struct CvMatND
+typedef struct CV_EXPORTS CvMatND
{
int type;
int dims;
CvSparseMat;
#ifdef __cplusplus
- CvSparseMat* cvCreateSparseMat(const cv::SparseMat& m);
+ CV_EXPORTS CvSparseMat* cvCreateSparseMat(const cv::SparseMat& m);
#endif
#define CV_IS_SPARSE_MAT_HDR(mat) \
std::vector<float> scalev;
for(factor = 1.f;; factor *= scaleFactor)
{
- CvSize winSize = { cvRound(winSize0.width * factor), cvRound(winSize0.height * factor) };
+ CvSize winSize( cvRound(winSize0.width * factor), cvRound(winSize0.height * factor) );
sz.width = cvRound( gimg.cols / factor ) + 1;
sz.height = cvRound( gimg.rows / factor ) + 1;
- CvSize sz1 = { sz.width - winSize0.width - 1, sz.height - winSize0.height - 1 };
+ CvSize sz1( sz.width - winSize0.width - 1, sz.height - winSize0.height - 1 );
if( sz1.width <= 0 || sz1.height <= 0 )
break;
cvRound(factor * winsize0.height) < gimg.rows - 10;
n_factors++, factor *= scaleFactor )
{
- CvSize winSize = { cvRound( winsize0.width * factor ),
- cvRound( winsize0.height * factor )
- };
+ CvSize winSize( cvRound( winsize0.width * factor ), cvRound( winsize0.height * factor ) );
if( winSize.width < minSize.width || winSize.height < minSize.height )
{
continue;
if( findBiggestObject && rectList.size() )
{
- CvAvgComp result_comp = {{0, 0, 0, 0}, 0};
+ CvAvgComp result_comp = {CvRect(), 0};
for( size_t i = 0; i < rectList.size(); i++ )
{
{
clCxt = Context::getContext();
/* core logic */
- _type &= TYPE_MASK;
+ _type &= Mat::TYPE_MASK;
//download_channels = CV_MAT_CN(_type);
//if(download_channels==3)
//{
if( size.width <= 0 || size.height <= 0 )
return;
- cv::Mat src0(mat);
+ cv::Mat src0 = cv::cvarrToMat(mat);
cv::ocl::oclMat src(src0);
cv::Size tileSize;
int blockx,blocky;
#ifndef __OPENCV_TS_PERF_HPP__
#define __OPENCV_TS_PERF_HPP__
+#ifdef HAVE_CVCONFIG_H
+# include "cvconfig.h"
+#endif
+#ifndef GTEST_CREATE_SHARED_LIBRARY
+# ifdef BUILD_SHARED_LIBS
+# define GTEST_LINKED_AS_SHARED_LIBRARY 1
+# endif
+#endif
+
#include "opencv2/core.hpp"
#include "ts_gtest.h"
-#ifdef HAVE_TBB
-#include "tbb/task_scheduler_init.h"
-#endif
-
#if !(defined(LOGD) || defined(LOGI) || defined(LOGW) || defined(LOGE))
# if defined(ANDROID) && defined(USE_ANDROID_LOGGING)
# include <android/log.h>
else
{
cerr << "Incorrect Optical Flow algorithm - " << name << endl;
- exit(-1);
}
return Ptr<DenseOpticalFlowExt>();
superRes->set("scale", scale);
superRes->set("iterations", iterations);
superRes->set("temporalAreaRadius", temporalAreaRadius);
- superRes->set("opticalFlow", createOptFlow(optFlow, useGpu));
+
+ Ptr<DenseOpticalFlowExt> of = createOptFlow(optFlow, useGpu);
+ if (of.empty())
+ exit(-1);
+ superRes->set("opticalFlow", of);
Ptr<FrameSource> frameSource;
if (useGpu)
for(;;)
{
IplImage* iplImg = cvQueryFrame( capture );
- frame = iplImg;
+ frame = cv::cvarrToMat(iplImg);
if( frame.empty() )
break;
if( iplImg->origin == IPL_ORIGIN_TL )