pub struct SimilarChecker { /* private fields */ }Expand description
SimilarChecker has settings for detecting similar image.
Implementations§
Source§impl SimilarChecker
impl SimilarChecker
Sourcepub fn compression_size(self, width: usize, height: usize) -> Self
pub fn compression_size(self, width: usize, height: usize) -> Self
Sets compression_size parametor for SimilarChecker.
§Examples
let checker = simimgrs::SimilarChecker::new().compression_size(10, 10);Sourcepub fn threshold(self, threshold: usize) -> Self
pub fn threshold(self, threshold: usize) -> Self
Sets threshold parametor for SimilarChecker.
§Examples
let checker = simimgrs::SimilarChecker::new().threshold(10);Sourcepub fn is_similar(&self, img1: DynamicImage, img2: DynamicImage) -> bool
pub fn is_similar(&self, img1: DynamicImage, img2: DynamicImage) -> bool
Checks for similar image using average hash algorism.
§Examples
let img1 = image::open("testdata/aws_batch.png").unwrap();
let img2 = image::open("testdata/aws_rekognition.png").unwrap();
let checker = simimgrs::SimilarChecker::new();
assert!(!checker.is_similar(img1, img2))Trait Implementations§
Auto Trait Implementations§
impl Freeze for SimilarChecker
impl RefUnwindSafe for SimilarChecker
impl Send for SimilarChecker
impl Sync for SimilarChecker
impl Unpin for SimilarChecker
impl UnwindSafe for SimilarChecker
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
Mutably borrows from an owned value. Read more