[Learning opencv] Gaussian, mean, mean, and bilateral Filtering

Source: Internet
Author: User

The four classic filtering algorithms can be found in the opencv documentation. Familiarize yourself with the call specifications.

# Include "CV. H "# include" highgui. H "# include <iostream> using namespace STD; using namespace CV; int main (INT argc, char * argv []) {mat src = imread (" misaka.jpg "); mat DST; // parameters are written in sequence // Gaussian filter // SRC: input image // DST: output image // size (5, 5) template size, it is an odd number of // X direction variance // y direction variance gaussianblur (SRC, DST, size (5, 5),); imwrite ("gauss.jpg", DST ); // median filter // SRC: input image // DST: output image // template width, which is an odd number of medianblur (SRC, DST, 3); imwrite ("med.jpg ", DST); // mean filtering // SRC: input image // DST: output image // template size // point (-1,-1): smoothed point position, negative value: Core center blur (SRC, DST, size (3, 3), point (-1,-1); imwrite ("mean.jpg", DST ); // bilateral filter // SRC: input image // DST: input image // filter template radius // Color Space Standard Deviation // coordinate space standard deviation bilateralfilter (SRC, DST, 5, 10.0, 2.0); // here the filtering is ineffective, do not understand imwrite ("bil.jpg", DST); waitkey (); Return 0 ;}

Processing result:

Source image:

Gaussian filter:

Median Filter:

Mean Filtering:

Bilateral filtering. Do you think it works? How can I adjust parameters:

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.