GithubHelp home page GithubHelp logo

canny-edge-detection's Introduction

Canny Edge Detection using Python

i)Implementation of the Canny edge detection algorithm on a sample image to obtain the edges.

Developed By :T MOUNISH

Register Number : 212223240098

Code :

import cv2
import numpy as np
image = cv2.imread('flower.jpg', 0)  # Reading the image in grayscale mode
blurred = cv2.GaussianBlur(image, (5, 5), 0)  # 5x5 kernel size, sigma = 0
edges = cv2.Canny(blurred, 100, 200)
cv2.imshow('Original Image', image)
cv2.imshow('Canny Edges', edges)
cv2.waitKey(0)
cv2.destroyAllWindows()

OUTPUT :

image image

ii)How do different parameter settings impact the result?

The Canny edge detector works by detecting areas of high gradient (i.e., rapid intensity changes) in the image. It involves several steps, including smoothing with a Gaussian filter to reduce noise, computing gradients, and applying non-maximum suppression to thin the edges, followed by edge linking with hysteresis.

Different parameter settings can significantly impact the result:

Thresholds (low and high):

These thresholds determine which edges are considered strong, weak, or non-edges. Lower values lead to more edges being detected, while higher values filter out weaker edges. Adjusting these thresholds can impact the sensitivity of edge detection.

Gaussian blur kernel size:

The size of the Gaussian blur kernel affects the amount of smoothing applied to the image. Larger kernels result in more smoothing, which can reduce noise but may also blur edges.

Sigma (standard deviation) for Gaussian blur:

Sigma controls the spread of the Gaussian kernel. Higher values result in more smoothing, while lower values preserve finer details. However, too much smoothing can cause edges to be lost.

canny-edge-detection's People

Contributors

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