Object Detection  5.0
Image Processing Using Qt and Opencv
erodeplugin.cpp
1 #include "erodeplugin.h"
2 #include <opencv2/imgproc.hpp>
3 namespace MorphoLogical {
4  ErodePlugin::ErodePlugin(QObject *parent): QObject(parent)
5  {
6 
7  }
8 
9  QString ErodePlugin::filterName() const
10  {
11  return "Erode Plugin";
12  }
13 
14  cv::Mat ErodePlugin::filter(cv::Mat src) const
15  {
16  cv::Mat element = getStructuringElement(cv::MORPH_RECT,
17  cv::Size( 2 * 4 + 1, 2 * 4 + 1 ),
18  cv::Point( 4, 4 ) );
19  cv::erode( src, src, element);
20  return src;
21  }
22 
23  QString ErodePlugin::filterDescription() const
24  {
25  return "Applies Erode Operation on Image( Must Be Black and white)";
26  }
27 
28  QString ErodePlugin::author() const
29  {
30  return "Mohamed Khaled";
31 
32  }
33 }