From 07750a1c7e686cc38de3ed81b8a91f72f5d76bde Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Tue, 10 Apr 2012 20:25:22 +0000 Subject: [PATCH] extended Sobel & Scharr description (ticket #1555). Added CV_32F/CV_64F format combination in sepFilter2D. --- modules/imgproc/doc/filtering.rst | 14 ++++++++++---- modules/imgproc/src/filter.cpp | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/imgproc/doc/filtering.rst b/modules/imgproc/doc/filtering.rst index 8b7cbd3..6ef7161 100644 --- a/modules/imgproc/doc/filtering.rst +++ b/modules/imgproc/doc/filtering.rst @@ -1497,7 +1497,13 @@ Calculates the first, second, third, or mixed image derivatives using an extende :param dst: Destination image of the same size and the same number of channels as ``src`` . - :param ddepth: Destination image depth. + :param ddepth: Destination image depth. The following combination of ``src.depth()`` and ``ddepth`` are supported: + * ``src.depth()`` = ``CV_8U``, ``ddepth`` = -1/``CV_16S``/``CV_32F``/``CV_64F`` + * ``src.depth()`` = ``CV_16U``/``CV_16S``, ``ddepth`` = -1/``CV_32F``/``CV_64F`` + * ``src.depth()`` = ``CV_32F``, ``ddepth`` = -1/``CV_32F``/``CV_64F`` + * ``src.depth()`` = ``CV_64F``, ``ddepth`` = -1/``CV_64F`` + + when ``ddepth=-1``, the destination image will have the same depth as the source. In the case of 8-bit input images it will result in truncated derivatives. :param xorder: Order of the derivative x. @@ -1572,9 +1578,9 @@ Calculates the first x- or y- image derivative using Scharr operator. :param src: Source image. - :param dst: Destination image of the same size and the same number of channels as ``src`` . + :param dst: Destination image of the same size and the same number of channels as ``src``. - :param ddepth: Destination image depth. + :param ddepth: Destination image depth. See :ocv:func:`Sobel` for the list of supported combination of ``src.depth()`` and ``ddepth``. :param xorder: Order of the derivative x. @@ -1582,7 +1588,7 @@ Calculates the first x- or y- image derivative using Scharr operator. :param scale: Optional scale factor for the computed derivative values. By default, no scaling is applied. See :ocv:func:`getDerivKernels` for details. - :param delta: Optional delta value that is added to the results prior to storing them in ``dst`` . + :param delta: Optional delta value that is added to the results prior to storing them in ``dst``. :param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` for details. diff --git a/modules/imgproc/src/filter.cpp b/modules/imgproc/src/filter.cpp index efe552a..a23e862 100644 --- a/modules/imgproc/src/filter.cpp +++ b/modules/imgproc/src/filter.cpp @@ -2804,6 +2804,8 @@ cv::Ptr cv::getLinearRowFilter( int srcType, int bufType, if( sdepth == CV_32F && ddepth == CV_32F ) return Ptr(new RowFilter (kernel, anchor, RowVec_32f(kernel))); + if( sdepth == CV_32F && ddepth == CV_64F ) + return Ptr(new RowFilter(kernel, anchor)); if( sdepth == CV_64F && ddepth == CV_64F ) return Ptr(new RowFilter(kernel, anchor)); -- 2.7.4