以扫码作为示例,扫码halcon代码如下:
如果直接将halcon代码导出为C#代码,则得到面向过程形式的cs代码:
HOperatorSet.ReadImage(out ho_Image, "H:/test/二维码/Type1.jpg");
HOperatorSet.CreateDataCode2dModel("Data Matrix ECC 200", "default_parameters",
"maximum_recognition", out hv_DataCodeHandle);
HOperatorSet.SetDataCode2dParam(hv_DataCodeHandle, "polarity", "light_on_dark");
HOperatorSet.SetDataCode2dParam(hv_DataCodeHandle, "mirrored", "no");
HOperatorSet.SetDataCode2dParam(hv_DataCodeHandle, "timeout", 500);
HOperatorSet.FindDataCode2d(ho_Image, out ho_SymbolXLDs, hv_DataCodeHandle, new HTuple(),
new HTuple(), out hv_ResultHandles, out hv_DecodedDataStrings);
HOperatorSet.ClearD