Applying Gaussian Filter

void GaussianBlur(InputArray src, OutputArray dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT )

Parameters:
  • src – input image; the image can have any number of channels, which are processed independently, but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  • dst – output image of the same size and type as src.
  • ksize – Gaussian kernel size. ksize.width and ksize.height can differ but they both must be positive and odd. Or, they can be zero’s and then they are computed from sigma* .
  • sigmaX – Gaussian kernel standard deviation in X direction.
  • sigmaY – Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be equal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height , respectively (see getGaussianKernel() for details); to fully control the result regardless of possible future modifications of all this semantics, it is recommended to specify all of ksize, sigmaX, and sigmaY.
  • borderType – pixel extrapolation method (see borderInterpolate() for details).
You can find a nice example in OpenCV Documentation

 Example:

-------------
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"

using namespace std;
using namespace cv;

int main( int argc, char** argv )
 {
  
     Mat src = imread( "salt.tif", 1 );
     Mat dst;

     //Apply median filter
     GaussianBlur( src, dst, Size( 5, 5 ), 0, 0 );
     imshow("source", src);
     imshow("result", dst);  

     waitKey(0);
     return 0;
 }

-------------

2 comments:

  1. Are you in need of Best Dissertation Writing Services? Then get connected with Affordable academic Help Online And get your assignment done on time.You will also get Homework Help Writing Services that will leave an impression.

    ReplyDelete
  2. أسباب ظهور حشرات المنزل



    بعد معرفة أبرز طرق مكافحة حشرات المنزل المناسبة لا بدّ من معرفة أسباب ظهورها، إذ توجد العديد من الأسباب والعوامل التي تساهم في انتشار الحشرات والآفات في المنازل، وفيما يأتي أبرز الأسباب والظروف التي تساعد على جذب الحشرات المنزلية:

    وجود العديد من أغصان الأشجار والشجيرات والأخشاب التي تعد مأوىً للآفات والحشرات. وجود بعض الشقوق والثغرات في النّوافذ والأبواب التي تسهم في دخول الحشرات إلى المنزل.

    عدم عزل أو إغلاق الشقوق والثغرات والفتحات الموجودة خارج المنازل باستخدام شبكة النِّحاس أو الصوف الخشن أو الصفائح المعدنيّة.

    عدم التخلّص من القمامة والأعشاب الضّارة ووجود المياه بشكل دائمٍ.

    وجود ثغرات أو شقوق في أرضيات والجدران المنزل مكشوفة.

    إِهمال مصارف المجاري وعدم فحصها والتأكِّد من سلامتها.

    الاحتفاظ بالمواد القابلة للتدوير والنفايات داخل المنزل.

    الاحتفاظ بالأطعمة الفاسدة أو القديمة في المنزل أو الاحتفاظ بها في أكياس أو حاويات مكشوفة غير مغلقة.

    إهمال المنزل وعدم تنظيفه بشكلٍ دوريّ.
    طرق مكافحة الحشرات

    ReplyDelete