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)
|
||||
}
|
||||
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]
|
||||
fn test() {
|
||||
let mut data = Database::default();
|
||||
let feature_name = String::from("Dimension-comparison");
|
||||
let feature_result = FeatureResult::Bool(equal);
|
||||
|
||||
data.add_feature(Box::new(average_luminance));
|
||||
|
||||
let _as_json = serde_json::to_string(&data);
|
||||
(feature_name, feature_result)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue