资源简介
halcon引擎学习笔记(七)在在HDevEngine/C#中使用实时编译器JIT http://www.skcircle.com/?id=1349
halcon引擎学习笔记(六)多线程并发执行外部函数,多窗口显示 http://www.skcircle.com/?id=1350
halcon引擎学习笔记(五)多线程并发执行外部函数 http://www.skcircle.com/?id=1348
halcon引擎学习笔记(四)调用时的错误处理 http://www.skcircle.com/?id=1347
halcon引擎学习笔记(三)执行本地或者外部程序 http://www.skcircle.com/?id=1346
halcon引擎学习笔记(二)执行Procedure程序,扩展名为hdvp的halcon函数 http://www.skcircle.com/?id=1345
halcon引擎学习笔记(一)执行hdev程序 http://www.skcircle.com/?id=1344
环境:halcon19.11, vs2013
演示程序by勇哥 www.skcircle.com
代码片段和文件信息
using HalconDotNet;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private HDevOpMultiWindowImpl MyHDevOperatorImpl;
private HDevProgramCall ProgramCall;
private HWindow Window;
string ProgramPathString = @“C:\Users\Public\Documents\MVTec\HALCON-19.11-Progress\examples\hdevengine\hdevelop\fin_detection1.hdev“;
private HDevEngine MyEngine = new HDevEngine();
public Form1()
{
InitializeComponent();
}
private void DisplayException(HDevEngineException Ex)
{
string FullMessage = “Message: <“ + Ex.Message + “>“ + “ Error in program/procedure: <“
+ Ex.ProcedureName + “>“ + “program line:<“ + Ex.LineText + “>“ + “line number: <“ +
Ex.LineNumber + “>“ + “HALCON Error Number:<“ + Ex.Halconerror + “>“;
string title = “HDevEngine Exception (Category:“ + Ex.Category.ToString() + “)“;
MessageBox.Show(FullMessage title);
}
private void button1_Click(object sender EventArgs e)
{
try
{
MyEngine.SetHDevOperators(MyHDevOperatorImpl);
var Program = new HDevProgram(ProgramPathString);
ProgramCall = new HDevProgramCall(Program);
ProgramCall.Execute();
MessageBox.Show(“ok“);
}
catch (HDevEngineException Ex)
{
DisplayException(Ex);
return;
}
catch
{
MessageBox.Show(“其它错误“);
return;
}
}
private void button2_Click(object sender EventArgs e)
{
try
{
MyEngine.SetHDevOperators(MyHDevOperatorImpl);
var pro = new HDevProcedureCall(new HDevProcedure( “detect_fin_with_error_inpnotinit“));
Hobject img=new Hobject();
HOperatorSet.ReadImage(out img “e:\\timg.jpg“);
pro.SetInputIconicParamobject(“Image“ img);
pro.Execute();
}
catch (HDevEngineException Ex)
{
DisplayException(Ex);
return;
}
catch
{
MessageBox.Show(“其它错误“);
return;
}
}
private void Form1_Load(object sender EventArgs e)
{
var halconExamples = HSystem.GetSystem(“example_dir“);
var ProcedurePath = halconExamples + @“\hdevengine\procedures“;
MyEngine.SetProcedurePath(ProcedurePa
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 187 2020-06-26 15:00 halcon引擎例程\Error Handling\WindowsFormsApplication1\App.config
文件 1507848 2019-11-13 19:38 halcon引擎例程\Error Handling\WindowsFormsApplication1\bin\Debug\halcondotnet.dll
文件 4582423 2019-11-13 19:20 halcon引擎例程\Error Handling\WindowsFormsApplication1\bin\Debug\halcondotnet.xm
文件 65544 2019-11-13 19:38 halcon引擎例程\Error Handling\WindowsFormsApplication1\bin\Debug\hdevenginedotnet.dll
文件 45654 2019-11-13 19:20 halcon引擎例程\Error Handling\WindowsFormsApplication1\bin\Debug\hdevenginedotnet.xm
文件 12800 2020-06-27 10:21 halcon引擎例程\Error Handling\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
文件 187 2020-06-26 15:00 halcon引擎例程\Error Handling\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe.config
文件 34304 2020-06-27 10:21 halcon引擎例程\Error Handling\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
文件 24216 2020-06-27 11:24 halcon引擎例程\Error Handling\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
文件 187 2020-06-26 15:00 halcon引擎例程\Error Handling\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.config
文件 490 2010-03-17 22:39 halcon引擎例程\Error Handling\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
文件 4047 2020-06-27 10:21 halcon引擎例程\Error Handling\WindowsFormsApplication1\Form1.cs
文件 4944 2020-06-27 09:33 halcon引擎例程\Error Handling\WindowsFormsApplication1\Form1.Designer.cs
文件 5817 2020-06-27 09:33 halcon引擎例程\Error Handling\WindowsFormsApplication1\Form1.resx
文件 10452 2020-06-26 15:02 halcon引擎例程\Error Handling\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7805 2020-06-27 09:24 halcon引擎例程\Error Handling\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 0 2020-06-26 15:00 halcon引擎例程\Error Handling\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
文件 0 2020-06-26 15:00 halcon引擎例程\Error Handling\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
文件 0 2020-06-26 15:00 halcon引擎例程\Error Handling\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
文件 7982 2020-06-27 11:24 halcon引擎例程\Error Handling\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt
文件 977 2020-06-27 09:54 halcon引擎例程\Error Handling\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.GenerateResource.Cache
文件 13549 2020-06-26 15:07 halcon引擎例程\Error Handling\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csprojResolveAssemblyReference.cache
文件 12800 2020-06-27 10:21 halcon引擎例程\Error Handling\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.exe
文件 180 2020-06-27 09:54 halcon引擎例程\Error Handling\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Form1.resources
文件 34304 2020-06-27 10:21 halcon引擎例程\Error Handling\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.pdb
文件 180 2020-06-26 15:08 halcon引擎例程\Error Handling\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Properties.Resources.resources
文件 536 2020-06-26 15:00 halcon引擎例程\Error Handling\WindowsFormsApplication1\Program.cs
文件 1390 2020-06-26 15:00 halcon引擎例程\Error Handling\WindowsFormsApplication1\Properties\AssemblyInfo.cs
文件 2900 2020-06-26 15:00 halcon引擎例程\Error Handling\WindowsFormsApplication1\Properties\Resources.Designer.cs
文件 5612 2020-06-26 15:00 halcon引擎例程\Error Handling\WindowsFormsApplication1\Properties\Resources.resx
............此处省略286个文件信息
评论
共有 条评论