Boring changes - superres.
This commit is contained in:
parent
f21851f0f4
commit
93f757f8a2
@ -153,7 +153,7 @@ PERF_TEST_P(Size_MatType, SuperResolution_BTVL1,
|
||||
superRes->set("temporalAreaRadius", temporalAreaRadius);
|
||||
superRes->set("opticalFlow", opticalFlow);
|
||||
|
||||
superRes->setInput(new OneFrameSource_GPU(GpuMat(frame)));
|
||||
superRes->setInput(makePtr<OneFrameSource_GPU>(GpuMat(frame)));
|
||||
|
||||
GpuMat dst;
|
||||
superRes->nextFrame(dst);
|
||||
@ -171,7 +171,7 @@ PERF_TEST_P(Size_MatType, SuperResolution_BTVL1,
|
||||
superRes->set("temporalAreaRadius", temporalAreaRadius);
|
||||
superRes->set("opticalFlow", opticalFlow);
|
||||
|
||||
superRes->setInput(new OneFrameSource_CPU(frame));
|
||||
superRes->setInput(makePtr<OneFrameSource_CPU>(frame));
|
||||
|
||||
Mat dst;
|
||||
superRes->nextFrame(dst);
|
||||
|
@ -134,7 +134,7 @@ PERF_TEST_P(Size_MatType, SuperResolution_BTVL1_OCL,
|
||||
superRes_ocl->set("temporalAreaRadius", temporalAreaRadius);
|
||||
superRes_ocl->set("opticalFlow", opticalFlowOcl);
|
||||
|
||||
superRes_ocl->setInput(new OneFrameSource_OCL(frame_ocl));
|
||||
superRes_ocl->setInput(makePtr<OneFrameSource_OCL>(frame_ocl));
|
||||
|
||||
ocl::oclMat dst_ocl;
|
||||
superRes_ocl->nextFrame(dst_ocl);
|
||||
|
@ -337,7 +337,7 @@ namespace
|
||||
|
||||
// update blur filter and btv weights
|
||||
|
||||
if (filter_.empty() || blurKernelSize_ != curBlurKernelSize_ || blurSigma_ != curBlurSigma_ || src[0].type() != curSrcType_)
|
||||
if (!filter_ || blurKernelSize_ != curBlurKernelSize_ || blurSigma_ != curBlurSigma_ || src[0].type() != curSrcType_)
|
||||
{
|
||||
filter_ = createGaussianFilter(src[0].type(), Size(blurKernelSize_, blurKernelSize_), blurSigma_);
|
||||
curBlurKernelSize_ = blurKernelSize_;
|
||||
@ -614,5 +614,5 @@ namespace
|
||||
|
||||
Ptr<SuperResolution> cv::superres::createSuperResolution_BTVL1()
|
||||
{
|
||||
return new BTVL1;
|
||||
return makePtr<BTVL1>();
|
||||
}
|
||||
|
@ -578,7 +578,7 @@ namespace
|
||||
|
||||
Ptr<SuperResolution> cv::superres::createSuperResolution_BTVL1_GPU()
|
||||
{
|
||||
return new BTVL1_GPU;
|
||||
return makePtr<BTVL1_GPU>();
|
||||
}
|
||||
|
||||
#endif // HAVE_CUDA
|
||||
|
@ -743,6 +743,6 @@ namespace
|
||||
|
||||
Ptr<SuperResolution> cv::superres::createSuperResolution_BTVL1_OCL()
|
||||
{
|
||||
return new BTVL1_OCL;
|
||||
return makePtr<BTVL1_OCL>();
|
||||
}
|
||||
#endif
|
||||
|
@ -74,7 +74,7 @@ namespace
|
||||
|
||||
Ptr<FrameSource> cv::superres::createFrameSource_Empty()
|
||||
{
|
||||
return new EmptyFrameSource;
|
||||
return makePtr<EmptyFrameSource>();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
@ -186,12 +186,12 @@ namespace
|
||||
|
||||
Ptr<FrameSource> cv::superres::createFrameSource_Video(const String& fileName)
|
||||
{
|
||||
return new VideoFrameSource(fileName);
|
||||
return makePtr<VideoFrameSource>(fileName);
|
||||
}
|
||||
|
||||
Ptr<FrameSource> cv::superres::createFrameSource_Camera(int deviceId)
|
||||
{
|
||||
return new CameraFrameSource(deviceId);
|
||||
return makePtr<CameraFrameSource>(deviceId);
|
||||
}
|
||||
|
||||
#endif // HAVE_OPENCV_HIGHGUI
|
||||
@ -257,7 +257,7 @@ namespace
|
||||
|
||||
Ptr<FrameSource> cv::superres::createFrameSource_Video_GPU(const String& fileName)
|
||||
{
|
||||
return new VideoFrameSource(fileName);
|
||||
return makePtr<VideoFrameSource>(fileName);
|
||||
}
|
||||
|
||||
#endif // HAVE_OPENCV_GPUCODEC
|
||||
|
@ -169,7 +169,7 @@ namespace
|
||||
|
||||
Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_Farneback()
|
||||
{
|
||||
return new Farneback;
|
||||
return makePtr<Farneback>();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
@ -258,7 +258,7 @@ namespace
|
||||
|
||||
Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_Simple()
|
||||
{
|
||||
return new Simple;
|
||||
return makePtr<Simple>();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
@ -337,7 +337,7 @@ namespace
|
||||
|
||||
Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_DualTVL1()
|
||||
{
|
||||
return new DualTVL1;
|
||||
return makePtr<DualTVL1>();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
@ -503,7 +503,7 @@ namespace
|
||||
|
||||
Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_Brox_GPU()
|
||||
{
|
||||
return new Brox_GPU;
|
||||
return makePtr<Brox_GPU>();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
@ -562,7 +562,7 @@ namespace
|
||||
|
||||
Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_PyrLK_GPU()
|
||||
{
|
||||
return new PyrLK_GPU;
|
||||
return makePtr<PyrLK_GPU>();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
@ -636,7 +636,7 @@ namespace
|
||||
|
||||
Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_Farneback_GPU()
|
||||
{
|
||||
return new Farneback_GPU;
|
||||
return makePtr<Farneback_GPU>();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
@ -714,7 +714,7 @@ namespace
|
||||
|
||||
Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_DualTVL1_GPU()
|
||||
{
|
||||
return new DualTVL1_GPU;
|
||||
return makePtr<DualTVL1_GPU>();
|
||||
}
|
||||
|
||||
#endif // HAVE_OPENCV_GPUOPTFLOW
|
||||
@ -827,7 +827,7 @@ namespace
|
||||
|
||||
Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_PyrLK_OCL()
|
||||
{
|
||||
return new PyrLK_OCL;
|
||||
return makePtr<PyrLK_OCL>();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
@ -906,7 +906,7 @@ namespace
|
||||
|
||||
Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_DualTVL1_OCL()
|
||||
{
|
||||
return new DualTVL1_OCL;
|
||||
return makePtr<DualTVL1_OCL>();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
@ -980,7 +980,7 @@ namespace
|
||||
|
||||
Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_Farneback_OCL()
|
||||
{
|
||||
return new FarneBack_OCL;
|
||||
return makePtr<FarneBack_OCL>();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -59,7 +59,7 @@ private:
|
||||
AllignedFrameSource::AllignedFrameSource(const cv::Ptr<cv::superres::FrameSource>& base, int scale) :
|
||||
base_(base), scale_(scale)
|
||||
{
|
||||
CV_Assert( !base_.empty() );
|
||||
CV_Assert( base_ );
|
||||
}
|
||||
|
||||
void AllignedFrameSource::nextFrame(cv::OutputArray frame)
|
||||
@ -101,7 +101,7 @@ private:
|
||||
DegradeFrameSource::DegradeFrameSource(const cv::Ptr<cv::superres::FrameSource>& base, int scale) :
|
||||
base_(base), iscale_(1.0 / scale)
|
||||
{
|
||||
CV_Assert( !base_.empty() );
|
||||
CV_Assert( base_ );
|
||||
}
|
||||
|
||||
void addGaussNoise(cv::Mat& image, double sigma)
|
||||
@ -229,7 +229,8 @@ void SuperResolution::RunTest(cv::Ptr<cv::superres::SuperResolution> superRes)
|
||||
superRes->set("temporalAreaRadius", temporalAreaRadius);
|
||||
|
||||
cv::Ptr<cv::superres::FrameSource> goldSource(new AllignedFrameSource(cv::superres::createFrameSource_Video(inputVideoName), scale));
|
||||
cv::Ptr<cv::superres::FrameSource> lowResSource(new DegradeFrameSource(new AllignedFrameSource(cv::superres::createFrameSource_Video(inputVideoName), scale), scale));
|
||||
cv::Ptr<cv::superres::FrameSource> lowResSource(new DegradeFrameSource(
|
||||
cv::makePtr<AllignedFrameSource>(cv::superres::createFrameSource_Video(inputVideoName), scale), scale));
|
||||
|
||||
// skip first frame
|
||||
cv::Mat frame;
|
||||
|
Loading…
Reference in New Issue
Block a user