[][src]Trait opencv::hub_prelude::DnnSuperResImplTrait

pub trait DnnSuperResImplTrait {
    pub fn as_raw_DnnSuperResImpl(&self) -> *const c_void;
pub fn as_raw_mut_DnnSuperResImpl(&mut self) -> *mut c_void; pub fn read_model(&mut self, path: &str) -> Result<()> { ... }
pub fn read_model_1(
        &mut self,
        weights: &str,
        definition: &str
    ) -> Result<()> { ... }
pub fn set_model(&mut self, algo: &str, scale: i32) -> Result<()> { ... }
pub fn set_preferable_backend(&mut self, backend_id: i32) -> Result<()> { ... }
pub fn set_preferable_target(&mut self, target_id: i32) -> Result<()> { ... }
pub fn upsample(
        &mut self,
        img: &dyn ToInputArray,
        result: &mut dyn ToOutputArray
    ) -> Result<()> { ... }
pub fn upsample_multioutput(
        &mut self,
        img: &dyn ToInputArray,
        imgs_new: &mut Vector<Mat>,
        scale_factors: &Vector<i32>,
        node_names: &Vector<String>
    ) -> Result<()> { ... }
pub fn get_scale(&mut self) -> Result<i32> { ... }
pub 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

pub fn read_model(&mut self, path: &str) -> Result<()>[src]

Read the model from the given path

Parameters

  • path: Path to the model file.

pub fn read_model_1(&mut self, weights: &str, definition: &str) -> Result<()>[src]

Read the model from the given path

Parameters

  • weights: Path to the model weights file.
  • definition: Path to the model definition file.

pub fn set_model(&mut self, algo: &str, scale: i32) -> Result<()>[src]

Set desired model

Parameters

  • algo: String containing one of the desired models:
    • edsr
    • espcn
    • fsrcnn
    • lapsrn
  • scale: Integer specifying the upscale factor

pub fn set_preferable_backend(&mut self, backend_id: i32) -> Result<()>[src]

Set computation backend

pub fn set_preferable_target(&mut self, target_id: i32) -> Result<()>[src]

Set computation target

pub fn upsample(
    &mut self,
    img: &dyn ToInputArray,
    result: &mut dyn ToOutputArray
) -> Result<()>
[src]

Upsample via neural network

Parameters

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

pub fn upsample_multioutput(
    &mut self,
    img: &dyn ToInputArray,
    imgs_new: &mut Vector<Mat>,
    scale_factors: &Vector<i32>,
    node_names: &Vector<String>
) -> Result<()>
[src]

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

pub fn get_scale(&mut self) -> Result<i32>[src]

Returns the scale factor of the model:

Returns

Current scale factor.

pub fn get_algorithm(&mut self) -> Result<String>[src]

Returns the scale factor of the model:

Returns

Current algorithm.

Loading content...

Implementors

impl DnnSuperResImplTrait for DnnSuperResImpl[src]

impl DnnSuperResImplTrait for PtrOfDnnSuperResImpl[src]

Loading content...