|
@@ -1,39 +1,39 @@
|
|
|
-import java.io.FileNotFoundException;
|
|
|
-import java.io.PrintWriter;
|
|
|
-import java.util.ArrayList;
|
|
|
-
|
|
|
-public class TestMeanShift {
|
|
|
- public static void main(String[] args) throws FileNotFoundException {
|
|
|
- ArrayList<Double> pointx_input;
|
|
|
- ArrayList<Double> pointy_input;
|
|
|
- ArrayList<Double> centerx_history_forArea = new ArrayList<>();
|
|
|
- ArrayList<Double> centery_history_forArea = new ArrayList<>();
|
|
|
- double RusedforMeanshift = 40;
|
|
|
- java.io.File file2 = new java.io.File("C:\\Users\\87969\\Desktop\\test\\MeanShift.txt");
|
|
|
- PrintWriter Result_OutPut = new PrintWriter(file2);
|
|
|
- ReadData readData = new ReadData();
|
|
|
- readData.Read();
|
|
|
- MeanShift meanShift = new MeanShift();
|
|
|
- meanShift.setPointxAndPointy(readData.pointx_input,readData.pointy_input);
|
|
|
- meanShift.setR(RusedforMeanshift);
|
|
|
- ArrayList<ResultDataType> result ;
|
|
|
- result = meanShift.mainLoop();
|
|
|
- for(int i = 0 ; i < result.size();i++){
|
|
|
- Result_OutPut.println(result.get(i).numOfPoint);
|
|
|
- }
|
|
|
- Result_OutPut.close();
|
|
|
- pointx_input = readData.pointx_input;
|
|
|
- pointy_input = readData.pointy_input;
|
|
|
- centerx_history_forArea = meanShift.centerx_history_forArea;
|
|
|
- centery_history_forArea = meanShift.centery_history_forArea;
|
|
|
- CalculateArea calculateArea = new CalculateArea(pointx_input,pointy_input,centerx_history_forArea,centery_history_forArea);
|
|
|
- calculateArea.setRusedforMeanShift(RusedforMeanshift);
|
|
|
- calculateArea.setSplitTheta(Math.PI / 180);
|
|
|
- calculateArea.setSplitRadiusWidth(0.3 * RusedforMeanshift);
|
|
|
- calculateArea.setIncreasingRate(1.005);
|
|
|
- calculateArea.configFinalCircle();
|
|
|
- calculateArea.exchange();
|
|
|
- calculateArea.DktoPolar();
|
|
|
- calculateArea.LoopforCalculateArea();
|
|
|
- }
|
|
|
-}
|
|
|
+//import java.io.FileNotFoundException;
|
|
|
+//import java.io.PrintWriter;
|
|
|
+//import java.util.ArrayList;
|
|
|
+//
|
|
|
+//public class TestMeanShift {
|
|
|
+// public static void main(String[] args) throws FileNotFoundException {
|
|
|
+// ArrayList<Double> pointx_input;
|
|
|
+// ArrayList<Double> pointy_input;
|
|
|
+// ArrayList<Double> centerx_history_forArea = new ArrayList<>();
|
|
|
+// ArrayList<Double> centery_history_forArea = new ArrayList<>();
|
|
|
+// double RusedforMeanshift = 40;
|
|
|
+// java.io.File file2 = new java.io.File("C:\\Users\\87969\\Desktop\\test\\MeanShift.txt");
|
|
|
+// PrintWriter Result_OutPut = new PrintWriter(file2);
|
|
|
+// ReadData readData = new ReadData();
|
|
|
+// readData.Read();
|
|
|
+// MeanShift meanShift = new MeanShift();
|
|
|
+// meanShift.setPointxAndPointy(readData.pointx_input,readData.pointy_input);
|
|
|
+// meanShift.setR(RusedforMeanshift);
|
|
|
+// ArrayList<ResultDataType> result ;
|
|
|
+// result = meanShift.mainLoop();
|
|
|
+// for(int i = 0 ; i < result.size();i++){
|
|
|
+// Result_OutPut.println(result.get(i).numOfPoint);
|
|
|
+// }
|
|
|
+// Result_OutPut.close();
|
|
|
+// pointx_input = readData.pointx_input;
|
|
|
+// pointy_input = readData.pointy_input;
|
|
|
+// centerx_history_forArea = meanShift.centerx_history_forArea;
|
|
|
+// centery_history_forArea = meanShift.centery_history_forArea;
|
|
|
+// CalculateArea calculateArea = new CalculateArea(pointx_input,pointy_input,centerx_history_forArea,centery_history_forArea);
|
|
|
+// calculateArea.setRusedforMeanShift(RusedforMeanshift);
|
|
|
+// calculateArea.setSplitTheta(Math.PI / 180);
|
|
|
+// calculateArea.setSplitRadiusWidth(0.3 * RusedforMeanshift);
|
|
|
+// calculateArea.setIncreasingRate(1.005);
|
|
|
+// calculateArea.configFinalCircle();
|
|
|
+// calculateArea.exchange();
|
|
|
+// calculateArea.DktoPolar();
|
|
|
+// calculateArea.LoopforCalculateArea();
|
|
|
+// }
|
|
|
+//}
|