将 Image 对象作为参数从 C# 传递给 Python

cyl*_*end 5 c# python parameter-passing

我想将图像对象从我的 c# 项目传递给我的 python 脚本,但是根据我的理解,无论参数中有什么,它都被认为是字符串,而且当我尝试type(passedImage)在 python 中时,它会将它标识为字符串,即使我尝试放置一个数字而不是图像变量。

ProcessStartInfo start = new ProcessStartInfo();
            start.FileName = @"C:\Python\Python36\python.exe";
            start.Arguments = string.Format("{0} {1}", @"C:\OCRonImage2.py", image );
            start.UseShellExecute = false;
            start.RedirectStandardOutput = true;
            start.CreateNoWindow = true;
            using (Process process = Process.Start(start))
            {

            }
Run Code Online (Sandbox Code Playgroud)

Cor*_*rrM 2

我认为这很难IMAGE通过Argument

搭配的好选择: