Closed mexicantexan closed 4 months ago
Not being able to extract Mat
to not lose lifetime information was one of the goals of introducing BoxedRef
so it’s not possible. To fix the issue you’re encountering you’ll need to update the signature of crop
function to take &impl MatTraitConst
instead of &Mat
to match what roi function expects.
I was going through and updating the opencv dependency in my Rust project. Due to some breaking changes, functions that previously returned a Mat now return a BoxedRef. How would I return the underlying Mat without cloning? Here is an example couple lines of code:
Now returns the error:
Is there any way to "unwrap" the Mat out of the BoxedRef? I'm trying to avoid cloning if possible, but I'm a bit confused on how to do this with how the crate currently functions.
Opencv Version: 0.91.3 OS: Ubuntu 22.04 Edition: 2021 Cargo Version: 1.77