In this article we will see how we can get the infocusness of each pixel in mahotas. In order to get the infocusness of each pixel we will use the sobel operator. The Sobel operator, sometimes called the Sobel–Feldman operator or Sobel filter, is used in image processing and computer vision, particularly within edge detection algorithms where it creates an image emphasising edges.
In this tutorial we will use “lena” image, below is the command to load it.
Below is the lena image
In order to do this we will use
Syntax : mahotas.sobel(2d_img)
Argument : It takes two dimensional image object as argument
Return : It returns image object
Below is the implementation
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.