Questions tagged [sobel]

The Sobel operator, sometimes called Sobel Filter, is used in image processing and computer vision, particularly within edge detection algorithms.

The Sobel operator, sometimes called Sobel Filter, is used in image processing and computer vision, particularly within edge detection algorithms.

It is named after Irwin Sobel, who presented the idea of an "Isotropic 3x3 Image Gradient Operator" at a talk at the Stanford Artificial Intelligence Project (SAIL) in 1968.

Technically, it is a discrete differentiation operator, computing an approximation of the gradient of the image intensity function. At each point in the image, the result of the Sobel operator is either the corresponding gradient vector or the norm of this vector.

The Sobel operator is based on convolving the image with a small, separable, and integer valued filter in horizontal and vertical direction and is therefore relatively inexpensive in terms of computations.

On the other hand, the gradient approximation that it produces is relatively crude, in particular for high frequency variations in the image.

The Kayyali operator for edge detection is another operator generated from Sobel operator.

Wikipedia: http://en.wikipedia.org/wiki/Sobel_operator

182 questions
55
votes
10 answers

Sobel filter kernel of large size

I am using a sobel filter of size 3x3 to calculate the image derivative. Looking at some articles on the internet, it seems that kernels for sobel filter for size 5x5 and 7x7 are also common, but I am not able to find their kernel values. Could…
Aarkan
  • 3,811
  • 6
  • 40
  • 54
9
votes
2 answers

What are the kernel coefficients for OpenCV's Sobel filter for sizes larger than 3 x 3?

I am using OpenCV's Sobel filter of size 5x5 and 7x7 to calculate the image derivative. Could someone please let me know the kernel values for the Sobel filter of size 5x5 and 7x7 in OpenCV? When doing a Google search, it's showing me a lot of…
user1235183
  • 3,002
  • 1
  • 27
  • 66
7
votes
2 answers

OpenCV's Sobel filter - why does it look so bad, especially compared to Gimp?

I'm trying to rebuild some preprocessing I have done before in Gimp, using OpenCV. The first stage is a Sobel filter for edge detection. It works very well in Gimp: Now here is my attempt with OpenCV: opencv_imgproc.Sobel(/* src = */ scaled, /* dst…
0__
  • 66,707
  • 21
  • 171
  • 266
5
votes
0 answers

Opencv How to apply a filter within a mask

I want to apply a sobel filter to an image, but I want to apply it only inside a mask I have defined. I know I can do cv2.bitwise_and and obtain only the image inside the mask, but that would also gives me an edge between the mask and the inner…
Isaac
  • 1,436
  • 2
  • 15
  • 29
5
votes
0 answers

Sobel edge detector in R?

I am working on an R assignment about Sobel edge-detection. Unfortunately the video tutorial I was following uses R for every other task, but switches to python for image processing - I am guessing he did not find any useful R package for image…
Manojit
  • 611
  • 1
  • 8
  • 18
5
votes
3 answers

python - Implementing Sobel operators with python without opencv

Given a greyscale 8 bit image (2D array with values from 0 - 255 for pixel intensity), I want to implement the Sobel operators (mask) on an image. The Sobel function below basically loops around a given pixel,applies the following weight to the…
Frank du Plessis
  • 73
  • 1
  • 3
  • 8
5
votes
2 answers

How to remove some edges after applying edge detection?

I need to find the iris edges, the input images that I use is not a fully rounded iris, sometimes it might be covered by the eyelid. I found a summary of a journal article to find the iris even its covered by the eyelid. However, I stuck in one of…
5
votes
2 answers

Is there a convolution function in Tensorflow to apply a Sobel filter?

Is there any convolution method in Tensorflow to apply a Sobel filter to an image img (tensor of type float32 and rank 2)? sobel_x = tf.constant([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]], 'float32') result = tf.convolution(img, sobel_x) # <== TO DO…
axelbrz
  • 783
  • 1
  • 7
  • 16
5
votes
1 answer

Sobel Filter not functioning correctly

I wrote a class for Sobel operator for edge detection, but when I use an example image, my edges are off. Greatly appreciate it if someone can help me with this. import java.awt.image.BufferedImage; import java.awt.image.ConvolveOp; import…
DVCode
  • 171
  • 1
  • 9
4
votes
1 answer

How to construct a sobel filter for kernel initialization in input layer for images of size 128x128x3?

This is my code for sobel filter: def init_f(shape, dtype=None): sobel_x = tf.constant([[-5, -4, 0, 4, 5], [-8, -10, 0, 10, 8], [-10, -20, 0, 20, 10], [-8, -10, 0, 10, 8], [-5, -4, 0, 4, 5]]) ker = np.zeros(shape, dtype) ker_shape =…
drum_stick
  • 53
  • 7
4
votes
1 answer

Interpreting Sobel from cv2

I'm trying to understand the Sobel convolution from cv2 in Python. According to documentation the Sobel kernel is -1 0 1 -2 0 2 -1 0 1 So, I tried to apply it to the following img (a binary 3x3 array): 0 1 0 1 0 1 0 1 0 Now, I have a problem to…
Sigur
  • 355
  • 8
  • 19
4
votes
1 answer

Sobel Operator MaskX

Why my image quality after masking x get worse? public void doMaskX() { int[][] maskX = { { -1, -2, -1 }, { 0, 0, 0 }, { 1, 2, 1 } }; int rgb, alpha = 0; int[][] square = new int[3][3]; for (int y = 0; y < width - 3; y++) { …
szufi
  • 219
  • 1
  • 2
  • 9
4
votes
1 answer

What are pros and cons of different edge detection algorithms

Can someone describe different edge detection algorithm to detect edges in an image with pros and cons of their uses. Some of the main algorithms that i was interested in were: Sobel FuzzyLogic Canny Thanks in advance
3
votes
1 answer

Implementing sobel edge detection algorithm

New to progamming; trying to implement a sobel edge detection algorithm. I am doing this in a function called edges, as per the code snippet below. void edges(int height, int width, RGBTRIPLE image[height][width]) { // define kernals int…
Rory V.S.
  • 45
  • 5
3
votes
1 answer

What does scale mean in cv2.Sobel?

I am trying to understand the scale argument in cv2.Sobel. With scale set to 1/8, I get the output as follows along x-axis: But with scale = 10 or scale = 100, the output is very similar. Both of the above images are the first order gradients…
Suhail Gupta
  • 22,386
  • 64
  • 200
  • 328
1
2 3
12 13