|
the open source for machine vision and data visualization |
| |
Introduction to Execution Graph Framework (ExGraF)by Eduard Baranovsky Execution graph, in terms of this frame work, is a network of processing tasks, connected together with data links. The order of task execution depends on data propagation throw the graph. When some task in the graph, have all its inputs available, execution is performed. One of advantages of this paradigm is that the same execution graph could achieve optimal CPU utilization for different input data load. In the case of static order of processing, it could lead to waist of time, waiting for data, ready at some input. ExGraF framework is a collection of components (classes, interfaces and graphical widgets), which could be easily combined together and integrated with other components to form compleet application.
Different paradigms in software developmentDifferent kinds of problem in real world, requires different software approaches for their solution. If you are building extensive GUI application, you may use Object Oriented paradigm for your design, create many classes with complex hierarchy, and connect them together to obtain desired system behavior. For automation control system, you may use State Machine paradigm, define each module as a state machine and define transition from one state to another. For calculation problems, such as signal and image processing Generic Programming is more suitable, you are defining your data structures, and set of functions, to process them. Execution Graph (or Data Flow) is also a kind of paradigm, distinguished from those mentioned above, that could be useful for certain kinds of problem. For example it could work good in calculation and automation control systems development.
How it works The main part of ExGraF is a workspace where user can create graph for his application. To demonstrate how it works, we'll create a graph that reads color image and display it on the screen. First we select color image reader object
Then put image display object and connect it to the reader.
Provide reader task with name of the image to read. Click left mouse button on reader task and put path to image file.
Now our graph is ready so we can run it. Press "run" button.
Now we can add some other stuff, split color image to red, green and blue components and show them as separate images.
Useful development toolsExGraF comes with logger and scope tools integrated to the framefork. A logger displays debug messages coming from ExGraF tasks.
A scope display timing of every task executed in the graph and very useful in the application performance tuning.
ExGraF architectureExGraF framework consists from several basic classes:
Using TCL for creating ExGraF graphs
The most intuitive and simplest way for creating execution graph, is using of graphical interface. But in real application, graph topology could depend on application parameters. For example if you have some video/imaging application and number of tasks depends on number of cameras, it is convenient to write script that create desired graph topology, taking to account number of cameras parameter.
TCL script languish is very useful in such configuration task, and can be easily embedded to C++ code. EgTclConfigurator is C++ class which responsible for graph creation from TCL script.
# create common comparison task (with 3 inputs)
createTask PTask3ImageCompare image_compare
# create 3 camera grabbers and connect sobel operator to each task
for { set cam 0} { $cam <3 } { incr cam} {
createTask PTaskCameraGrabber grabber_$cam
createTask PTaskSobel sob_$cam
connectTasks out grabber_$cam in sob_$cam
connectTasks out sob_$cam in_$cam image_compare
}
Comments: |