You are here: Start » Getting Started » Introduction to Data Flow Programming

Introduction to Data Flow Programming

Important: Adaptive Vision Studio does not require the user to have any experience in low-level programming. Nevertheless, it is a highly specialized tool for professional engineers and a fully-fledged visual programming language. You will need to understand its four core concepts: Data, Filters, Connections and Macrofilters.


Adaptive Vision Studio is a data processing environment so data is one of its central concepts. The most important fact about data that has to be understood is the distinction between types (e.g. Point2D) and values (e.g. the coordinates (15.7, 4.1)). Types define the protocol and guide the program construction, whereas values appear during program execution and represent information that is processed. Examples of common types of data are: Integer, Rectangle2D, Image.

Adaptive Vision Studio also supports arrays, i.e. variable-sized collections of data items that can be processed together. For each data type there is a corresponding array type. For example, just as 4 is a value of the Integer type, the collection {1, 5, 4} is a value of the IntegerArray type. Nested arrays (arrays of arrays) are also possible.


Filters are the basic data processing elements in data flow programming. In a typical machine vision application there is an image acquisition filter at the beginning followed by a sequence of filters that extract information about regions, contours, geometrical primitives and then produce a final result such as a pass/fail indication.

A filter usually has several inputs and one or more outputs. Each of the ports has a specific type (e.g. Image, Point2D etc.) and only connections between ports with compatible types can be created. Values of unconnected inputs can be set in the Properties window, which also provides graphical editors for convenient defining of geometrical data. When a filter is invoked (executed), its output data can be displayed and analyzed in the Data Preview panels.


Connections transmit data between filters, but they also play an important role in encapsulating much of the complexity typical for low-level programming constructs like loops and conditions. Different types of connections support: basic flow of data , automatic conversions , array (for-each) processing and conditional processing . You do not define the connection types explicitly – they are inferred automatically on the do what I mean basis. For example, if an array of regions is connected to an input accepting only a single region, then an array connection is created and the individual regions are processed in a loop.


Macrofilters provide a means for building bigger real-life projects. They are reusable subprograms with their own inputs and outputs. Once a macrofilter is created, it appears in the Project Explorer window and since then can be used in exactly the same drag and drop way as any regular filter.

Most macrofilters (we call them Steps) are just substitutions of several filters that help to keep the program clean and organized. Some other, however, can create nested data processing loops (Tasks) or direct the program execution into one of several clearly defined conditional paths (Variant Steps). These constructs provide an elegant way to create data flow programs of any complexity.

Data and types are very similar to what you know from C++. We also have a generic collection type – array – which is very similar to std::vector. Filters and macrofilters are just equivalents of functions. But, instead of a single returned value they often have several output parameters. Connections correspond to local variables, which do not have to be named. On the other hand loops and conditions in Adaptive Vision Studio are a bit different to C++ – the former are done with array connections or with Task macrofilters, for the latter there are conditional connections and Variant Step macrofilters. See also: Quick Start Guide for the C/C++ Programmers.

Previous: Application Settings Next: Running and Analysing Programs