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
Mutable methods for crate::dnn_superres::DnnSuperResImpl
Required Methods§
fn as_raw_mut_DnnSuperResImpl(&mut self) -> *mut c_void
Provided Methods§
Sourcefn read_model(&mut self, path: &str) -> Result<()>
fn read_model(&mut self, path: &str) -> Result<()>
Sourcefn read_model_1(&mut self, weights: &str, definition: &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.
Sourcefn set_model(&mut self, algo: &str, scale: i32) -> Result<()>
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
Sourcefn set_preferable_backend(&mut self, backend_id: i32) -> Result<()>
fn set_preferable_backend(&mut self, backend_id: i32) -> Result<()>
Set computation backend
Sourcefn set_preferable_target(&mut self, target_id: i32) -> Result<()>
fn set_preferable_target(&mut self, target_id: i32) -> Result<()>
Set computation target
Sourcefn upsample(
&mut self,
img: &impl ToInputArray,
result: &mut impl ToOutputArray,
) -> Result<()>
fn upsample( &mut self, img: &impl ToInputArray, result: &mut impl ToOutputArray, ) -> Result<()>
Sourcefn upsample_multioutput(
&mut self,
img: &impl ToInputArray,
imgs_new: &mut Vector<Mat>,
scale_factors: &Vector<i32>,
node_names: &Vector<String>,
) -> Result<()>
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
Sourcefn get_algorithm(&mut self) -> Result<String>
fn get_algorithm(&mut self) -> Result<String>
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.