Ask Your Question
0

gradient of an image

asked 2014-08-26 04:44:25 -0600

jamesnzt gravatar image

updated 2014-08-26 04:45:20 -0600

Which function can be used to find the gradient of the gray scale image in openCV?

edit retag flag offensive close merge delete

Comments

Here is an example of Sobel operator which computes an approximation of the gradient of an image intensity function. http://docs.opencv.org/2.4.4/doc/tutorials/imgproc/imgtrans/sobel_derivatives/sobel_derivatives.html?highlight=sobel

la lluvia gravatar imagela lluvia ( 2014-08-26 05:26:05 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-08-26 05:26:25 -0600

sergio gravatar image

Maybe you could use Sobel derivatives

 /// Gradient X
 //Scharr( src_gray, grad_x, ddepth, 1, 0, scale, delta, BORDER_DEFAULT );
 Sobel( src_gray, grad_x, ddepth, 1, 0, 3, scale, delta, BORDER_DEFAULT );
 convertScaleAbs( grad_x, abs_grad_x );

 /// Gradient Y
 //Scharr( src_gray, grad_y, ddepth, 0, 1, scale, delta, BORDER_DEFAULT );
 Sobel( src_gray, grad_y, ddepth, 0, 1, 3, scale, delta, BORDER_DEFAULT );
 convertScaleAbs( grad_y, abs_grad_y );
edit flag offensive delete link more

Comments

You could use the official tutorial on using Sobel operators to get some more explanation about how it is working.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-08-26 07:12:42 -0600 )edit

Question Tools

Stats

Asked: 2014-08-26 04:44:25 -0600

Seen: 185 times

Last updated: Aug 26 '14