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

How to convert Canny to rgba for canvas drawing? #512

Closed
tetap opened this issue Oct 20, 2022 · 3 comments
Closed

How to convert Canny to rgba for canvas drawing? #512

tetap opened this issue Oct 20, 2022 · 3 comments

Comments

@tetap
Copy link

tetap commented Oct 20, 2022

No description provided.

@tetap
Copy link
Author

tetap commented Oct 22, 2022

I tried to save the image, but it looks like this
image
I tried to save the image, but it looks like this
image
Here's my code

    use imageproc::edges::canny;
    let image = ImageBuffer::from_raw(width, height, data.clone()).unwrap();
    let edges = DynamicImage::ImageLuma8(canny(&image, low_threshold, high_threshold));
    edges.save("img/result/test.jpg").unwrap();
    data.clone()

The final result did not agree with my expectation

@tetap
Copy link
Author

tetap commented Oct 22, 2022

This is what I got using OpenCV, and obviously he got the right edge.
image

@tetap
Copy link
Author

tetap commented Oct 22, 2022

I'm sorry it's my fault, but canny I can't control the SIGMA value of gaussian_blur_f32. Can only be solved by modifying the source code.

@tetap tetap closed this as completed Oct 22, 2022
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