Package org.opencv.dnn_superres
Class DnnSuperResImpl
java.lang.Object
org.opencv.dnn_superres.DnnSuperResImpl
A class to upscale images via convolutional neural networks.
The following four models are implemented:
- edsr
- espcn
- fsrcnn
- lapsrn
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DnnSuperResImpl
__fromPtr__
(long addr) static DnnSuperResImpl
create()
Empty constructor for pythonprotected void
finalize()
Returns the scale factor of the model:long
int
getScale()
Returns the scale factor of the model:void
Read the model from the given pathvoid
Set desired modelvoid
setPreferableBackend
(int backendId) Set computation backendvoid
setPreferableTarget
(int targetId) Set computation targetvoid
Upsample via neural networkvoid
Upsample via neural network of multiple outputs
-
Field Details
-
nativeObj
protected final long nativeObj
-
-
Constructor Details
-
DnnSuperResImpl
protected DnnSuperResImpl(long addr)
-
-
Method Details
-
getNativeObjAddr
public long getNativeObjAddr() -
__fromPtr__
-
create
Empty constructor for python- Returns:
- automatically generated
-
readModel
Read the model from the given path- Parameters:
path
- Path to the model file.
-
setModel
Set desired model- Parameters:
algo
- String containing one of the desired models:- __edsr__
- __espcn__
- __fsrcnn__
- __lapsrn__
scale
- Integer specifying the upscale factor
-
setPreferableBackend
public void setPreferableBackend(int backendId) Set computation backend- Parameters:
backendId
- automatically generated
-
setPreferableTarget
public void setPreferableTarget(int targetId) Set computation target- Parameters:
targetId
- automatically generated
-
upsample
Upsample via neural network- Parameters:
img
- Image to upscaleresult
- Destination upscaled image
-
upsampleMultioutput
public void upsampleMultioutput(Mat img, List<Mat> imgs_new, MatOfInt scale_factors, List<String> node_names) Upsample via neural network of multiple outputs- Parameters:
img
- Image to upscaleimgs_new
- Destination upscaled imagesscale_factors
- Scaling factors of the output nodesnode_names
- Names of the output nodes in the neural network
-
getScale
public int getScale()Returns the scale factor of the model:- Returns:
- Current scale factor.
-
getAlgorithm
Returns the scale factor of the model:- Returns:
- Current algorithm.
-
finalize
-