[][src]Trait opencv::prelude::DnnSuperResImplTrait

pub trait DnnSuperResImplTrait {
    fn as_raw_DnnSuperResImpl(&self) -> *const c_void;
fn as_raw_mut_DnnSuperResImpl(&mut self) -> *mut c_void; fn read_model(&mut self, path: &str) -> Result<()> { ... }
fn read_model_1(&mut self, weights: &str, definition: &str) -> Result<()> { ... }
fn set_model(&mut self, algo: &str, scale: i32) -> Result<()> { ... }
fn upsample(
        &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<()> { ... }
fn get_scale(&mut self) -> Result<i32> { ... }
fn get_algorithm(&mut self) -> Result<String> { ... } }

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

  • edsr
  • espcn
  • fsrcnn
  • lapsrn

Required methods

Loading content...

Provided methods

fn read_model(&mut self, path: &str) -> Result<()>

Read the model from the given path

Parameters

  • path: Path to the model file.

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<()>

Upsample via neural network

Parameters

  • img: Image to upscale
  • result: Destination upscaled image

fn upsample_multioutput(
    &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

fn get_scale(&mut self) -> Result<i32>

Returns the scale factor of the model:

Returns

Current scale factor.

fn get_algorithm(&mut self) -> Result<String>

Returns the scale factor of the model:

Returns

Current algorithm.

Loading content...

Implementors

Loading content...