GithubHelp home page GithubHelp logo

metinmertakcay / canny_edge_detection Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 2.52 MB

Python 100.00%
edge-detection hysteresis threshold edge canny-edge-detection gaussian-filter non-maximum-suppression

canny_edge_detection's Introduction

Canny Edge Detection

HOW TO RUN PROGRAM?

  • Go to directory where you download the project.
  • Open console screen and enter “python main.py” command to run.

REQUIREMENT

You can install necessary libraries using “pip install”.

  • Matplotlib
  • Opencv
  • Numpy

HOW TO CHOOSE IMAGE?

You have to put all images in “images” folder because all images are taken using “os” library. You can enter number for select image.

EDGE DETECTION

OpenCv library is used to read image as grayscale (intensity values of the pixels are 8 bit and range from 0 to 255). After reading image, 5 x 5 gauss filter was used to eliminate noise in the image.

Gauss kernel

After noise reduction, gradients determined by using Sobel filter. Then magnitude and angle of the gradient are calculated.

Sobel

The following chart is used for non-maximum supression. The pixel value compared with neighboring pixels corresponding to the angle value. If the displayed pixel is larger than the neigboring pixels, the value is retained, otherwise the value is 0.

Chart

Thresholding is used to identify the weak and strong edge. If pixel value is greater than high threshold, the edge is defined as strong. If pixel value is less than low threshold, the pixel value is 0. If the pixel value is between two threshold values, hysteresis method is applied.

Hysteresis method is used to determine whether to erase weak edges. Whether or not the weak pixels are deleted is determined by looking at the surrounding pixels. If there is a strong edge at neigbours, the weak edge is defined as the strong edge, otherwise the pixel value is 0.

OUTPUTS

Click to see results.

canny_edge_detection's People

Contributors

metinmertakcay avatar

Watchers

 avatar  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.