Struct SimilarChecker

Source
pub struct SimilarChecker { /* private fields */ }
Expand description

SimilarChecker has settings for detecting similar image.

Implementations§

Source§

impl SimilarChecker

Source

pub fn new() -> Self

Inits SimilarChecker.

§Examples
let checker = simimgrs::SimilarChecker::new();
Source

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);
Source

pub fn threshold(self, threshold: usize) -> Self

Sets threshold parametor for SimilarChecker.

§Examples
let checker = simimgrs::SimilarChecker::new().threshold(10);
Source

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§

Source§

impl Default for SimilarChecker

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SetParameter for T

Source§

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result
where T: Parameter<Self>,

Sets value as a parameter of self.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.