Context

Context is an application variable that passes through each active module during image processing.

In Code module, it is possible to develop custom solutions for your project using Python and context data.

The user can add or modify custom attributes

Do not to change their structure when modifying.

Context Data in PEKAT VISION Projects

A series of context data examples displayed in PEKAT VISION projects (JSON Format), is available at our Inspection module article, as shown on example below:

 

Context Data Glossary

image [Numpy Array]

Image in numpy array.

detectedRectangles [Array]

A field containing the detected objects.

The last detected objects have the attribute ‘detectedAsLast=True’

result [Boolean]

Evaluation of the image - ‘True’ if image is ok, ‘False’ for defective image.

exit [Boolean]

Early termination, for details read the article Code.

It is not returned in response to an HTTP request, nor does it appear in the inspection.

heatmaps [Array of Numpy Array]

A field containing numpy arrays that represent heatmaps.

items

Internal argument.

Appears during processing, but does not respond to the HTTP request, nor does it appear in the inspection.

production_mode [Boolean]

If an image received through the HTTP API is processed, the parameter becomes True, otherwise False.

operatorInput [Dictionary]

If there are any active inputs/selects/sliders in the Operator View, the values they had during the processing of the image will be displayed in this dictionary. More info in Operator View article.

completeTime [Float]

Processing time of the image in seconds.