Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sobel operator for gradient angle

Tags:

opencv

I want to find the direction of stroke in text.How to used Sobel operator for this purpose? enter image description here

This image show dp .which is gradient direction.I wanted to know how I can apply Sobel operator for finding pixel to chose (from p to q)along path to find other end q of pixel in edge.

like image 583
madan ram Avatar asked Mar 13 '14 14:03

madan ram


People also ask

What is Sobel gradient?

The Sobel operator performs a 2-D spatial gradient measurement on an image and so emphasizes regions of high spatial frequency that correspond to edges. Typically it is used to find the approximate absolute gradient magnitude at each point in an input grayscale image.

What is Robert's cross gradient operators Sobel operator?

The Roberts Cross operator performs a simple, quick to compute, 2-D spatial gradient measurement on an image. It thus highlights regions of high spatial frequency which often correspond to edges. In its most common usage, the input to the operator is a grayscale image, as is the output.

What is gradient operator in image processing?

In digital images, a gradient operator is similar to an averaging operator (for noise removal), which is a weighted convolution operator utilizing the neighboring pixels for the operation. However, unlike the averaging operator, the weightings of a gradient operator are not exclusively positive integers.


1 Answers

You can find x derivative of image, then y derivative.

Sobel(Img,gxx,CV_32FC1,1,0); //  x derivative
Sobel(Img,gyy,CV_32FC1,0,1); //  y derivative

After that find phase http://docs.opencv.org/modules/core/doc/operations_on_arrays.html#phase

phase(gxx,gyy,angles,inDegrees);
like image 99
Andrey Smorodov Avatar answered Nov 15 '22 11:11

Andrey Smorodov