private bool Internal_DecideImage(MLApp.MLApp matlab, ImageVector image, int algo) { string csvPathDecide = userPath + "\\Decide.txt"; string resultPath = userPath + "\\Result.txt"; System.IO.StreamWriter file = new System.IO.StreamWriter(@csvPathDecide, false); file.WriteLine(image.getAllParameters(false)); file.Close(); string command = Internal_GetCommand(algo); matlab.Execute(command); string[] readText = File.ReadAllLines(resultPath); if (readText[0] == "0") return false; return true; }
private bool Internal_DecideImage(MLApp.MLApp matlab, ImageVector image, int algo) { string csvPathDecide = userPath + "\\Decide.txt"; int result = 0; System.IO.StreamWriter file = new System.IO.StreamWriter(@csvPathDecide, false); file.WriteLine(image.getAllParameters(false)); file.Close(); string commandBestKnn = Internal_GetCommand(2); string commandBestSvm = Internal_GetCommand(10); if (algo != 1) { matlab.Execute(commandBestKnn); result += Internal_GetResult(); } if (algo != 0) { matlab.Execute(commandBestSvm); result += Internal_GetResult(); } if (result == 2) return true; if ((algo != 2) && (result == 1)) return true; return false; }