Loading...
Searching...
No Matches
cv::dnn_superres::DnnSuperResImpl Class Reference
A class to upscale images via convolutional neural networks. The following four models are implemented: More...
#include <opencv2/dnn_superres.hpp>
Public Member Functions | |
DnnSuperResImpl () | |
DnnSuperResImpl (const String &algo, int scale) | |
Constructor which immediately sets the desired model. | |
String | getAlgorithm () |
Returns the scale factor of the model: | |
int | getScale () |
Returns the scale factor of the model: | |
void | readModel (const String &path) |
Read the model from the given path. | |
void | readModel (const String &weights, const String &definition) |
Read the model from the given path. | |
void | setModel (const String &algo, int scale) |
Set desired model. | |
void | setPreferableBackend (int backendId) |
Set computation backend. | |
void | setPreferableTarget (int targetId) |
Set computation target. | |
void | upsample (InputArray img, OutputArray result) |
Upsample via neural network. | |
void | upsampleMultioutput (InputArray img, std::vector< Mat > &imgs_new, const std::vector< int > &scale_factors, const std::vector< String > &node_names) |
Upsample via neural network of multiple outputs. | |
Static Public Member Functions | |
static Ptr< DnnSuperResImpl > | create () |
Empty constructor for python. | |
Detailed Description
A class to upscale images via convolutional neural networks. The following four models are implemented:
- edsr
- espcn
- fsrcnn
- lapsrn
Constructor & Destructor Documentation
◆ DnnSuperResImpl() [1/2]
cv::dnn_superres::DnnSuperResImpl::DnnSuperResImpl | ( | ) |
◆ DnnSuperResImpl() [2/2]
cv::dnn_superres::DnnSuperResImpl::DnnSuperResImpl | ( | const String & | algo, |
int | scale | ||
) |
Constructor which immediately sets the desired model.
- Parameters
-
algo String containing one of the desired models: - edsr
- espcn
- fsrcnn
- lapsrn
scale Integer specifying the upscale factor
Member Function Documentation
◆ create()
|
static |
Empty constructor for python.
◆ getAlgorithm()
String cv::dnn_superres::DnnSuperResImpl::getAlgorithm | ( | ) |
Returns the scale factor of the model:
- Returns
- Current algorithm.
◆ getScale()
int cv::dnn_superres::DnnSuperResImpl::getScale | ( | ) |
Returns the scale factor of the model:
- Returns
- Current scale factor.
◆ readModel() [1/2]
void cv::dnn_superres::DnnSuperResImpl::readModel | ( | const String & | path | ) |
Read the model from the given path.
- Parameters
-
path Path to the model file.
◆ readModel() [2/2]
void cv::dnn_superres::DnnSuperResImpl::readModel | ( | const String & | weights, |
const String & | definition | ||
) |
Read the model from the given path.
- Parameters
-
weights Path to the model weights file. definition Path to the model definition file.
◆ setModel()
void cv::dnn_superres::DnnSuperResImpl::setModel | ( | const String & | algo, |
int | scale | ||
) |
Set desired model.
- Parameters
-
algo String containing one of the desired models: - edsr
- espcn
- fsrcnn
- lapsrn
scale Integer specifying the upscale factor
◆ setPreferableBackend()
void cv::dnn_superres::DnnSuperResImpl::setPreferableBackend | ( | int | backendId | ) |
Set computation backend.
◆ setPreferableTarget()
void cv::dnn_superres::DnnSuperResImpl::setPreferableTarget | ( | int | targetId | ) |
Set computation target.
◆ upsample()
void cv::dnn_superres::DnnSuperResImpl::upsample | ( | InputArray | img, |
OutputArray | result | ||
) |
Upsample via neural network.
- Parameters
-
img Image to upscale result Destination upscaled image
◆ upsampleMultioutput()
void cv::dnn_superres::DnnSuperResImpl::upsampleMultioutput | ( | InputArray | img, |
std::vector< Mat > & | imgs_new, | ||
const std::vector< int > & | scale_factors, | ||
const std::vector< String > & | node_names | ||
) |
Upsample via neural network of multiple outputs.
- Parameters
-
img Image to upscale imgs_new Destination upscaled images scale_factors Scaling factors of the output nodes node_names Names of the output nodes in the neural network
The documentation for this class was generated from the following file:
- opencv2/dnn_superres.hpp