Opencv learning notes (4)-cvsmooth Function

Source: Internet
Author: User

Opencv Smooth Functions

Void cvsmooth (<br/> const cvarr * SRC, <br/> cvarr * DST, <br/> int smooth = cv_gaussian, <br/> int param1 = 3, <br/> int param2 = 0, <br/> int param3 = 0, <br/> int param4 = 0 <br/> ); 

Note:

(1) You may not have a deep understanding of cvarr. You can think of it as a base class in C ++. Of course, it also includes iplimage.

(2) types supported by smooth:

Cv_blur sums param1, param2, and scales 1/(param1 * param2) to calculate the simple average value.

Cv_blur_no_scale the sum of param1 and param2 of each pixel in a blur without scaling variation. In particular, the input image and the result image must have different numerical precision to ensure that they do not happen.

Overflow. If the source image is 8u, The result image must be 16 s or 32 s.

Cv_median: the value of each pixel in the square field class of the center pixel is replaced by the median value.

When cv_gaussian Gaussian Blur param3 is zero, Gaussian convolution kernel Sigma is calculated using the following formula:

SIGMA (x) = (n (x)/2-1) * 0.30 + 0.80, n (x) = param1

SIGMA (y) = (N (y)/2-1) * 0.30 + 0.80, n (y) = param2

If the fourth parameter is specified, the third and fourth parameters represent the horizontal and vertical values of Sigma respectively.

If the third and fourth parameters have been specified, and the first two parameters are 0, the size of the window is determined by Sigma.

Slow but most effective

Cv_bilateral bidirectional filtering because Gaussian Blur is a slow change of pixels in the image space, but random two points may form a large

Pixel difference. Gaussian filtering reduces noise while retaining signals, but it is ineffective in areas close to the edge. bidirectional filtering can solve this problem, but it requires more time,

It requires two parameters. param1 indicates the width of the Gaussian Kernel used in the airspace, and param2 indicates the height of the Gaussian Kernel in The Color domain.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.