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神經網路中輸出節點的名稱

此類的文件是從以下檔案生成的