[−][src]Function diffimg::diff::diff
pub fn diff(image_a: &DynamicImage, image_b: &DynamicImage) -> f64
Compute the amount of difference between two images
Receives two &DymanicImage
(the images that are going to be compared)
and returns a f64
between 0 and 1, representing how much both images
differ from each other, i.e. 0 means they are completely equal and 1 means
they are completely different.
Example
use image::*;
use diffimg;
fn main() {
let image1 = image::open("tests/images/image1.png").expect("Failed to open image");
let image2 = image::open("tests/images/image2.png").expect("Failed to open image");
let diff = diffimg::diff(&image1, &image2);
}