Skip to content

TornaxO7/wgpu-canny-edge-detection

Repository files navigation

A little toy implementation of the canny-edge-detection algorithm in WPGU.

Usage

cargo run --release -- <path to image file> <path to output directory>

# Example: Applies edge detection to the given image and saves each change after each step to the given output directory.
cargo run --release -- /tmp/image.png /tmp/output_dir

Example

Here's an example which images will be generated.

Source image (example-images/castle.jpg):

source image

1. Gray scale

gray scale

2. Gaussian filter

gaussian filter

3. Horizontal and vertical edges

3.1 Horizontal edges

horizontal edges

3.2 Vertical edges

vertical edges

4. Magnitude and radians

4.1 Magnitude

magnitude

4.2 Radians

radians

5. Non-maximum-suppression

non-maximum-suppression

6. Double Threshold

double threshold

7. Edge tracking

edge tracking

Sources to learn

About

A little toy implementation of the canny-edge-detection algorithm in WPGU.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published