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

imageproc::edges::canny panics when thresholds are both 0.0 #705

Open
jyi2ya opened this issue Jan 6, 2025 · 0 comments
Open

imageproc::edges::canny panics when thresholds are both 0.0 #705

jyi2ya opened this issue Jan 6, 2025 · 0 comments

Comments

@jyi2ya
Copy link

jyi2ya commented Jan 6, 2025

    let image = image::GrayImage::new(10, 10);
    let edges = imageproc::edges::canny(&image, 0.0, 0.0);

result

thread 'main' panicked at /home/jyi/.cargo/git/checkouts/imageproc-15e7df7e968bb8fb/ab9e19c/src/edges.rs:135:26:
attempt to subtract with overflow
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a4cb3c831823d9baa56c3d90514b75b2660116fa/library/std/src/panicking.rs:681:5
   1: core::panicking::panic_fmt
             at /rustc/a4cb3c831823d9baa56c3d90514b75b2660116fa/library/core/src/panicking.rs:75:14
   2: core::panicking::panic_const::panic_const_sub_overflow
             at /rustc/a4cb3c831823d9baa56c3d90514b75b2660116fa/library/core/src/panicking.rs:178:21
   3: imageproc::edges::hysteresis
   4: imageproc::edges::canny
             at /home/jyi/.cargo/git/checkouts/imageproc-15e7df7e968bb8fb/ab9e19c/src/edges.rs:52:5
   5: vic::baka
             at ./src/main.rs:1021:17
   6: vic::main
             at ./src/main.rs:1030:5
   7: core::ops::function::FnOnce::call_once
             at /home/jyi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
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