Gradient directions to radians?
- From: saneman <asdfsdf@xxxxxxx>
- Date: Wed, 19 Mar 2008 16:58:14 +0100
I use 2D convolution of the sobel filter with a binary image to calculate the gradient for each pixel. The x and y directions for the sobel filters are given below:
% Partial derivative in x-direction.
Sx = [-1 -2 -1; 0 0 0; 1 2 1];
% Partial derivative in y-direction.
Sy = [-1 0 1; -2 0 2; -1 0 1];
The convolution is carried out with:
direction_x = conv2(Sx, img);
direction_y = conv2(Sy, img);
But how do I convert the directions in 'direction_y' and 'direction_x' to radians between 0.0 and 2 Pi ?
.
- Follow-Ups:
- Re: Gradient directions to radians?
- From: ImageAnalyst
- Re: Gradient directions to radians?
- From: Edward Rosten
- Re: Gradient directions to radians?
- Prev by Date: Re: How to determine the roundness of a region
- Next by Date: Re: Gradient directions to radians?
- Previous by thread: difference between blur and smooth
- Next by thread: Re: Gradient directions to radians?
- Index(es):