Hi I have a C# program that opens a process and calls a python script to execute some operations on an image.
Currently, I'm saving the image to the disk and passing the path to my python script as an argument, but I want to speed it up and wonder if I can use memory stream instead.
var psi = new ProcessStartInfo();
psi.FileName = @"python_interpreter_path";
var script = @"my_python_script_path";
psi.Arguments = script;
psi.UseShellExecute = false;
psi.CreateNoWindow = true;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
var errors = "";
var results = "";
using (var process = Process.Start(psi))
{
errors = process.StandardError.ReadToEnd();
results = process.StandardOutput.ReadToEnd();
Console.WriteLine(errors);
Console.WriteLine(results);
}
I've got a python script that can decode a data stream and open it as an image using cv2.imread(). But I clueless on what to do with my c# code.
Any help is welcome! Thanks