Fix build error.

This commit is contained in:
peng xiao 2013-06-26 16:06:05 +08:00
parent 9b3c318e85
commit 30239ad58e

View File

@ -41,10 +41,10 @@
//M*/ //M*/
#include "perf_precomp.hpp" #include "perf_precomp.hpp"
#include "opencv2/ocl/ocl.hpp"
#ifdef HAVE_OPENCL #ifdef HAVE_OPENCL
#include "opencv2/ocl/ocl.hpp"
using namespace std; using namespace std;
using namespace testing; using namespace testing;
using namespace perf; using namespace perf;
@ -58,13 +58,9 @@ namespace
public: public:
explicit OneFrameSource_OCL(const ocl::oclMat& frame) : frame_(frame) {} explicit OneFrameSource_OCL(const ocl::oclMat& frame) : frame_(frame) {}
void nextFrame(OutputArray) void nextFrame(OutputArray frame)
{ {
} ocl::getOclMatRef(frame) = frame_;
void nextFrame(ocl::oclMat& frame)
{
frame_.copyTo(frame);
} }
void reset() void reset()
{ {
@ -78,15 +74,27 @@ namespace
class ZeroOpticalFlowOCL : public DenseOpticalFlowExt class ZeroOpticalFlowOCL : public DenseOpticalFlowExt
{ {
public: public:
void calc(ocl::oclMat& frame0, ocl::oclMat&, ocl::oclMat& flow1, ocl::oclMat& flow2) void calc(InputArray frame0, InputArray, OutputArray flow1, OutputArray flow2)
{ {
cv::Size size = frame0.size(); ocl::oclMat& frame0_ = ocl::getOclMatRef(frame0);
ocl::oclMat& flow1_ = ocl::getOclMatRef(flow1);
ocl::oclMat& flow2_ = ocl::getOclMatRef(flow2);
flow1.create(size, CV_32FC1); cv::Size size = frame0_.size();
flow2.create(size, CV_32FC1);
flow1.setTo(Scalar::all(0)); if(!flow2.needed())
flow2.setTo(Scalar::all(0)); {
flow1_.create(size, CV_32FC2);
flow1_.setTo(Scalar::all(0));
}
else
{
flow1_.create(size, CV_32FC1);
flow2_.create(size, CV_32FC1);
flow1_.setTo(Scalar::all(0));
flow2_.setTo(Scalar::all(0));
}
} }
void collectGarbage() void collectGarbage()
@ -135,4 +143,4 @@ PERF_TEST_P(Size_MatType, SuperResolution_BTVL1_OCL,
frame_ocl.release(); frame_ocl.release();
CPU_SANITY_CHECK(dst_ocl); CPU_SANITY_CHECK(dst_ocl);
} }
#endif #endif