Code Monkey home page Code Monkey logo

edge_detection's Introduction

Edge Detection Using Sobel,Prewitt and Laplacian Operator

What is an Edge?

Area where there are extreme differences in the intensities of the pixel usually indicate an edge of an object.

Types Of Edges

These are the main types of ideal edges present in images. The way that the image intensity changes in an image determines the type of edge that is present at that position.The Figure 1 helps to illustrate these differences by using a line to represent the image intensities of pixels against distance in the x or y direction of an image .

a. Step Edge - Where image intensity immediately increases over a distance.
b. Ramp Edge - Where image intensity gradually increases over a distance.
c. Roof Edge - Where image intensity spikes up temporarily over a distance. Article and Edge Type Image Reference

Edge Types

Using Sobel operator

Sobel is very common operator to detect edges of an image, which is an approximation to a derivative of an image.It is separate in the y and x directions. Here We use a kernel 3*3 matrix, one for each x and y direction. The gradient for x-direction has minus numbers on the left and positive numbers on the right and we are preserving the center pixels.Similarly, the gradient for y-direction has minus numbers on the bottom and positive numbers on top and here we the middle row pixels.

alt text

Prewitt operator

Prewitt operator is similar to the Sobel operator and is used for detecting vertical and horizontal edges in images.It provides us two masks one for detecting edges in horizontal direction and another for detecting edges in an vertical direction.

alt text

Using Laplacian Operator

Unlike the Sobel and prewitt edge detector, the Laplacian edge detector uses only one kernel. It calculates second order derivatives in a single pass. Here's the kernel used for it:

alt text

Outputs

Sobel output

Prewitt output

Laplacian output

edge_detection's People

Contributors

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