-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangleDistanceSignature.cpp
executable file
·45 lines (40 loc) · 1.4 KB
/
angleDistanceSignature.cpp
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
#include "showImage.h"
#include "histogram2.h"
#include "angleDistance.h"
#include "otsuThresholding.h"
#include "imageSegmentation.h"
int main( int argc, char** argv ){
Mat image=loadImage(argv[1]);
histogram before=createHist(256),after=createHist(256);
// showImage(image,"Base Image");
Mat imageGr=Grayscaler(image);
showImage(imageGr,"Grayscale");
waitKey(0);
fillHistogram(&before,imageGr);
statistikHistogram(before);
Mat Seg = singleThresholdSegmentation(imageGr,otsuThresholding(before),255);
showImage(Seg,"Otsu");
waitKey(0);
int midObject;
std::cout << "what middle object intensity u see ? 255 (white )/ 0 Black" << '\n';
cin>>midObject;
// Mat Bond = boundary(Seg,midObject);
// showImage(Bond,"Boundary");
position tes=getCentroid(Seg,midObject);
DAShistogram DH1 = DistanceAngleHistogram(Seg,midObject ,72);
drawHistogram(DH1,"Histo");
string fileName=argv[1];
fileName+=".DAS";
// std::cout << "fileName = "<<fileName << '\n';
saveDAS(DH1,fileName);
waitKey(0);
// normalize (&haha);
// drawHistogram(haha,"histo2");
// showImage(drawline(Seg,tes,255),"Line");
// std::vector<double> haha2 =normalize(haha);
// drawNormalHistogram(haha2,"Histo2");
// showImage(boundary(Seg,0),"Testinger");
// waitKey(0);
// std::cout << "Modus haha"<<getModus(haha) << std::endl;
return 0;
}