Skip to main content

ChangeDensity

Struct ChangeDensity 

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

YIQ squared-delta floor for treating a pixel as actually changed. 100.0 corresponds to a YIQ-weighted distance of 10, roughly equivalent to a perceptual delta of ~0.017 — filters near-identical pixels without throwing away genuine edits. YIQ squared-delta floor for treating a pixel as actually changed. 100.0 corresponds to a YIQ-weighted distance of 10, roughly equivalent to a perceptual delta of ~0.017 — filters near-identical pixels without throwing away genuine edits. YIQ squared-delta floor for treating a pixel as actually changed. 100.0 corresponds to a YIQ-weighted distance of 10, roughly equivalent to a perceptual delta of ~0.017 — filters near-identical pixels without throwing away genuine edits. How much of any rectangle differs between the two images at all, answered in constant time from a summed-area table.

Merging patches is a question about the gaps between them, and the change mask cannot answer it: everything below the diff threshold reads as background there. A regenerated or recolored area leaves a faint delta across the whole of itself, so its patches sit in touched space; two distinct edits are separated by pixels that are identical in both images.

Implementations§

Source§

impl ChangeDensity

Source

pub fn new(img1: &Image, img2: &Image) -> Self

Source

pub fn share(&self, bbox: &BoundingBox) -> f64

Share of bbox that differs between the two images, in 0.0..=1.0.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.