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 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)
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 Extension Package for HALCON 1.0.0 Installer