Object Detection  5.0
Image Processing Using Qt and Opencv
objectdetectorbuilder.cpp
1 #include "objectdetectorbuilder.h"
2 using namespace ImageProcessor;
3 class ObjectDetectorBuilder::_ObjectDetectorBuilderImpl
4 {
6  std::vector<PluginSharedPointer> _processor;
7 public:
8  _ObjectDetectorBuilderImpl(ObjectDetectorBuilder *ptr):_ptr{ptr}{}
9  void addFilter(PluginSharedPointer proc);
10  std::unique_ptr<ObjectDetection> build();
11 };
12 
13 ObjectDetectorBuilder::~ObjectDetectorBuilder()
14 {
15 
16 }
17 
18 ObjectDetectorBuilder::ObjectDetectorBuilder(QObject *parent) : QObject(parent)
19  ,_pimpl{INIT_UNIQUE_PTR(_ObjectDetectorBuilderImpl, this)}
20 {
21 
22 }
23 
24 void ObjectDetectorBuilder::addFilter(PluginSharedPointer proc)
25 {
26  _pimpl->addFilter(proc);
27 }
28 
29 std::unique_ptr<ObjectDetection> ObjectDetectorBuilder::build()
30 {
31  return _pimpl->build();
32 }
33 
34 void ObjectDetectorBuilder::_ObjectDetectorBuilderImpl::addFilter(PluginSharedPointer proc)
35 {
36  _processor.push_back(proc);
37 }
38 
39 std::unique_ptr<ObjectDetection> ObjectDetectorBuilder::_ObjectDetectorBuilderImpl::build()
40 {
41  auto obj = INIT_UNIQUE_PTR(ObjectDetection);
42  obj->setFilters(_processor);
43  return obj;
44 }
this class is used to detect a a colored circle object(s)
Common Namespace for all Image Processor Algorithms.