Git Product home page Git Product logo

edge-detection's Introduction

Canny Edge Detection

Edge detection on achromatic images written in pure C,
based on the algorithm created by John F. Canny

Algorithm

The algorithm works by performing matrix convolutions in a few steps:

  1. Noise reduction - 5x5 Gaussian filter
  2. Finding intensity gradient - vertical and horizontal Sobel kernel
  3. Non-maximum suppression
  4. Hysteresis thresholding

Thresholding is defined by two parameters - lower and upper threshold

Examples

architecture_resized






car_resized






city_chicago_resized






city_la_resized






lizard_resized


Conclusion

Canny edge detector algorithm uses two thresholds. I concluded that it is difficult to find these values, having to tweak them for each image and still getting unsatisfactory results. For now, the program in this form works quite well for straight lines, mainly architecture or car designs. It's effectiveness falls of when it comes to pictures with nature or animals.

Usage

If you wish to try the program, follow these steps

  • To work, the program needs the following file structure:

edge_detection_c.exe
--images/
----input/
----output/
  • Place images you want to detect edges on in the input folder

    • Note: For now, the only supported image extension is .jpg

  • Execute the program

Images with detected edges are placed into the output folder with the same name and extension

Credits

License

This project is a free and open-source software licensed under the MIT license

Acknowledgments:

Used STB library developed by nothings for loading and saving to jpegs

edge-detection's People

Contributors

pcichowski avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.