Sobel operator for gradient angle

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

This image shows dp., Which is the direction of the gradient. I wanted to know how I can apply the Sobel operator to search for a pixel to select (p to q) along the path to find the other end of the q pixel in the edge.

+4
source share
1 answer

You can find x image distortion, then y derivative.

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

After this search phase, http://docs.opencv.org/modules/core/doc/operations_on_arrays.html#phase

phase(gxx,gyy,angles,inDegrees);
+9
source

Source: https://habr.com/ru/post/1531592/


All Articles