JSON Extension Package for HALCON


Description

JSON Extension Package for HALCON

What?

The JSON Extension Package for HALCON is an extension package meant to create, modify and parse JSON strings within the HDevelop language.

Why?

The JSON Extension Package for HALCON brings advanced data structures to the HDevelop language.
Changes awkward procedure signatures like

                            OpenCamera (: : CamName, CamDevice, CamColorspace, CamBrightness, CamSaturation, CamBinning: AcqHandle)
                            ProcessImage (: : FilterMean, ThresholdMin, ThresholdMax, ScoreMin, NumMatches, MaxOverlap, SubPixel, NumLevels, Greediness, MinArea, MaxArea, CameraHandle: Result)
                          
to concise
                            OpenCamera (: : JsonSettings: AcqHandle)
                            ProcessImage (: : JsonSettings, CameraHandle: Result)
                          

This Extension Package also enables usage of persistent and human-readable configuration files which are compatible with modern web standards (Industry 4.0).

Details

The JSON Extension Package for HALCON is an extension package meant to create, modify and parse JSON strings within the HDevelop language.

The JSON Extension Package provides additional operators to read and write JSON files.

The JSON string representation is a powerful and concise representation of structured data within a single string. As the HDevelop scripting language is missing advanced structuring data types these scripts often contain way too many variables and too many single parameters have to be pushed into procedure calls. For example, the settings could be set with this JSON representation, either in a separate settings.json file or directly set-up within the HDevelop script:

                        {
                            "camera": {
                                "brightness": 2,
                                "colorspace": "rgb",
                                "device": "Camera1",
                                "name": "DirectShow"
                            },
                            "filter": {
                                "mean": 7.5
                            }
                        }
                        

Later, you can retrieve a certain value e.g. with a JSON pointer anywhere in your program:

                            json_pointer_tuple (JsonSettings, '/camera/name', CameraName)
                        

Now, only a single JSON string has to be passed to procedures instead of the single parameters CameraBrightness, CameraColorspace, CameraDevice, CameraName.

Please have a look at the HDevelop examples accompanying this extension package, too.

This extension package is based on the "JSON for Modern C++" library by Niels Lohmann, available at https://github.com/nlohmann/json.

Currently, this Extension Package is available for HALCON 11.0, HALCON 12.0, and HALCON 13.0 and for Windows operating systems only.

Please contact json-extpack@heindl-solutions.com for assistance, purchasing, or bug reports.

Further information about the JSON Extension Package is available online at http://www.heindl-solutions.com/extpack/json.

JSON data structure

Release Notes

JSON Extension Package for HALCON 1.0.0 (released 2018-02-12)

  • initial public release
 
 

Documentation

JSON Extension Package for HALCON 1.0.0 Installer

  • Supports HALCON 11, 12, and 13 and will support upcoming HALCON Steady Editions.
  • Runs on Windows 7, 8, 8.1, and 10
  • Runs on Linux
  • Localized: English and German
Download…