1 var iamgeGrey = new CogImage8Grey(Raw2Bitmap(imagebyte, width, height)); 2 CogToolBlock tb = (CogToolBlock)(CogSerializer.LoadObjectFromFile(vppName)); 3 4 //输入 5 tb.Inputs["inputImage"].Value = iamgeGrey; 6 //运行流程 7 tb.Run(); 8 9 获取Vpp中算子工具 10 CogToolBlock tbOut = (CogToolBlock)tb.Tools["tbOut"]; 11 string Ret = (string)tbOut.Outputs["retStr"].Value; 12 13 ICogRecord recordLast = tb.CreateLastRunRecord(); 14 ICogRecord record = null; 15 if (tb.Tools.Contains("CogSubImage")) //看你vpp中是怎么编辑的流程 16 { 17 record = recordLast.SubRecords["CogSubImage.OutputImage"]; //提取需要显示对象 18 CogIPOneImageTool img_tool = (CogIPOneImageTool)tb.Tools["CogSubImage"];
img_tool.OutputImage.ToBitmap().Save(@"D:\tmp.bmp"); 19 } 20 else 21 { 22 record = recordLast.SubRecords[0];//获取tb里面LastRunRecord的第一项 23 }
//...
//对输出进行处理,可以将图片显示到sdk中的控件中
标签:record,c#,recordLast,tbOut,VisionPro,CogSubImage,CogToolBlock,tb,SDK From: https://www.cnblogs.com/zengxiaowei/p/18521695