-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregionGrowingMain.cpp
executable file
·37 lines (34 loc) · 1 KB
/
regionGrowingMain.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
#include "showImage.h"
#include "histogram2.h"
#include "otsuThresholding.h"
#include "imageSegmentation.h"
#include "regionGrowing.h"
int main( int argc, char** argv ){
Mat image=loadImage(argv[1]);
histogram before=createHist(256),after=createHist(256);
Mat imageGr=Grayscaler(image);
showImage(imageGr,"Grayscale");
fillHistogram(&before,imageGr);
drawHistogram(before,"before");
waitKey(0);
int jumlahsegmentasi;
int input=0;
std::cout << "jumlah segmentasi : ";
std::cin >> jumlahsegmentasi;
std::cout << "tipe segmentasi : " << std::endl;
std::cout << "1. Threshold" << std::endl;
std::cout << "2. intensity" << std::endl;
std::cin >> input;
switch (input) {
case 1:
MoreRegionGrowingByThreshold(imageGr,before,jumlahsegmentasi);
break;
case 2:
MoreRegionGrowingByIntensity(imageGr,before,jumlahsegmentasi);
break;
default:
return 0;
}
// Wait for a keystroke in the window
return 0;
}