1.halcon导出C#文件,在C#里面调用
2.在C#里面使用Halcon引擎调用Halcon程序,直接运行主程序
3.在C#里面使用Halcon引擎调用.hdev下本地函数或者.hdvp外部函数
Halcon引擎手册:C:/Program Files/MVTec/HALCON-21.11-Progress/doc_en_US/html/manuals/programmers_guide/programmers_guide_0120.html

1.导出C#(代码我只给出类,需要调用)
using VIA.ImageProcessing;
using HalconDotNet;
using System.Runtime.InteropServices;
using Halcon_接口;
class Test
{
/// <summary>
/// C#调用接口
/// </summary>
/// <returns></returns>
public bool Measure(Imagecustom Image_Light, Imagecustom Image_Gray, string LeftOrRight,out double[] Result_Distance,out double[] Result_Height,out HTuple Display_Handle)
{
HObject Display = new HObject();
HTuple result_Distance=new HTuple();
HTuple result_Height=new HTuple();
try
{
int Len = Image_Light.Length;
int Width = Image_Light.Width;
ToHobject3D(Image_Gray.Data, Width, Len, out HObject Image_Gray_A);
ToHobject3D(Image_Light.Data, Width, Len, out HOb
365



被折叠的 条评论
为什么被折叠?



