pub enum Backend {
OpenCV {
threshold: f32,
},
RuntimeDetectedSimd {
threshold: f32,
step_x: usize,
step_y: usize,
},
Scalar {
threshold: f32,
step_x: usize,
step_y: usize,
},
}Expand description
The backend/algorithm to use.
There is an optional opencv backend, that uses the opencv-rust crate which depends on the OpenCV C++ library. This requires enabling the opencv feature in find-subimage.
There is another simdeez optional dependency, which uses the simdeez crate for a rust SIMD implementation. This is enabled by default.
The only implementation which cannot be disabled at present is the scalar one.
Variants§
OpenCV
OpenCV SQDIFF_NORMED MatchTemplate
Note that the threshold values for this backend use a different scale than the others.
RuntimeDetectedSimd
This should detect CPU features at runtime and use the best possible rust SIMD implementation of SQDIFF_NORMED (square difference).
step_x and y let you customize it to skip every Nth x or y coordinate in case you need less accurate results, potentially giving large speedups.
Scalar
Scalar SQDIFF_NORMED (square difference) implementation.
Slowest, should work anywhere and be reliable.
Smallest in terms of generated code size.
step_x and y let you customize it to skip every Nth x or y coordinate in case you need less accurate results, potentially giving large speedups.