Added Dimension Compare Feature
This commit is contained in:
parent
8c6c27fa55
commit
fb8cc9fce2
|
@ -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);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue