From b52b6b2e76d48ee7e375d4adea91cdc23ef9eae0 Mon Sep 17 00:00:00 2001 From: ser1zw Date: Sat, 18 Jan 2014 18:44:21 +0900 Subject: [PATCH] add CvMat#smooth document --- ext/opencv/cvmat.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/ext/opencv/cvmat.cpp b/ext/opencv/cvmat.cpp index ef189ed..8c68140 100644 --- a/ext/opencv/cvmat.cpp +++ b/ext/opencv/cvmat.cpp @@ -4207,6 +4207,32 @@ rb_smooth_bilateral(int argc, VALUE *argv, VALUE self) return dest; } +/** + * Smooths the image in one of several ways. + * + * @overload smooth(smoothtype, size1 = 3, size2 = 0, sigma1 = 0, sigma2 = 0) + * @param smoothtype [Integer] Type of the smoothing. + * * CV_BLUR_NO_SCALE - linear convolution with size1 x size2 box kernel (all 1's). + * If you want to smooth different pixels with different-size box kernels, + * you can use the integral image that is computed using CvMat#integral. + * * CV_BLUR - linear convolution with size1 x size2 box kernel (all 1's) + * with subsequent scaling by 1 / (size1 x size1). + * * CV_GAUSSIAN - linear convolution with a size1 x size2 Gaussian kernel. + * * CV_MEDIAN - median filter with a size1 x size1 square aperture + * * CV_BILATERAL - bilateral filter with a size1 x size1 square aperture, + * color sigma = sigma1 and spatial sigma = sigma2. + * If size1 = 0, the aperture square side is set to CvMat#round(sigma2 * 1.5) * 2 + 1. + * @param size1 [Integer] The first parameter of the smoothing operation, the aperture width. + * Must be a positive odd number (1, 3, 5, ...) + * @param size2 [Integer] The second parameter of the smoothing operation, the aperture height. + * Ignored by CV_MEDIAN and CV_BILATERAL methods. In the case of simple + * scaled/non-scaled and Gaussian blur if size2 is zero, it is set to size1. + * Otherwise it must be a positive odd number. + * @param sigma1 [Integer] In the case of a Gaussian parameter this parameter may specify + * Gaussian sigma (standard deviation). If it is zero, it is calculated from the kernel size. + * @return [CvMat] The destination image. + * @opencv_func cvSmooth + */ VALUE rb_smooth(int argc, VALUE *argv, VALUE self) { @@ -5638,7 +5664,8 @@ rb_find_fundamental_mat(int argc, VALUE *argv, VALUE klass) * lT*[x, y, 1]T=0, * or * a*x + b*y + c = 0 - * From the fundamental matrix definition (see cvFindFundamentalMatrix discussion), line l2 for a point p1 in the first image (which_image=1) can be computed as: + * From the fundamental matrix definition (see cvFindFundamentalMatrix discussion), line l2 for a point p1 + * in the first image (which_image=1) can be computed as: * l2=F*p1 * and the line l1 for a point p2 in the second image (which_image=1) can be computed as: * l1=FT*p2