OpenCV 4.12.0
开源计算机视觉
加载中...
搜索中...
无匹配项
cv::dnn_superres::DnnSuperResImpl 类参考

一个通过卷积神经网络放大图像的类。实现了以下四种模型: 更多...

#include <opencv2/dnn_superres.hpp>

cv::dnn_superres::DnnSuperResImpl 的协作图

公共成员函数

 DnnSuperResImpl ()
 空构造函数。
 
 DnnSuperResImpl (const String &algo, int scale)
 立即设置所需模型的构造函数。
 
String getAlgorithm ()
 返回模型的缩放因子
 
int getScale ()
 返回模型的缩放因子
 
void readModel (const String &path)
 从给定路径读取模型。
 
void readModel (const String &weights, const String &definition)
 从给定路径读取模型。
 
void setModel (const String &algo, int scale)
 设置所需的模型。
 
void setPreferableBackend (int backendId)
 设置计算后端。
 
void setPreferableTarget (int targetId)
 设置计算目标。
 
void upsample (InputArray img, OutputArray result)
 通过神经网络进行放大。
 
void upsampleMultioutput (InputArray img, std::vector< Mat > &imgs_new, const std::vector< int > &scale_factors, const std::vector< String > &node_names)
 通过多个输出的神经网络进行放大。
 

静态公共成员函数

static Ptr< DnnSuperResImplcreate ()
 用于 python 的空构造函数。
 

详细描述

一个通过卷积神经网络放大图像的类。实现了以下四种模型

  • edsr
  • espcn
  • fsrcnn
  • lapsrn

构造函数 & 析构函数文档

◆ DnnSuperResImpl() [1/2]

cv::dnn_superres::DnnSuperResImpl::DnnSuperResImpl ( )

空构造函数。

◆ DnnSuperResImpl() [2/2]

cv::dnn_superres::DnnSuperResImpl::DnnSuperResImpl ( const String & algo,
int #include <opencv2/surface_matching/ppf_helpers.hpp>

立即设置所需模型的构造函数。

参数
algo包含所需模型的字符串
  • edsr
  • espcn
  • fsrcnn
  • lapsrn
scale指定放大因子的整数

成员函数文档

◆ create()

static Ptr< DnnSuperResImpl > cv::dnn_superres::DnnSuperResImpl::create ( )
static
Python
cv.dnn_superres.DnnSuperResImpl.create() -> retval
cv.dnn_superres.DnnSuperResImpl_create() -> retval

用于 python 的空构造函数。

◆ getAlgorithm()

String cv::dnn_superres::DnnSuperResImpl::getAlgorithm ( )
Python
cv.dnn_superres.DnnSuperResImpl.getAlgorithm() -> retval

返回模型的缩放因子

返回
当前算法。

◆ getScale()

int cv::dnn_superres::DnnSuperResImpl::getScale ( )
Python
cv.dnn_superres.DnnSuperResImpl.getScale() -> retval

返回模型的缩放因子

返回
当前缩放因子。

◆ readModel() [1/2]

void cv::dnn_superres::DnnSuperResImpl::readModel ( const String & 路径)
Python
cv.dnn_superres.DnnSuperResImpl.readModel(路径) ->

从给定路径读取模型。

参数
路径模型文件的路径。

◆ readModel() [2/2]

void cv::dnn_superres::DnnSuperResImpl::readModel ( const String & weights,
const String & definition )
Python
cv.dnn_superres.DnnSuperResImpl.readModel(路径) ->

从给定路径读取模型。

参数
weights模型权重文件的路径。
definition模型定义文件的路径。

◆ setModel()

void cv::dnn_superres::DnnSuperResImpl::setModel ( const String & algo,
int #include <opencv2/surface_matching/ppf_helpers.hpp>
Python
cv.dnn_superres.DnnSuperResImpl.setModel(algo, scale) ->

设置所需的模型。

参数
algo包含所需模型的字符串
  • edsr
  • espcn
  • fsrcnn
  • lapsrn
scale指定放大因子的整数

◆ setPreferableBackend()

void cv::dnn_superres::DnnSuperResImpl::setPreferableBackend ( int backendId)
Python
cv.dnn_superres.DnnSuperResImpl.setPreferableBackend(backendId) ->

设置计算后端。

◆ setPreferableTarget()

void cv::dnn_superres::DnnSuperResImpl::setPreferableTarget ( int targetId)
Python
cv.dnn_superres.DnnSuperResImpl.setPreferableTarget(targetId) ->

设置计算目标。

◆ upsample()

void cv::dnn_superres::DnnSuperResImpl::upsample ( InputArray img,
OutputArray result )
Python
cv.dnn_superres.DnnSuperResImpl.upsample(img[, result]) -> result

通过神经网络进行放大。

参数
img要放大的图像
result目标放大图像

◆ 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 )
Python
cv.dnn_superres.DnnSuperResImpl.upsampleMultioutput(img, imgs_new, scale_factors, node_names) ->

通过多个输出的神经网络进行放大。

参数
img要放大的图像
imgs_new目标放大图像
scale_factors输出节点的缩放因子
node_names神经网络中输出节点的名称

此类的文档是从以下文件生成的