-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathacs.h
75 lines (53 loc) · 1.11 KB
/
acs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* Copyright 2013 Paulo Roberto Urio <paulourio@gmail.com> */
#ifndef ACS_H_
#define ACS_H_
#include <opencv2/core/core.hpp>
#include <vector>
#include "./ant.h"
#include "./global.h"
#include "./guicontroller.h"
#include "./random.h"
namespace acs {
/*
* Edge detection algorithm.
*/
class ACSEdgeDetection {
public:
ACSEdgeDetection(const cv::Mat& input, GUIController* controller);
virtual ~ACSEdgeDetection() = default;
void Compute();
cv::Mat pheromone() const {
return pheromone_;
}
cv::Mat output() const {
return output_;
}
int ant_count() const {
return ant_count_;
}
void set_ant_count(int ants) {
ant_count_ = ants;
}
int max_cycles() const {
return max_cyles_;
}
void set_max_cyles(int cycles) {
max_cyles_ = cycles;
}
private:
void InitAnts();
void UpdatePheromoneTrail();
void UpdateView();
void UpdateFinalView();
const cv::Mat& image_;
GUIController* controller_;
cv::Mat pheromone_;
cv::Mat output_;
Random random_;
std::vector<Ant> ants_;
int ant_count_;
int max_cyles_;
DISALLOW_COPY_AND_ASSIGN(ACSEdgeDetection);
};
} // namespace acs
#endif // ACS_H_