diff --git a/modules/imgproc/include/opencv2/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc.hpp index c93975eeb82818d1632d3c297ee934ffb5835718..947dfc3029280d8be63d613de2e207c5b4daea23 100644 --- a/modules/imgproc/include/opencv2/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc.hpp @@ -1369,14 +1369,25 @@ CV_EXPORTS_W void Sobel( InputArray src, OutputArray dst, int ddepth, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT ); -/** @brief TODO +/** @brief Calculates the first order image derivative in both x and y using a Sobel operator -TODO +Equivalent to calling: +@code +Sobel( src, dx, CV_16SC1, 1, 0, 3 ); +Sobel( src, dy, CV_16SC1, 0, 1, 3 ); +@endcode + +@param src input image. +@param dx output image with first-order derivative in x. +@param dy output image with first-order derivative in y. +@param ksize size of Sobel kernel. It must be 3. + +@sa Sobel */ CV_EXPORTS_W void spatialGradient( InputArray src, OutputArray dx, - OutputArray dy, int ksize ); + OutputArray dy, int ksize = 3 ); /** @brief Calculates the first x- or y- image derivative using Scharr operator. diff --git a/modules/imgproc/perf/perf_spatialgradient.cpp b/modules/imgproc/perf/perf_spatialgradient.cpp index 31219a3d92ab5b5b7c517e6c954319a98a23033b..87456146de9b320fb6dc9a5601bab2b13054a6a1 100644 --- a/modules/imgproc/perf/perf_spatialgradient.cpp +++ b/modules/imgproc/perf/perf_spatialgradient.cpp @@ -31,4 +31,3 @@ PERF_TEST_P( Size_Ksize, spatialGradient, SANITY_CHECK(dx); SANITY_CHECK(dy); } -