Wand image.edge function in Python

Edge Extraction is an effect after which the edges present in image gets highlighted. It is done in order to detect all the edges present in image. edge() function highlight edges on black and white images with a simple convolution filter. Generally, Edge Detection is used by Computer Vision and Machine Learning.

Syntax :

wand.image.edge(radius=radius)

Parameters :

Parameter Input Type Description
radius numbers.Real the radius of the, in pixels, not counting the center pixel.

Image Used :

Example #1:



filter_none

edit
close

play_arrow

link
brightness_4
code

# import Image from wand.image module
from wand.image import Image
  
# read image using Image() function
with Image(filename ="koala.jpeg") as img:
    # transform image to grayscale image
    img.transform_colorspace('gray')
  
    # edge extraction using edge() function
    img.edge(1)
    img.save(filename ="edgekoala.jpeg")

chevron_right


Output:

Example #: Increasing radius Value.

filter_none

edit
close

play_arrow

link
brightness_4
code

# import Image from wand.image module
from wand.image import Image
  
# read image using Image() function
with Image(filename ="koala.jpeg") as img:
  
    # transform image to grayscale image
    img.transform_colorspace('gray')
  
    # edge extraction using edge() function
    img.edge(3)
    img.save(filename ="edgekoala.jpeg")

chevron_right


Output:

Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.




My Personal Notes arrow_drop_up

Hi there I am a student of CGC COE, Landran in CSE department and have a great interest in programming

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.