Added Dimension Compare Feature

This commit is contained in:
SirTalksalot75 2023-06-17 12:33:00 +02:00 committed by GitHub
parent 8c6c27fa55
commit fb8cc9fce2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -92,12 +92,13 @@ fn average_luminance(image: Image<f32>) -> (String, FeatureResult) {
(feature_name, feature_result) (feature_name, feature_result)
} }
fn compare_Dim(image0: Image<f32>, image1: Image<f32>) -> (String, FeatureResult) {
let a = image0.width as f32 / image0.height as f32;
let b = image1.width as f32 / image1.height as f32;
let equal = a == b;
#[test] let feature_name = String::from("Dimension-comparison");
fn test() { let feature_result = FeatureResult::Bool(equal);
let mut data = Database::default();
data.add_feature(Box::new(average_luminance)); (feature_name, feature_result)
let _as_json = serde_json::to_string(&data);
} }