HALCON Progress Key Visual shows a person running at high speed

Programming with HALCON

Debugging within Visual Studio
HALCON variables can be inspected directly within Visual Studio

HALCON offers various interfaces to access all of HALCON's more than 2,000 powerful operators from programming languages like C, C++, Python, and .NET languages like C# or VB.NET. Its open architecture allows you to access defined data structures and thus to integrate HALCON with further software components such as a user interface or process control. For example, HALCON provides a powerful extension for Visual Studio.

The software also supports parallel programming, e.g., multithreaded programs. Thus, multiple threads can call HALCON operators simultaneously. All of this, together with HALCON's inbuilt high-performance memory management lets you concentrate on your application development and quickly come to a solution.

HALCON/.NET

HALCON/.NET is HALCON’s interface to .NET programming languages, e.g., C# or Visual Basic .NET. It provides you with a set of .NET classes and visualization controls for Windows Forms and WPF and offers full support of HALCON functionality. Two HALCON/.NET variants for both .NET platforms, the former .NET Framework and the new .NET Core platform are available with identical interfaces and behavior.

The HALCON/.NET Core can be used on any HALCON standard platform.

HALCON/C++

With HALCON/C++ you can access the whole functionality of HALCON based on a C++ class hierarchy. This enables you to develop programs that are very compact and easy to maintain. HALCON/C++ is available on Windows, Linux, and macOS.

HDevelop

If you develop your solution with the interactive rapid prototyping environment HDevelop, the integration is very easy, since HDevelop can export your application as C++, C, C#, or Visual Basic source code. Furthermore, using HDevEngine, you can also integrate your machine vision program code easily into your application.

HDevEngine

The "HDevelop Engine" is a library that acts as an interpreter and lets you directly load and execute HDevelop programs and procedures from within your C++, C#, or Visual Basic application. This allows you to change the vision part of your application without the need of compiling it.

Dictionaries

In order to handle complex data more easily, HALCON offers a new data structure "dictionary". It is an associate array, that enables, e. g., to bundle different complex data types (like an image, corresponding ROIs, and parameters) into one single variable. This way you can simply structure programs for, e.g., passing many parameters to a procedure. Dictionaries can also be read from and written to a file. This allows an engineer to bundle all information necessary to reproduce a certain application's state (e.g., camera calibration settings, defective images, and machine parameters) into a single file. This file can then easily be shared with an machine vision expert for offline-debugging.

Parallel programming

HALCON not only supports multithreading and parallel programming but also provides automatic parallelization to exploit the power of multi-core or multiprocessor hardware. Read more about multi-core performance.

Automatic handle clearing

HALCON automatically clears handles once they are no longer required. This significantly reduces the risk of creating memory leaks and makes writing "safe code" much simpler.

Powerful debugging

HALCON supports debugging efforts of software developers tremendously. Using HALCON's extension for Visual Studio, C++, and C#/.NET, developers can inspect HALCON variables (tuples and iconic) directly within Visual Studio.

When executing HDevelop procedures inside a C# or C++ application via HDevEngine, the machine vision part of the application can be debugged directly within HDevelop – even remotely – by connecting it with HDevEngine.

Protection of know-how

HALCON secures the know-how of the software developer:

  • Code that is saved in external or local procedures, as well as code of entire procedure libraries or programs, can be secured with a password. Therefore, functionality can be shared without revealing the program code.
  • All serializable HALCON data can be encrypted and protected with a password as well. This allows customers to directly protect their intellectual property (e.g., trained deep learning models), protect iconic data that contains intellectual property, or strings including critical security information.