[−][src]Trait opencv::prelude::DnnSuperResImplTrait
A class to upscale images via convolutional neural networks. The following four models are implemented:
- edsr
- espcn
- fsrcnn
- lapsrn
Required methods
fn as_raw_DnnSuperResImpl(&self) -> *const c_void
fn as_raw_mut_DnnSuperResImpl(&mut self) -> *mut c_void
Provided methods
fn read_model(&mut self, path: &str) -> Result<()>
fn read_model_1(&mut self, weights: &str, definition: &str) -> Result<()>
Read the model from the given path
Parameters
- weights: Path to the model weights file.
- definition: Path to the model definition file.
fn set_model(&mut self, algo: &str, scale: i32) -> Result<()>
Set desired model
Parameters
- algo: String containing one of the desired models:
- edsr
- espcn
- fsrcnn
- lapsrn
- scale: Integer specifying the upscale factor
fn upsample(
&mut self,
img: &dyn ToInputArray,
result: &mut dyn ToOutputArray
) -> Result<()>
&mut self,
img: &dyn ToInputArray,
result: &mut dyn ToOutputArray
) -> Result<()>
fn upsample_multioutput(
&mut self,
img: &dyn ToInputArray,
imgs_new: &mut Vector<Mat>,
scale_factors: &Vector<i32>,
node_names: &Vector<String>
) -> Result<()>
&mut self,
img: &dyn ToInputArray,
imgs_new: &mut Vector<Mat>,
scale_factors: &Vector<i32>,
node_names: &Vector<String>
) -> Result<()>
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