|
Algorithm specification
The algorithms are stored and loaded from special XML files containing all information necessary to
display and run the algorithm. The knowledge of the intrinsics of this format might come in handy,
when the GUI cannot be used. Please note that Xai can run an algorithm without X, provided that the
algorithm specification contains valid values for all required parameters of the blocks and none
of the blocks itself requires X.
An example of algorithm:
This algorithm is encoded in the following XML:
<?xml version="1.0"?>
<XaiModel id="1">
<XaiBlocks>
<XaiBlock id="2" path="/OpenCV/GUI_and_Acquisition/IPLCaptureCamera" name="IPLCaptureCamera" x="26" y="239">
<description>OpenCV IPL Image Loader...</description>
<parameter type="int" name="camera_nr" value="0"/>
<parameter type="int" name="width" value="640"/>
<parameter type="int" name="height" value="480"/>
</XaiBlock>
<XaiBlock id="3" path="/OpenCV/Image_Processing_and_Analysis/IPLConvertColormap" name="IPLConvertColormap" x="149" y="240">
<description>OpenCV IPL Colormap Converter...</description>
<parameter type="enum" name="colormap_code" value="CV_BGR2GRAY"/>
<parameter type="int" name="output_channels" value="1"/>
</XaiBlock>
<XaiBlock id="4" path="/OpenCV/Experimental/IPLLoadHaarClassifierCascade" name="IPLLoadHaarClassifierCascade" x="42" y="101">
<description>See OpenCV documentation for function cvLoadHaarClassifierCascade</description>
<parameter type="string" name="haar_definition" value="/usr/local/share/opencv/haarcascades/haarcascade_frontalface_alt.xml"/>
</XaiBlock>
<XaiBlock id="5" path="/OpenCV/Experimental/IPLHaarDetectObjects" name="Haar Detect Objects" x="268" y="140">
<description>Detects faces using Haar Classifiers.</description>
<parameter type="float" name="scale_factor" value="1.1"/>
<parameter type="int" name="min_neighbors" value="3"/>
<parameter type="int" name="minimum_window_width" value="0"/>
<parameter type="int" name="minimum_window_height" value="0"/>
</XaiBlock>
<XaiBlock id="6" path="/OpenCV/Basic_Operations/IPLMax" name="IPLMax" x="528" y="228">
<description>See cvMax from Intel OpenCV Library Reference.</description>
</XaiBlock>
<XaiBlock id="7" path="/OpenCV/Other/IPLDrawRectangles" name="IPLDrawRectangles" x="404" y="138">
<description>Draws rectangles on an image of given size.</description>
<parameter type="int" name="width" value="640"/>
<parameter type="int" name="height" value="480"/>
</XaiBlock>
<XaiBlock id="8" path="/OpenCV/Other/IPLToBW256" name="IPLToBW256" x="650" y="228">
<description>OpenCV IPL Sobel Filter...</description>
</XaiBlock>
<XaiBlock id="9" path="/Simple/Output/BW256Display" name="BW 256 display block" x="771" y="228">
<description>Very minimalistic block...</description>
<parameter type="string" name="window_name" value="Untitled"/>
<parameter type="string" name="display_name" value=":0.0"/>
</XaiBlock>
</XaiBlocks>
<XaiConnections>
<XaiConnection>
<from block="2" output="0"/>
<to block="3" input="0"/>
</XaiConnection>
<XaiConnection>
<from block="4" output="0"/>
<to block="5" input="0"/>
</XaiConnection>
<XaiConnection>
<from block="3" output="0"/>
<to block="5" input="1"/>
</XaiConnection>
<XaiConnection>
<from block="5" output="0"/>
<to block="7" input="0"/>
</XaiConnection>
<XaiConnection>
<from block="7" output="0"/>
<to block="6" input="0"/>
</XaiConnection>
<XaiConnection>
<from block="3" output="0"/>
<to block="6" input="1"/>
</XaiConnection>
<XaiConnection>
<from block="6" output="0"/>
<to block="8" input="0"/>
</XaiConnection>
<XaiConnection>
<from block="8" output="0"/>
<to block="9" input="0"/>
</XaiConnection>
</XaiConnections>
</XaiModel>
|
|