OpenCV453
superres.hpp
1/*M///////////////////////////////////////////////////////////////////////////////////////
2//
3// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4//
5// By downloading, copying, installing or using the software you agree to this license.
6// If you do not agree to this license, do not download, install,
7// copy or use the software.
8//
9//
10// License Agreement
11// For Open Source Computer Vision Library
12//
13// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
15// Third party copyrights are property of their respective owners.
16//
17// Redistribution and use in source and binary forms, with or without modification,
18// are permitted provided that the following conditions are met:
19//
20// * Redistribution's of source code must retain the above copyright notice,
21// this list of conditions and the following disclaimer.
22//
23// * Redistribution's in binary form must reproduce the above copyright notice,
24// this list of conditions and the following disclaimer in the documentation
25// and/or other materials provided with the distribution.
26//
27// * The name of the copyright holders may not be used to endorse or promote products
28// derived from this software without specific prior written permission.
29//
30// This software is provided by the copyright holders and contributors "as is" and
31// any express or implied warranties, including, but not limited to, the implied
32// warranties of merchantability and fitness for a particular purpose are disclaimed.
33// In no event shall the Intel Corporation or contributors be liable for any direct,
34// indirect, incidental, special, exemplary, or consequential damages
35// (including, but not limited to, procurement of substitute goods or services;
36// loss of use, data, or profits; or business interruption) however caused
37// and on any theory of liability, whether in contract, strict liability,
38// or tort (including negligence or otherwise) arising in any way out of
39// the use of this software, even if advised of the possibility of such damage.
40//
41//M*/
42
43#ifndef OPENCV_SUPERRES_HPP
44#define OPENCV_SUPERRES_HPP
45
46#include "opencv2/core.hpp"
47#include "opencv2/superres/optical_flow.hpp"
48
58namespace cv
59{
60 namespace superres
61 {
62
65
66 class CV_EXPORTS FrameSource
67 {
68 public:
69 virtual ~FrameSource();
70
71 virtual void nextFrame(OutputArray frame) = 0;
72 virtual void reset() = 0;
73 };
74
75 CV_EXPORTS Ptr<FrameSource> createFrameSource_Empty();
76
77 CV_EXPORTS Ptr<FrameSource> createFrameSource_Video(const String& fileName);
78 CV_EXPORTS Ptr<FrameSource> createFrameSource_Video_CUDA(const String& fileName);
79
80 CV_EXPORTS Ptr<FrameSource> createFrameSource_Camera(int deviceId = 0);
81
87 class CV_EXPORTS SuperResolution : public cv::Algorithm, public FrameSource
88 {
89 public:
94 void setInput(const Ptr<FrameSource>& frameSource);
95
100 void nextFrame(OutputArray frame) CV_OVERRIDE;
101 void reset() CV_OVERRIDE;
102
105 virtual void collectGarbage();
106
108
109 virtual int getScale() const = 0;
111 virtual void setScale(int val) = 0;
112
114
115 virtual int getIterations() const = 0;
117 virtual void setIterations(int val) = 0;
118
120
121 virtual double getTau() const = 0;
123 virtual void setTau(double val) = 0;
124
126
127 virtual double getLambda() const = 0;
129 virtual void setLambda(double val) = 0;
130
132
133 virtual double getAlpha() const = 0;
135 virtual void setAlpha(double val) = 0;
136
138
139 virtual int getKernelSize() const = 0;
141 virtual void setKernelSize(int val) = 0;
142
144
145 virtual int getBlurKernelSize() const = 0;
147 virtual void setBlurKernelSize(int val) = 0;
148
150
151 virtual double getBlurSigma() const = 0;
153 virtual void setBlurSigma(double val) = 0;
154
156
157 virtual int getTemporalAreaRadius() const = 0;
159 virtual void setTemporalAreaRadius(int val) = 0;
160
162
163 virtual Ptr<cv::superres::DenseOpticalFlowExt> getOpticalFlow() const = 0;
165 virtual void setOpticalFlow(const Ptr<cv::superres::DenseOpticalFlowExt> &val) = 0;
166
167 protected:
169
170 virtual void initImpl(Ptr<FrameSource>& frameSource) = 0;
171 virtual void processImpl(Ptr<FrameSource>& frameSource, OutputArray output) = 0;
172
173 bool isUmat_;
174
175 private:
176 Ptr<FrameSource> frameSource_;
177 bool firstCall_;
178 };
179
200 CV_EXPORTS Ptr<SuperResolution> createSuperResolution_BTVL1_CUDA();
201
203
204 }
205}
206
207#endif // OPENCV_SUPERRES_HPP
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:295
This is a base class for all more or less complex algorithms in OpenCV
Definition: core.hpp:3091
Definition: superres/optical_flow.hpp:57
Definition: superres.hpp:67
Base class for Super Resolution algorithms.
Definition: superres.hpp:88
void nextFrame(OutputArray frame) CV_OVERRIDE
Process next frame from input and return output result.
void setInput(const Ptr< FrameSource > &frameSource)
Set input frame source for Super Resolution algorithm.
CV_EXPORTS Ptr< SuperResolution > createSuperResolution_BTVL1()
Create Bilateral TV-L1 Super Resolution.
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74