OpenCV 4.5.3(日本語機械翻訳)
dnn_superres.hpp
1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
4
5 #ifndef _OPENCV_DNN_SUPERRES_HPP_
6 #define _OPENCV_DNN_SUPERRES_HPP_
7
20 #include "opencv2/core.hpp"
21 #include "opencv2/dnn.hpp"
22
23 namespace cv
24{
25 namespace dnn_superres
26{
27
30
40 class CV_EXPORTS_W DnnSuperResImpl
41{
42 private:
43
46 dnn::Net net;
47
48 std::string alg; //algorithm
49
50 int sc; //scale factor
51
52 void reconstruct_YCrCb(InputArray inpImg, InputArray origImg, OutputArray outpImg, int scale);
53
54 void preprocess_YCrCb(InputArray inpImg, OutputArray outpImg);
55
56 public:
57
60 CV_WRAP static Ptr<DnnSuperResImpl> create();
61
62 // /** @brief Empty constructor
63 // */
65
74 DnnSuperResImpl(const String& algo, int scale);
75
79 CV_WRAP void readModel(const String& path);
80
85 void readModel(const String& weights, const String& definition);
86
95 CV_WRAP void setModel(const String& algo, int scale);
96
99 CV_WRAP void setPreferableBackend(int backendId);
100
103 CV_WRAP void setPreferableTarget(int targetId);
104
109 CV_WRAP void upsample(InputArray img, OutputArray result);
110
117 CV_WRAP void upsampleMultioutput(InputArray img, std::vector<Mat> &imgs_new, const std::vector<int>& scale_factors, const std::vector<String>& node_names);
118
122 CV_WRAP int getScale();
123
127 CV_WRAP String getAlgorithm();
128};
129
131
132}} // cv::dnn_superres::
133 #endif
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:295
This class allows to create and manipulate comprehensive artificial neural networks.
Definition: dnn/dnn.hpp:407
A class to upscale images via convolutional neural networks. The following four models are implemente...
Definition: dnn_superres.hpp:41
void readModel(const String &weights, const String &definition)
Read the model from the given path
DnnSuperResImpl(const String &algo, int scale)
Constructor which immediately sets the desired model
cv
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74