|
@ -16,7 +16,7 @@ use hash::PerceptualHash; |
|
|
*/
|
|
|
*/
|
|
|
pub fn init() {
|
|
|
pub fn init() {
|
|
|
match cache::prep_cache() {
|
|
|
match cache::prep_cache() {
|
|
|
Ok(_) => {},
|
|
|
|
|
|
|
|
|
Ok(_) => {}
|
|
|
Err(e) => println!("Error: {}", e),
|
|
|
Err(e) => println!("Error: {}", e),
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -26,7 +26,7 @@ pub fn init() { |
|
|
*/
|
|
|
*/
|
|
|
pub fn teardown() {
|
|
|
pub fn teardown() {
|
|
|
match cache::clear_cache() {
|
|
|
match cache::clear_cache() {
|
|
|
Ok(_) => {},
|
|
|
|
|
|
|
|
|
Ok(_) => {}
|
|
|
Err(e) => println!("Error: {}", e),
|
|
|
Err(e) => println!("Error: {}", e),
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -51,9 +51,8 @@ pub fn get_hamming_distance(hash1: u64, hash2: u64) -> u64 { |
|
|
hash::calculate_hamming_distance(hash1, hash2)
|
|
|
hash::calculate_hamming_distance(hash1, hash2)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Module for the tests
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
// Module for the tests
|
|
|
|
|
|
//
|
|
|
#[cfg(test)]
|
|
|
#[cfg(test)]
|
|
|
mod tests {
|
|
|
mod tests {
|
|
|
|
|
|
|
|
@ -75,10 +74,10 @@ mod tests { |
|
|
num_paths += 1;
|
|
|
num_paths += 1;
|
|
|
println!("Is a image {}: {:?}", num_paths, orig_path) ;
|
|
|
println!("Is a image {}: {:?}", num_paths, orig_path) ;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
|
|
|
|
|
|
}
|
|
|
_ => {
|
|
|
_ => {
|
|
|
println!("Not an image: {:?}", orig_path) ;
|
|
|
println!("Not an image: {:?}", orig_path) ;
|
|
|
continue
|
|
|
|
|
|
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// println!("Name: {}", path.unwrap().path().display())
|
|
|
// println!("Name: {}", path.unwrap().path().display())
|
|
@ -89,8 +88,7 @@ mod tests { |
|
|
|
|
|
|
|
|
// Simple function for the unit tests to succinctly test a set of images
|
|
|
// Simple function for the unit tests to succinctly test a set of images
|
|
|
// that are organized in the fashion of large->medium->small
|
|
|
// that are organized in the fashion of large->medium->small
|
|
|
fn test_imageset_hash(
|
|
|
|
|
|
large_phash: &hash::PerceptualHash,
|
|
|
|
|
|
|
|
|
fn test_imageset_hash(large_phash: &hash::PerceptualHash,
|
|
|
medium_phash: &hash::PerceptualHash,
|
|
|
medium_phash: &hash::PerceptualHash,
|
|
|
small_phash: &hash::PerceptualHash,
|
|
|
small_phash: &hash::PerceptualHash,
|
|
|
expected_large_hash: u64,
|
|
|
expected_large_hash: u64,
|
|
@ -105,17 +103,32 @@ mod tests { |
|
|
let actual_small_hash = small_phash.get_hash();
|
|
|
let actual_small_hash = small_phash.get_hash();
|
|
|
|
|
|
|
|
|
// println for the purpose of debugging
|
|
|
// println for the purpose of debugging
|
|
|
println!("Large Image: expected: {} actual: {}", expected_large_hash, actual_large_hash);
|
|
|
|
|
|
println!("Medium Image: expected: {} actual: {}", expected_medium_hash, actual_medium_hash);
|
|
|
|
|
|
println!("Small Image: expected: {} actual: {}", expected_small_hash, actual_small_hash);
|
|
|
|
|
|
|
|
|
|
|
|
let actual_large_medium_hamming = hash::calculate_hamming_distance(actual_large_hash, actual_medium_hash);
|
|
|
|
|
|
let actual_large_small_hamming = hash::calculate_hamming_distance(actual_large_hash, actual_small_hash);
|
|
|
|
|
|
let actual_medium_small_hamming = hash::calculate_hamming_distance(actual_medium_hash, actual_small_hash);
|
|
|
|
|
|
|
|
|
|
|
|
println!("Large-Medium Hamming Distance: expected: {} actual: {}", expected_large_medium_hamming, actual_large_medium_hamming);
|
|
|
|
|
|
println!("Large-Small Hamming Distance: expected: {} actual: {}", expected_large_small_hamming, actual_large_small_hamming);
|
|
|
|
|
|
println!("Medium-Small Hamming Distance: expected: {} actual: {}", expected_medium_small_hamming, actual_medium_small_hamming);
|
|
|
|
|
|
|
|
|
println!("Large Image: expected: {} actual: {}",
|
|
|
|
|
|
expected_large_hash,
|
|
|
|
|
|
actual_large_hash);
|
|
|
|
|
|
println!("Medium Image: expected: {} actual: {}",
|
|
|
|
|
|
expected_medium_hash,
|
|
|
|
|
|
actual_medium_hash);
|
|
|
|
|
|
println!("Small Image: expected: {} actual: {}",
|
|
|
|
|
|
expected_small_hash,
|
|
|
|
|
|
actual_small_hash);
|
|
|
|
|
|
|
|
|
|
|
|
let actual_large_medium_hamming = hash::calculate_hamming_distance(actual_large_hash,
|
|
|
|
|
|
actual_medium_hash);
|
|
|
|
|
|
let actual_large_small_hamming = hash::calculate_hamming_distance(actual_large_hash,
|
|
|
|
|
|
actual_small_hash);
|
|
|
|
|
|
let actual_medium_small_hamming = hash::calculate_hamming_distance(actual_medium_hash,
|
|
|
|
|
|
actual_small_hash);
|
|
|
|
|
|
|
|
|
|
|
|
println!("Large-Medium Hamming Distance: expected: {} actual: {}",
|
|
|
|
|
|
expected_large_medium_hamming,
|
|
|
|
|
|
actual_large_medium_hamming);
|
|
|
|
|
|
println!("Large-Small Hamming Distance: expected: {} actual: {}",
|
|
|
|
|
|
expected_large_small_hamming,
|
|
|
|
|
|
actual_large_small_hamming);
|
|
|
|
|
|
println!("Medium-Small Hamming Distance: expected: {} actual: {}",
|
|
|
|
|
|
expected_medium_small_hamming,
|
|
|
|
|
|
actual_medium_small_hamming);
|
|
|
|
|
|
|
|
|
// Doing that asserts
|
|
|
// Doing that asserts
|
|
|
assert!(actual_large_hash == expected_large_hash);
|
|
|
assert!(actual_large_hash == expected_large_hash);
|
|
@ -134,55 +147,63 @@ mod tests { |
|
|
super::init();
|
|
|
super::init();
|
|
|
|
|
|
|
|
|
// Sample_01 tests
|
|
|
// Sample_01 tests
|
|
|
test_imageset_hash(
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_01_large.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_01_medium.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_01_small.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
|
|
|
test_imageset_hash(&hash::AHash::new(path::Path::new("./test_images/sample_01_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_01_medium.\
|
|
|
|
|
|
jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_01_small.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
857051991849750,
|
|
|
857051991849750,
|
|
|
857051991849750,
|
|
|
857051991849750,
|
|
|
857051991849750,
|
|
|
857051991849750,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
0u64);
|
|
|
|
|
|
|
|
|
// Sample_02 tests
|
|
|
// Sample_02 tests
|
|
|
test_imageset_hash(
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_02_large.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_02_medium.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_02_small.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
|
|
|
test_imageset_hash(&hash::AHash::new(path::Path::new("./test_images/sample_02_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_02_medium.\
|
|
|
|
|
|
jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_02_small.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
18446744073441116160,
|
|
|
18446744073441116160,
|
|
|
18446744073441116160,
|
|
|
18446744073441116160,
|
|
|
18446744073441116160,
|
|
|
18446744073441116160,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
0u64);
|
|
|
// Sample_03 tests
|
|
|
// Sample_03 tests
|
|
|
test_imageset_hash(
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_03_large.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_03_medium.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_03_small.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
|
|
|
test_imageset_hash(&hash::AHash::new(path::Path::new("./test_images/sample_03_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_03_medium.\
|
|
|
|
|
|
jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_03_small.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
135670932300497406,
|
|
|
135670932300497406,
|
|
|
135670932300497406,
|
|
|
135670932300497406,
|
|
|
135670932300497406,
|
|
|
135670932300497406,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
0u64);
|
|
|
|
|
|
|
|
|
// Sample_04 tests
|
|
|
// Sample_04 tests
|
|
|
test_imageset_hash(
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_04_large.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_04_medium.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_04_small.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
|
|
|
test_imageset_hash(&hash::AHash::new(path::Path::new("./test_images/sample_04_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_04_medium.\
|
|
|
|
|
|
jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::AHash::new(path::Path::new("./test_images/sample_04_small.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
18446460933225054208,
|
|
|
18446460933225054208,
|
|
|
18446460933090836480,
|
|
|
18446460933090836480,
|
|
|
18446460933090836480,
|
|
|
18446460933090836480,
|
|
|
1u64,
|
|
|
1u64,
|
|
|
1u64,
|
|
|
1u64,
|
|
|
0u64
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
0u64);
|
|
|
|
|
|
|
|
|
// Clean_Cache
|
|
|
// Clean_Cache
|
|
|
// super::teardown();
|
|
|
// super::teardown();
|
|
@ -194,55 +215,63 @@ mod tests { |
|
|
super::init();
|
|
|
super::init();
|
|
|
|
|
|
|
|
|
// Sample_01 tests
|
|
|
// Sample_01 tests
|
|
|
test_imageset_hash(
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_01_large.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_01_medium.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_01_small.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
|
|
|
test_imageset_hash(&hash::DHash::new(path::Path::new("./test_images/sample_01_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_01_medium.\
|
|
|
|
|
|
jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_01_small.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
7937395827556495926,
|
|
|
7937395827556495926,
|
|
|
7937395827556495926,
|
|
|
7937395827556495926,
|
|
|
7939647627370181174,
|
|
|
7939647627370181174,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
1u64,
|
|
|
1u64,
|
|
|
1u64
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
1u64);
|
|
|
|
|
|
|
|
|
// Sample_02 tests
|
|
|
// Sample_02 tests
|
|
|
test_imageset_hash(
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_02_large.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_02_medium.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_02_small.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
|
|
|
test_imageset_hash(&hash::DHash::new(path::Path::new("./test_images/sample_02_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_02_medium.\
|
|
|
|
|
|
jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_02_small.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
11009829669713008949,
|
|
|
11009829669713008949,
|
|
|
11009829670249879861,
|
|
|
11009829670249879861,
|
|
|
11009829669713008949,
|
|
|
11009829669713008949,
|
|
|
1u64,
|
|
|
1u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
1u64
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
1u64);
|
|
|
// Sample_03 tests
|
|
|
// Sample_03 tests
|
|
|
test_imageset_hash(
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_03_large.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_03_medium.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_03_small.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
|
|
|
test_imageset_hash(&hash::DHash::new(path::Path::new("./test_images/sample_03_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_03_medium.\
|
|
|
|
|
|
jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_03_small.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
225528496439353286,
|
|
|
225528496439353286,
|
|
|
225528496439353286,
|
|
|
225528496439353286,
|
|
|
226654396346195908,
|
|
|
226654396346195908,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
2u64,
|
|
|
2u64,
|
|
|
2u64
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2u64);
|
|
|
|
|
|
|
|
|
// Sample_04 tests
|
|
|
// Sample_04 tests
|
|
|
test_imageset_hash(
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_04_large.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_04_medium.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_04_small.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
|
|
|
test_imageset_hash(&hash::DHash::new(path::Path::new("./test_images/sample_04_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_04_medium.\
|
|
|
|
|
|
jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::DHash::new(path::Path::new("./test_images/sample_04_small.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
14620651386429567209,
|
|
|
14620651386429567209,
|
|
|
14620651386429567209,
|
|
|
14620651386429567209,
|
|
|
14620651386429567209,
|
|
|
14620651386429567209,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
0u64);
|
|
|
|
|
|
|
|
|
// Clean_Cache
|
|
|
// Clean_Cache
|
|
|
// super::teardown();
|
|
|
// super::teardown();
|
|
@ -254,55 +283,63 @@ mod tests { |
|
|
super::init();
|
|
|
super::init();
|
|
|
|
|
|
|
|
|
// Sample_01 tests
|
|
|
// Sample_01 tests
|
|
|
test_imageset_hash(
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_01_large.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_01_medium.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_01_small.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
|
|
|
test_imageset_hash(&hash::PHash::new(path::Path::new("./test_images/sample_01_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_01_medium.\
|
|
|
|
|
|
jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_01_small.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
72357778504597504,
|
|
|
72357778504597504,
|
|
|
72357778504597504,
|
|
|
72357778504597504,
|
|
|
72357778504597504,
|
|
|
72357778504597504,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
0u64);
|
|
|
|
|
|
|
|
|
// Sample_02 tests
|
|
|
// Sample_02 tests
|
|
|
test_imageset_hash(
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_02_large.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_02_medium.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_02_small.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
|
|
|
test_imageset_hash(&hash::PHash::new(path::Path::new("./test_images/sample_02_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_02_medium.\
|
|
|
|
|
|
jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_02_small.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
5332332327550844928,
|
|
|
5332332327550844928,
|
|
|
5332332327550844928,
|
|
|
5332332327550844928,
|
|
|
5332332327550844928,
|
|
|
5332332327550844928,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
0u64);
|
|
|
// Sample_03 tests
|
|
|
// Sample_03 tests
|
|
|
test_imageset_hash(
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_03_large.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_03_medium.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_03_small.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
|
|
|
test_imageset_hash(&hash::PHash::new(path::Path::new("./test_images/sample_03_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_03_medium.\
|
|
|
|
|
|
jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_03_small.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
6917529027641081856,
|
|
|
6917529027641081856,
|
|
|
6917529027641081856,
|
|
|
6917529027641081856,
|
|
|
6917529027641081856,
|
|
|
6917529027641081856,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
0u64
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
0u64);
|
|
|
|
|
|
|
|
|
// Sample_04 tests
|
|
|
// Sample_04 tests
|
|
|
test_imageset_hash(
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_04_large.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_04_medium.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_04_small.jpg"), &hash::Precision::Medium),
|
|
|
|
|
|
|
|
|
test_imageset_hash(&hash::PHash::new(path::Path::new("./test_images/sample_04_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_04_medium.\
|
|
|
|
|
|
jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
|
|
|
&hash::PHash::new(path::Path::new("./test_images/sample_04_small.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium),
|
|
|
10997931646002397184,
|
|
|
10997931646002397184,
|
|
|
10997931646002397184,
|
|
|
10997931646002397184,
|
|
|
11142046834078253056,
|
|
|
11142046834078253056,
|
|
|
0u64,
|
|
|
0u64,
|
|
|
1u64,
|
|
|
1u64,
|
|
|
1u64
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
1u64);
|
|
|
|
|
|
|
|
|
// Clean_Cache
|
|
|
// Clean_Cache
|
|
|
// super::teardown();
|
|
|
// super::teardown();
|
|
|