|
@@ -0,0 +1,44 @@
|
|
|
+using MathNet.Numerics.LinearAlgebra;
|
|
|
+using MathNet.Numerics.LinearAlgebra.Complex;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Diagnostics;
|
|
|
+using System.IO;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+
|
|
|
+namespace Assets.StreetLight
|
|
|
+{
|
|
|
+ internal class HomographyCalculator
|
|
|
+ {
|
|
|
+ internal Matrix<double> InverseMatrix(Matrix<double> matrix)
|
|
|
+ {
|
|
|
+ ProcessStartInfo start = new ProcessStartInfo
|
|
|
+ {
|
|
|
+ FileName = "cmd.exe",
|
|
|
+
|
|
|
+ UseShellExecute = false,
|
|
|
+ CreateNoWindow = true,
|
|
|
+ RedirectStandardInput = true,
|
|
|
+ RedirectStandardOutput = true,
|
|
|
+ RedirectStandardError = true
|
|
|
+ };
|
|
|
+
|
|
|
+ using (Process process = Process.Start(start))
|
|
|
+ {
|
|
|
+ using (var input = process.StandardInput)
|
|
|
+ {
|
|
|
+ input.WriteLine("C:\\Users\\nick.steyer\\Anaconda3\\Scripts\\activate.bat");
|
|
|
+ input.WriteLine("conda run -n HomographyCalculator python C:\\Users\\nick.steyer\\SmartStreetLight\\HomographyCalculator\\main.py");
|
|
|
+ }
|
|
|
+
|
|
|
+ using StreamReader reader = process.StandardOutput;
|
|
|
+ string stderr = process.StandardError.ReadToEnd();
|
|
|
+ string result = reader.ReadToEnd();
|
|
|
+ }
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|