-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangleDistance.h
executable file
·70 lines (52 loc) · 1.72 KB
/
angleDistance.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
#ifndef ANGLEDISTANCE_H
#define ANGLEDISTANCE_H
#include "showImage.h"
#include "histogram2.h"
#include "regionGrowing.h"
#include "otsuThresholding.h"
// #include <sstream>
#include <fstream>
#define RAD(theta) (3.14)*((double)theta/180.0)
// template<typename T,int N> //template argument deduction
// int size(T (&arr1)[N]) //Passing the array by reference
// {
// size_t size;
// size=sizeof(arr1)/sizeof(arr1[0]);
//
// std::cout<<size<<std::endl; //Correctly prints the size of arr
//
// //EDIT
//
// return N; //Correctly prints the size too [cool trick ;-)]
// }
struct position{
int x,y;
};
struct DAShistogram{
std::vector<double> arr;
position centroid;
int segInt;
int times,max,min;
};
position createPos(int x,int y);
position getCentroid(Mat Img,int segInt);
position getCentroidBoundary(Mat Img);
Mat setCentroid(Mat Img,int segInt);
int getModus(DAShistogram h);
int getModusIndeks(DAShistogram h);
void drawHistogram(DAShistogram h,string name);
void drawNormalHistogram(std::vector<double> h,string name);
Mat drawline(Mat Img,position centroid,int segInt);
int getDistance(Mat Img,position centroid,int segInt,int theta);
int getDistanceBoundary(Mat Img, position centroid, int theta);
int getDistanceTrigonometri(Mat Img,position centroid,int segInt,int theta);
DAShistogram DistanceAngleHistogram(Mat Img,int segInt,int times);
DAShistogram DistanceAngleHistogramBoundary(Mat Img,int times);
void saveDAS(DAShistogram h,string fileName);
DAShistogram loadDAS(string fileName);
bool isSame(DAShistogram a,DAShistogram b);
double differenceMean(DAShistogram a,DAShistogram b);
std::vector<double> normalize(DAShistogram h);
void normalize(DAShistogram * h);
Mat boundary(Mat Img, int segInt);
#endif