opencv::mod_prelude

Trait DnnSuperResImplTrait

Source
pub trait DnnSuperResImplTrait: DnnSuperResImplTraitConst {
    // Required method
    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<()> { ... }
    fn set_model(&mut self, algo: &str, scale: i32) -> Result<()> { ... }
    fn set_preferable_backend(&mut self, backend_id: i32) -> Result<()> { ... }
    fn set_preferable_target(&mut self, target_id: i32) -> Result<()> { ... }
    fn upsample(
        &mut self,
        img: &impl ToInputArray,
        result: &mut impl ToOutputArray,
    ) -> Result<()> { ... }
    fn upsample_multioutput(
        &mut self,
        img: &impl 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> { ... }
}
Expand description

Required Methods§

Provided Methods§

Source

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

Read the model from the given path

§Parameters
  • path: Path to the model file.
Source

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.
Source

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
Source

fn set_preferable_backend(&mut self, backend_id: i32) -> Result<()>

Set computation backend

Source

fn set_preferable_target(&mut self, target_id: i32) -> Result<()>

Set computation target

Source

fn upsample( &mut self, img: &impl ToInputArray, result: &mut impl ToOutputArray, ) -> Result<()>

Upsample via neural network

§Parameters
  • img: Image to upscale
  • result: Destination upscaled image
Source

fn upsample_multioutput( &mut self, img: &impl 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
Source

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

Returns the scale factor of the model:

§Returns

Current scale factor.

Source

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

Returns the scale factor of the model:

§Returns

Current algorithm.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§