Show / Hide Table of Contents

Class DnnSuperResImpl

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

  • edsr
  • espcn
  • fsrcnn
  • lapsrn
Inheritance
System.Object
DisposableObject
DisposableCvObject
DnnSuperResImpl
Implements
ICvPtrHolder
Inherited Members
DisposableCvObject.ptr
DisposableCvObject.CvPtr
DisposableObject.DataHandle
DisposableObject.IsDisposed
DisposableObject.IsEnabledDispose
DisposableObject.AllocatedMemory
DisposableObject.AllocatedMemorySize
DisposableObject.Dispose()
DisposableObject.Dispose(Boolean)
DisposableObject.DisposeManaged()
DisposableObject.AllocGCHandle(Object)
DisposableObject.AllocMemory(Int32)
DisposableObject.NotifyMemoryPressure(Int64)
DisposableObject.ThrowIfDisposed()
Namespace: OpenCvSharp.DnnSuperres
Assembly: OpenCvSharp.dll
Syntax
public class DnnSuperResImpl : DisposableCvObject, ICvPtrHolder

Constructors

| Improve this Doc View Source

DnnSuperResImpl()

Empty constructor

Declaration
public DnnSuperResImpl()
| Improve this Doc View Source

DnnSuperResImpl(IntPtr)

Declaration
protected DnnSuperResImpl(IntPtr ptr)
Parameters
Type Name Description
IntPtr ptr
| Improve this Doc View Source

DnnSuperResImpl(String, Int32)

Constructor which immediately sets the desired model

Declaration
public DnnSuperResImpl(string algo, int scale)
Parameters
Type Name Description
System.String algo

String containing one of the desired models:

  • edsr
  • espcn
  • fsrcnn
  • lapsrn
System.Int32 scale

Integer specifying the upscale factor

Methods

| Improve this Doc View Source

DisposeUnmanaged()

Declaration
protected override void DisposeUnmanaged()
Overrides
DisposableCvObject.DisposeUnmanaged()
| Improve this Doc View Source

GetAlgorithm()

Returns the scale factor of the model

Declaration
public string GetAlgorithm()
Returns
Type Description
System.String

Current algorithm.

| Improve this Doc View Source

GetScale()

Returns the scale factor of the model

Declaration
public int GetScale()
Returns
Type Description
System.Int32

Current scale factor.

| Improve this Doc View Source

ReadModel(String)

Read the model from the given path

Declaration
public void ReadModel(string path)
Parameters
Type Name Description
System.String path

Path to the model file.

| Improve this Doc View Source

ReadModel(String, String)

Read the model from the given path

Declaration
public void ReadModel(string weights, string definition)
Parameters
Type Name Description
System.String weights

Path to the model weights file.

System.String definition

Path to the model definition file.

| Improve this Doc View Source

SetModel(String, Int32)

Set desired model

Declaration
public void SetModel(string algo, int scale)
Parameters
Type Name Description
System.String algo

String containing one of the desired models:

  • edsr
  • espcn
  • fsrcnn
  • lapsrn
System.Int32 scale

Integer specifying the upscale factor

| Improve this Doc View Source

SetPreferableBackend(Backend)

Ask network to use specific computation backend where it supported.

Declaration
public void SetPreferableBackend(Backend backendId)
Parameters
Type Name Description
Backend backendId

backend identifier.

| Improve this Doc View Source

SetPreferableTarget(Target)

Ask network to make computations on specific target device.

Declaration
public void SetPreferableTarget(Target targetId)
Parameters
Type Name Description
Target targetId

target identifier.

| Improve this Doc View Source

Upsample(InputArray, OutputArray)

Upsample via neural network

Declaration
public void Upsample(InputArray img, OutputArray result)
Parameters
Type Name Description
InputArray img

Image to upscale

OutputArray result

Destination upscaled image

| Improve this Doc View Source

UpsampleMultioutput(InputArray, out Mat[], IEnumerable<Int32>, IEnumerable<String>)

Upsample via neural network of multiple outputs

Declaration
public void UpsampleMultioutput(InputArray img, out Mat[] imgsNew, IEnumerable<int> scaleFactors, IEnumerable<string> nodeNames)
Parameters
Type Name Description
InputArray img

Image to upscale

Mat[] imgsNew

Destination upscaled images

IEnumerable<System.Int32> scaleFactors

Scaling factors of the output nodes

IEnumerable<System.String> nodeNames

Names of the output nodes in the neural network

Implements

ICvPtrHolder
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX