这里以DL字符识别CPU模块为例,代码如下,其中0.5f是比例关系(将图看作1)。
1. C#
2. public void OCRROISetFunc(ref VMControls.WPF.Release.VmRenderControl vmRenderControl1)
3. {
4. /////////OCRROISET
5. IMVSOcrDlModuCTool iMVSOcrDlModuCTool = (IMVSOcrDlModuCTool)VmSolution.Instance["流程1.DL字符识别C1"];
6. RoiBox roiBox = new RoiBox();
7. roiBox.bRoiType = (byte)RoiType.ROI_TYPE_BOX;
8. roiBox.fCenterX = 0.5f;
9. roiBox.fCenterY = 0.68f;
10. roiBox.fWidth = 0.5f;
11. roiBox.fHeight = 0.1f;
12.
13. IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(roiBox));
14. Marshal.StructureToPtr(roiBox, ptr, false);
15. iMVSOcrDlModuCTool.ModuParams.SetBinaryData("RoiType", ptr, (uint)Marshal.SizeOf(roiBox));
16. vmRenderControl1.ModuleSource = iMVSOcrDlModuCTool;
17. }
探寻机器视觉新星|第二届“启智杯”机器视觉设计大赛获奖名单公布
2024-04-08 16:39:23