Applying an algorithm to a sequence of images
This igraph illustrates the powerful flow-control operators WiT provides.
An algorithm is applied to a sequence of images.
- dir performs a directory scan of all files matching the
regular expression "sa.*" The output is a vector (array) of
strings, each corresponding to a file name.
- sequencer loops through the string vector and sends
each element out sequentially.
- For each filename, the following operators are performed on
the data:
- rdObj reads the image in from the file.
- zoomSize reduces the image size to 64x64.
- display displays the reduced image.
- stats makes statistical measurements.
- collector collects the standard deviation of the
pixel values in the image.
- The bottom input of collector is a flag input which is
fed by the lower output of sequencer. This flag is used to
tell the collector when to stop collecting, at which time
all the inputs to collector are packed into a new vector
and sent to graph for plotting.
Notice particularly the inputs going to rdObj and
display. These "inputs" are normally parameters which are
edited at design time. But WiT allows any parameter to be
converted to an input which can be fed dynamically as an igraph
executes.
Also illustrated in this example is the ability of WiT to display
data objects other than images: the
displays the vector of floating-point numbers which are the standard
deviation values of each image, and graph displays the same
data in a graph plot.