next up previous contents
Next: Canny Callback Up: programmers_guide Previous: Graph Plotting   Contents

Examples from Edge Tool

To illustrate the design of the user interface modules and their interaction with infrastructure and Tina libraries the remainer of this chapter describes elements of the edge tool used to perform monocular and binocular edge and feature recovery in 2D and 3D. This text assumes that the reader is familiar with the use of this tool (see user guide, Tina memo 2005-002, for details).

A full listing of the edge tool code is given at the end of this chapter. The Edge Geom Tool module has the following form

Note that to encourage good design only the Edge Geom Tool and parameter access functions (of which there is only one) are available externally from the Edge Geom Tool module.

The Edge Geom Tool has the following design

void edge_tool(int x, int y)
{
    static void *tool = NULL;

    if (tool)
    {
         tw_show_tool(tool);
         return;
    }
    tool = tw_tool("Edge Tool", x, y);
     
    tw_menubar("Pick",.....
               .
    tw_choice("Image Select:", update_pcam, NULL);
               .
    tw_button("new pcam",.....
               .
               .
    tw_button("Edge Params", edge_param_dialog, NULL);
               .
    tw_end_tool();
}

If the tool has been called before it is simply reshown otherwise it is created. The Edge Geom Tool has 4 parts: menubars for mouse selection for the various Tv devices associated with it (ie. mono, left, right and threed); choice lists for "mode of operation" selections; buttons to perform edge, stereo, and description operations; buttons to instantiate dialog boxes to manage parameters of the module.

The tool has 2 basic modes of operation, either mono or stereo. Furthermore the method used in polygonal approximation can also be selected.



Subsections
next up previous contents
Next: Canny Callback Up: programmers_guide Previous: Graph Plotting   Contents
root 2017-11-18