diff --git a/src/detect/linescan.rs b/src/detect/linescan.rs index b020450..0cba5c7 100644 --- a/src/detect/linescan.rs +++ b/src/detect/linescan.rs @@ -407,7 +407,7 @@ impl QRFinderPattern { } let module_size: f64 = f64::from(total_size) / 7.0; - let max_variance = module_size / 1.5; + let max_variance = module_size / 1.6; if (module_size - f64::from(self.2)).abs() > max_variance { return false; diff --git a/tests/image_tests.rs b/tests/image_tests.rs index 40e1940..651d23c 100644 --- a/tests/image_tests.rs +++ b/tests/image_tests.rs @@ -8,6 +8,30 @@ pub fn test_version1_example() { ); } +#[test] +pub fn test_wild_big_example() { + test_image( + "tests/images/wild_big.png", + vec![Ok(String::from("2810050501011O7KV4V6FDGU"))], + ); +} + +#[test] +pub fn test_wild_rotated_1() { + test_image( + "tests/images/wild_rot_1.jpg", + vec![Ok(String::from("2810050501011O7KV4V6FDGU"))], + ); +} + +#[test] +pub fn test_wild_rotated_2() { + test_image( + "tests/images/wild_rot_2.jpg", + vec![Ok(String::from("2810050501011O7KV4V6FDGU"))], + ); +} + #[test] pub fn test_version1_example_no_border() { test_image( diff --git a/tests/images/wild_big.png b/tests/images/wild_big.png new file mode 100644 index 0000000..d222a64 Binary files /dev/null and b/tests/images/wild_big.png differ diff --git a/tests/images/wild_rot_1.jpg b/tests/images/wild_rot_1.jpg new file mode 100644 index 0000000..1367c5d Binary files /dev/null and b/tests/images/wild_rot_1.jpg differ diff --git a/tests/images/wild_rot_2.jpg b/tests/images/wild_rot_2.jpg new file mode 100644 index 0000000..00634f1 Binary files /dev/null and b/tests/images/wild_rot_2.jpg differ