Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/detect/linescan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
24 changes: 24 additions & 0 deletions tests/image_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Binary file added tests/images/wild_big.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/images/wild_rot_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/images/wild_rot_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.