pub enum CvError {
Show 17 variants
InvalidDimensions {
width: u32,
height: u32,
},
InvalidRoi {
x: u32,
y: u32,
width: u32,
height: u32,
},
InvalidKernelSize {
size: usize,
},
ColorConversion {
message: String,
},
UnsupportedFormat {
format: String,
},
DetectionFailed {
message: String,
},
TransformError {
message: String,
},
TrackingError {
message: String,
},
InsufficientData {
expected: usize,
actual: usize,
},
MatrixError {
message: String,
},
InvalidParameter {
name: String,
value: String,
},
Core(OxiError),
OnnxRuntime {
message: String,
},
ModelLoad {
message: String,
},
TensorError {
message: String,
},
ShapeMismatch {
expected: Vec<usize>,
actual: Vec<usize>,
},
Io(Error),
}Expand description
Error type for computer vision operations.
This enum covers all possible errors that can occur during image processing, detection, and transformation operations.
§Examples
use oximedia_cv::error::{CvError, CvResult};
fn process_image(width: u32, height: u32) -> CvResult<()> {
if width == 0 || height == 0 {
return Err(CvError::InvalidDimensions { width, height });
}
Ok(())
}Variants§
InvalidDimensions
Invalid image dimensions (width or height is zero).
InvalidRoi
Invalid region of interest.
Fields
InvalidKernelSize
Invalid kernel size for filter operations.
ColorConversion
Color space conversion error.
UnsupportedFormat
Unsupported pixel format.
DetectionFailed
Detection failed.
TransformError
Transform computation failed.
TrackingError
Tracking operation failed.
InsufficientData
Insufficient data for operation.
MatrixError
Matrix operation error.
InvalidParameter
Invalid parameter value.
Core(OxiError)
Core error from oximedia-core.
OnnxRuntime
ONNX Runtime error.
ModelLoad
Model loading error.
TensorError
Tensor operation error.
ShapeMismatch
Shape mismatch error.
Io(Error)
I/O error.
Implementations§
Source§impl CvError
impl CvError
Sourcepub const fn invalid_dimensions(width: u32, height: u32) -> Self
pub const fn invalid_dimensions(width: u32, height: u32) -> Self
Creates a new invalid dimensions error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::invalid_dimensions(0, 100);
assert!(matches!(err, CvError::InvalidDimensions { width: 0, height: 100 }));Sourcepub const fn invalid_roi(x: u32, y: u32, width: u32, height: u32) -> Self
pub const fn invalid_roi(x: u32, y: u32, width: u32, height: u32) -> Self
Creates a new invalid ROI error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::invalid_roi(10, 20, 0, 50);
assert!(matches!(err, CvError::InvalidRoi { .. }));Sourcepub const fn invalid_kernel_size(size: usize) -> Self
pub const fn invalid_kernel_size(size: usize) -> Self
Creates a new invalid kernel size error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::invalid_kernel_size(4);
assert!(matches!(err, CvError::InvalidKernelSize { size: 4 }));Sourcepub fn color_conversion(message: impl Into<String>) -> Self
pub fn color_conversion(message: impl Into<String>) -> Self
Creates a new color conversion error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::color_conversion("Invalid color values");
assert!(matches!(err, CvError::ColorConversion { .. }));Sourcepub fn unsupported_format(format: impl Into<String>) -> Self
pub fn unsupported_format(format: impl Into<String>) -> Self
Creates a new unsupported format error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::unsupported_format("YUV444");
assert!(matches!(err, CvError::UnsupportedFormat { .. }));Sourcepub fn detection_failed(message: impl Into<String>) -> Self
pub fn detection_failed(message: impl Into<String>) -> Self
Creates a new detection failed error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::detection_failed("No faces found");
assert!(matches!(err, CvError::DetectionFailed { .. }));Sourcepub fn transform_error(message: impl Into<String>) -> Self
pub fn transform_error(message: impl Into<String>) -> Self
Creates a new transform error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::transform_error("Matrix is singular");
assert!(matches!(err, CvError::TransformError { .. }));Sourcepub fn tracking_error(message: impl Into<String>) -> Self
pub fn tracking_error(message: impl Into<String>) -> Self
Creates a new tracking error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::tracking_error("Tracker not initialized");
assert!(matches!(err, CvError::TrackingError { .. }));Sourcepub const fn insufficient_data(expected: usize, actual: usize) -> Self
pub const fn insufficient_data(expected: usize, actual: usize) -> Self
Creates a new insufficient data error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::insufficient_data(1024, 512);
assert!(matches!(err, CvError::InsufficientData { expected: 1024, actual: 512 }));Sourcepub fn matrix_error(message: impl Into<String>) -> Self
pub fn matrix_error(message: impl Into<String>) -> Self
Creates a new matrix error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::matrix_error("Matrix dimensions mismatch");
assert!(matches!(err, CvError::MatrixError { .. }));Sourcepub fn invalid_parameter(
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn invalid_parameter( name: impl Into<String>, value: impl Into<String>, ) -> Self
Creates a new invalid parameter error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::invalid_parameter("sigma", "-1.0");
assert!(matches!(err, CvError::InvalidParameter { .. }));Sourcepub fn onnx_runtime(message: impl Into<String>) -> Self
pub fn onnx_runtime(message: impl Into<String>) -> Self
Creates a new ONNX Runtime error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::onnx_runtime("Session initialization failed");
assert!(matches!(err, CvError::OnnxRuntime { .. }));Sourcepub fn model_load(message: impl Into<String>) -> Self
pub fn model_load(message: impl Into<String>) -> Self
Creates a new model load error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::model_load("File not found");
assert!(matches!(err, CvError::ModelLoad { .. }));Sourcepub fn tensor_error(message: impl Into<String>) -> Self
pub fn tensor_error(message: impl Into<String>) -> Self
Creates a new tensor error.
§Examples
use oximedia_cv::error::CvError;
let err = CvError::tensor_error("Invalid data type");
assert!(matches!(err, CvError::TensorError { .. }));Trait Implementations§
Source§impl Error for CvError
impl Error for CvError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for CvError
impl !UnwindSafe for CvError
impl Freeze for CvError
impl Send for CvError
impl Sync for CvError
impl Unpin for CvError
impl UnsafeUnpin for CvError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<E> OxiErrorExt for Ewhere
E: Error,
impl<E> OxiErrorExt for Ewhere
E: Error,
Source§fn with_oxi_context(self, frame: ErrorFrame) -> OxiError
fn with_oxi_context(self, frame: ErrorFrame) -> OxiError
self by prepending the frame’s display string as context.