Package org.opencv.dnn_superres
Class DnnSuperResImpl
- java.lang.Object
- 
- org.opencv.dnn_superres.DnnSuperResImpl
 
- 
 public class DnnSuperResImpl extends java.lang.ObjectA class to upscale images via convolutional neural networks. The following four models are implemented:- edsr
- espcn
- fsrcnn
- lapsrn
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected longnativeObj
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedDnnSuperResImpl(long addr)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DnnSuperResImpl__fromPtr__(long addr)static DnnSuperResImplcreate()Empty constructor for pythonprotected voidfinalize()java.lang.StringgetAlgorithm()Returns the scale factor of the model:longgetNativeObjAddr()intgetScale()Returns the scale factor of the model:voidreadModel(java.lang.String path)Read the model from the given pathvoidsetModel(java.lang.String algo, int scale)Set desired modelvoidsetPreferableBackend(int backendId)Set computation backendvoidsetPreferableTarget(int targetId)Set computation targetvoidupsample(Mat img, Mat result)Upsample via neural networkvoidupsampleMultioutput(Mat img, java.util.List<Mat> imgs_new, MatOfInt scale_factors, java.util.List<java.lang.String> node_names)Upsample via neural network of multiple outputs
 
- 
- 
- 
Method Detail- 
getNativeObjAddrpublic long getNativeObjAddr() 
 - 
__fromPtr__public static DnnSuperResImpl __fromPtr__(long addr) 
 - 
createpublic static DnnSuperResImpl create() Empty constructor for python- Returns:
- automatically generated
 
 - 
readModelpublic void readModel(java.lang.String path) Read the model from the given path- Parameters:
- path- Path to the model file.
 
 - 
setModelpublic void setModel(java.lang.String algo, int scale)Set desired model- Parameters:
- algo- String containing one of the desired models:- __edsr__
- __espcn__
- __fsrcnn__
- __lapsrn__
 
- scale- Integer specifying the upscale factor
 
 - 
setPreferableBackendpublic void setPreferableBackend(int backendId) Set computation backend- Parameters:
- backendId- automatically generated
 
 - 
setPreferableTargetpublic void setPreferableTarget(int targetId) Set computation target- Parameters:
- targetId- automatically generated
 
 - 
upsamplepublic void upsample(Mat img, Mat result) Upsample via neural network- Parameters:
- img- Image to upscale
- result- Destination upscaled image
 
 - 
upsampleMultioutputpublic void upsampleMultioutput(Mat img, java.util.List<Mat> imgs_new, MatOfInt scale_factors, java.util.List<java.lang.String> node_names) Upsample via neural network of multiple outputs- Parameters:
- img- Image to upscale
- imgs_new- Destination upscaled images
- scale_factors- Scaling factors of the output nodes
- node_names- Names of the output nodes in the neural network
 
 - 
getScalepublic int getScale() Returns the scale factor of the model:- Returns:
- Current scale factor.
 
 - 
getAlgorithmpublic java.lang.String getAlgorithm() Returns the scale factor of the model:- Returns:
- Current algorithm.
 
 - 
finalizeprotected void finalize() throws java.lang.Throwable- Overrides:
- finalizein class- java.lang.Object
- Throws:
- java.lang.Throwable
 
 
- 
 
-