OpenCV function filter2D is used to create new linear filters.
void filter2D(InputArray src, OutputArray dst, int ddepth, InputArray kernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
Parameters:
The code provided below is slight modification of code provided in OpenCV documentation.
void filter2D(InputArray src, OutputArray dst, int ddepth, InputArray kernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
Parameters:
- src – input image.
- dst – output image of the same size and the same number of channels as src.
- ddepth – desired depth of the destination image; if it is negative, it will be the same as src.depth(); the following combinations 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
- kernel – convolution kernel (or rather a correlation kernel), a single-channel floating point matrix; if you want to apply different kernels to different channels, process them individually.
- anchor – anchor of the kernel that indicates the relative position of a filtered point within the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor is at the kernel center.
- delta – optional value added to the filtered pixels before storing them in dst.
- borderType – pixel extrapolation method (see borderInterpolate() for details).
The code provided below is slight modification of code provided in OpenCV documentation.
Steps:
- Load image
- Create a kernel to convolve with the input matrix ( here all elements of kernel is equal; so performs a low pass filter operation)
- Apply convolution (filter2D)
- Draw contours
Functions:
Example:
-------------#include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include <stdlib.h> #include <stdio.h> using namespace cv; void conv2(Mat src, int kernel_size) { Mat dst,kernel; kernel = Mat::ones( kernel_size, kernel_size, CV_32F )/ (float)(kernel_size*kernel_size); /// Apply filter filter2D(src, dst, -1 , kernel, Point( -1, -1 ), 0, BORDER_DEFAULT ); namedWindow( "filter2D Demo", CV_WINDOW_AUTOSIZE );imshow( "filter2D Demo", dst ); } int main ( int argc, char** argv ) { Mat src; /// Load an image src = imread( "1.jpg" ); if( !src.data ) { return -1; } conv2(src,3); waitKey(0); return 0; }-------------
this is not even correct... filter2D does not do convolutions, but rather correlation.
ReplyDeleteIt does, but most of the filters are symmetric. Hence the convolutions just look like correlation.
DeleteTrung tâm dạy kế toán Tại cầu giấy
ReplyDeleteTrung tâm dạy kế toán Tại từ liêm
Trung tâm dạy kế toán Tại thanh xuân
Trung tâm dạy kế toán Tại hà đông
Trung tâm dạy kế toán Tại long biên
Trung tâm dạy kế toán Tại nguyễn chính thanh đống đa
Trung tâm dạy kế toán Tại minh khai hai bà trưng
Trung tâm dạy kế toán Tại bắc ninh
Trung tâm dạy kế toán Tại hải phòng
Trung tâm dạy kế toán Tại tphcm
Trung tâm dạy kế toán Tại quận 3
Trung tâm dạy kế toán Tại thủ đức
Trung tâm dạy kế toán Tại đà nẵng
Trung tâm dạy kế toán Tại biên hòa
Trung tâm dạy kế toán Tại đồng nai
Trung tâm dạy kế toán Tại nam định
Trung tâm dạy kế toán Tại thái bình
Trung tâm dạy kế toán Tại bắc giang
Trung tâm dạy kế toán Tại vĩnh phúc
Trung tâm dạy kế toán Tại thái nguyên
Trung tâm dạy kế toán Tại quảng ninh
Trung tâm dạy kế toán Tại hải dương
Trung tâm dạy kế toán Tại hưng yên
Trung tâm dạy kế toán Tại hà nam
Trung tâm dạy kế toán Tại ninh bình
Trung tâm dạy kế toán Tại nghệ an
Trung tâm dạy kế toán Tại vũng tàu
learning java to beginners
ReplyDeleteشركة تنظيف منازل بالجبيل
ReplyDeleteيوجد العديد من شركات التنظيف المختلفة في الجبيل ولكننا نعد من أقوى الشركات الرائدة في مجالات التنظيف المختلفة بالمنازل حيث تشمل شركة تنظيف منازل بالجبيل على أقوى وسائل النظافة المختلفة وأحدث المعدات والتقينيات الحديثة وأجود انواع المساحيق والصابون والمنظفات الخاصة بالتنظيف في منازل وفلل وقصور ومكاتب وشركات ومؤسسات الجبيل بالجودة العالية وبأقل سعر ممكن.
شركة تنظيف منازل بالجبيل
قم باختيار الشركة المناسبة لنظافة منزلك وأنتبه من الشركات الأخرى التي تستخدم الوسائل التقليدية في تنظيف البلاط والسيراميك والأرضيات بالإضافة إلى إنها تستخدم مساحيق غير فعالة في التخلص من البقع الصعبة والتي لا جدوى منها وبالتالي فأنها تعطيك نتائج غير راضية لك ، ولكن عند إختيارك إلى شركة نظافة بالجبيل فإنها تعطي لك نتائج باهرة في النظافة حيث إنها تستخدم أقوى المعدات والاجهزة الحديثة في نظافة المنازل وتقوم على تنظيف الكنب والأرضيات وجلي البلاط وتلميع السيراميك بالإضافة إلى تنظيف السجاد والموكيت والستائر وكافة أثاث المنزل المختلفة.
مميزات شركة شركة تنظيف بالجبيل
تقوم على عمليات التنظيف من خلال إعتمادها على أمهر العمالة المدربة وعلى أيدي محترفين في مجالات النظافة المختلفة كما إنها تعتمد على المتخصصين في التنظيف الشامل بالجودة العالية حيث إنهم لديهم القدرة على كيفية إستخدام الأجهزة والماكينات الخاصة بالنظافة بالإضافة إلى تعليمهم لأستخدام أجهزة الشفط والغسيل للمجالس وأجهزة البخار التي تعمل على تنظيف الموكيت والسجاد أي أن الشركة تشمل على كافة المعدات اللازمة في النظافة مع توفير العمالة المدربة على أعلى مستوى.
https://forsan-dmm.com/cleaning-company-in-jubail/
لمزيد من خدماتنا
شركة نظافة بالخبر
المثلث الذهبي لنقل العفش بالجبيل والمنطقة الشرقية والنظافة العامة للمساجد والفلل والمنازل شركة نقل عفش بالجبيل وكذلك شحن العفش الى مصر
ReplyDelete