Re: Sobel operator implementation
- From: aruzinsky <aruzinsky@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 4 Sep 2009 08:03:59 -0700 (PDT)
On Sep 2, 11:52 pm, jogging <joggings...@xxxxxxxxx> wrote:
Hi,all
I have a question about the implementation of sobel operator.
We know sobel operator is usually used to compute the gradient
of an image. In its definition the gradient magnitude is the
square root of the sums of Gx and Gy which Gx and Gy are gradient
in x direction and in y direction each.
The square root calculation is slow, especially in embedded
application.
Instead the output is the sum of the absolute values of Gx and Gy,then
the output is clamped to 8-bit range.
I don't know what influence the change can bring?
Thanks
Jogging
Is your question about the Sobel operator or gradient magnitude?
Depending on the application, there certainly are better ways to
calculate gradient magnitude than using the sobel operator.
1. Consider pixel luminances with spatial positions (i,j), (i+1,j),
(i,j+1), and (i+1,j+1)
a b
c d
an accurate estimate of of the gradient magnitude at position (i+0.5, j
+0.5) is
sqrt( (a-d)*(a-d) + (b-c)*(b-c) )/sqrt(2)
This (or the quantity before taking the square root) can be smoothed
and/or interpolated at positions (i,j) in an image.
2. Consider pixel luminances with spatial positions (i,j), (i+1,j),
(i,j+1), (i+1,j+1), (i-1,j), (i,j-1), (i-1,j+1) , (i+1,j-1),
(i-1,j-1):
a b c
d e f
g h l
A fast estimate of the gradient magnitude at (i,j) is
Max( |d-e|, |f-e|, |h-e|, |b-e|, Max( |a-e|, |c-e|, |l-e|, |g-e| )/sqrt
(2) ).
This is based on the fact that, for an analytic function, the gradient
magnitude is invariant to rotation and, therefore equal to the maximum
magnitude of the directional derivatives.
Again, this can be smoothed.
.
- References:
- Sobel operator implementation
- From: jogging
- Sobel operator implementation
- Prev by Date: Re: possibility of converting "grayscale images to color images"?
- Next by Date: Re: possibility of converting "grayscale images to color images"?
- Previous by thread: Re: Sobel operator implementation
- Next by thread: The Jacobian of an Image?
- Index(es):
Relevant Pages
|