OpenCV for Unity  2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl Class Reference

A class to upscale images via convolutional neural networks. The following four models are implemented: More...

Inheritance diagram for OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl:
OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableObject

Public Member Functions

IntPtr getNativeObjAddr ()
 
void readModel (string path)
 Read the model from the given path. More...
 
void setModel (string algo, int scale)
 Set desired model. More...
 
void setPreferableBackend (int backendId)
 Set computation backend. More...
 
void setPreferableTarget (int targetId)
 Set computation target. More...
 
void upsample (Mat img, Mat result)
 Upsample via neural network. More...
 
void upsampleMultioutput (Mat img, List< Mat > imgs_new, MatOfInt scale_factors, List< string > node_names)
 Upsample via neural network of multiple outputs. More...
 
int getScale ()
 Returns the scale factor of the model: More...
 
string getAlgorithm ()
 Returns the scale factor of the model: More...
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static DnnSuperResImpl __fromPtr__ (IntPtr addr)
 
static DnnSuperResImpl create ()
 Empty constructor for python. More...
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

A class to upscale images via convolutional neural networks. The following four models are implemented:

Member Function Documentation

◆ __fromPtr__()

static DnnSuperResImpl OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl.__fromPtr__ ( IntPtr  addr)
static

◆ create()

static DnnSuperResImpl OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl.create ( )
static

Empty constructor for python.

◆ Dispose()

override void OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl.Dispose ( bool  disposing)
protectedvirtual

◆ getAlgorithm()

string OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl.getAlgorithm ( )

Returns the scale factor of the model:

Returns
Current algorithm.

◆ getNativeObjAddr()

IntPtr OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl.getNativeObjAddr ( )

◆ getScale()

int OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl.getScale ( )

Returns the scale factor of the model:

Returns
Current scale factor.

◆ readModel()

void OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl.readModel ( string  path)

Read the model from the given path.

Parameters
pathPath to the model file.

◆ setModel()

void OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl.setModel ( string  algo,
int  scale 
)

Set desired model.

Parameters
algoString containing one of the desired models:
  • edsr
  • espcn
  • fsrcnn
  • lapsrn
scaleInteger specifying the upscale factor

◆ setPreferableBackend()

void OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl.setPreferableBackend ( int  backendId)

Set computation backend.

◆ setPreferableTarget()

void OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl.setPreferableTarget ( int  targetId)

Set computation target.

◆ upsample()

void OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl.upsample ( Mat  img,
Mat  result 
)

Upsample via neural network.

Parameters
imgImage to upscale
resultDestination upscaled image

◆ upsampleMultioutput()

void OpenCVForUnity.Dnn_superresModule.DnnSuperResImpl.upsampleMultioutput ( Mat  img,
List< Mat imgs_new,
MatOfInt  scale_factors,
List< string >  node_names 
)

Upsample via neural network of multiple outputs.

Parameters
imgImage to upscale
imgs_newDestination upscaled images
scale_factorsScaling factors of the output nodes
node_namesNames of the output nodes in the neural network

The documentation for this class was generated from the following file: