Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template matching benchmarks all use the same hardcoded method #701

Open
sby1ce opened this issue Dec 25, 2024 · 0 comments
Open

Template matching benchmarks all use the same hardcoded method #701

sby1ce opened this issue Dec 25, 2024 · 0 comments

Comments

@sby1ce
Copy link

sby1ce commented Dec 25, 2024

The macro that generates the benchmarks for template matching ignores the method parameter and uses hardcoded SQDIFF.

macro_rules! bench_match_template {
($name:ident, image_size: $s:expr, template_size: $t:expr, method: $m:expr) => {
#[bench]
fn $name(b: &mut Bencher) {
let image = gray_bench_image($s, $s);
let template = gray_bench_image($t, $t);
b.iter(|| {
let result =
match_template(&image, &template, MatchTemplateMethod::SumOfSquaredErrors);
black_box(result);
})
}
};
}

Also cross correlation is not benchmarked at all.

Perhaps I'm misunderstanding how the macro works or what's the benchmarking process for this crate...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant