Spring 2010 - CS477/577 - An Introduction to Computer Vision

C/C++ support

Most assignments require capability that you do not want to implement yourself. Thus you have to link against libraries. I will provide my version of tools that you can use to do the assignments, but you can use other libraries if you prefer (but you are on your own regarding making it work and providing a compilable program that works on the graphics machines). The TA and I will provide some support for these as they are used for research and are in continual developent. Note that these libraries are currently unix (including MacOS) only. If you want to minimize your use of unix, then perhaps best to use Matlab.


Compiling and Linking with an Example Program

The include files and version of the library various machines are available on the UA CS network. A tar ball that can be compiled from scratch, and/or SVN access can be provided if there is sufficent genuine interest. However, these libraries need other libraries such as lapack for complete functionality.

To get you started, there is an example program showing the use of a few functions here . There are hopefully enough comments in the code to get you started. The file

cc_linux_x86_64_c2 (C) or cxx_linux_x86_64_c2 (C++)

deal with the complexities of including and linking for the graphics machines. You can source one of these files to build to program on those machines. The files matrix.txt and image.tiff can be used as example data for the program.

Compile lines for various other machines (C):
      cc_linux_386_p4     (e.g. basic 32 bit intel as provided for most CS grad student office machines. Test on cy01)
      cc_linux_x86_64_xeon (e.g. lectura)    
      cc_linux_x64_opteron     (e.g. vision lab machine, v01, v02, v03)

Compile lines for various other machines (C++):
      cxx_linux_386_p4     (e.g. basic 32 bit intel as provided for most CS grad student office machines. Test on cy01)
      cxx_linux_x86_64_xeon (e.g. lectura)    
      cxx_linux_x64_opteron     (e.g. vision lab machine, v01, v02, v03)


Resources

Manpages (MANPATH is: ~kobus/doc/man (on most CS machines, but not lectura))

Also available in html at:     http://kobus.ca/research/resources/doc/kjb/KJB.html

Start with a "man kjb" or the above link. Note that the first part of the document is a bit overwhelming, as it is geared towards writing substantive vision copmponents shared with the group and/or, writing code for the library itself. This document essentially gives you a template for the "INCLUDE AND LOAD" strategy described by "man kjb".

A key point is that "man kjb" gives a machine generated list of all routines which have at least minimal documentation. (Perhaps 1/2 of the routines of interest are documented.)

Note that there are man pages for the main data types. In particular, you can do:

        man Vector
        man Matrix
        man KJB_image
        man Pixel
(Either click on the link or use the "man" command.)

Other documentation

There are some documentation files which attempt to explain some of the less conventional things about the library in the following directory:
        ~kobus/doc/programming
I wrote it a few years back--hopefully it is not too out of date.


Specific routines for assignment two

For assignment one you might want to look at the man pages for:

    read_matrix
    get_random_matrix
    multiply_matrices
    max_matrix_element
    ow_multiply_matrix_by_scalar
    ow_subtract_scalar_from_matrix
    ow_add_matrices
    
    plot_open
    plot_matrix_cols

    get_MP_inverse  

    constrained_least_squares    (grad students only)
(Either click on the link or use the "man" command.)

You will also want to use something like prompt_to_continue() so you (and the TA) can actually look at your plots. (This is used in the example program linked above).


Specific routines for assignment three

For assignment three you might want to look at the man pages for:

    multiply_by_transpose
    multiply_with_transpose
    diagonalize_symmetric
    KJB_image   (case sensitive; there is also a kjb_image(1))
    Pixel
    kjb_read_image
    kjb_write_image 
(Either click on the link or use the "man" command.)


Specific routines for assignment four

For assignment four you might want to look at the man pages for:

    least_squares     (OK now that you know how to do it).
    plot_open3
    plot_matrix_values
(Either click on the link or use the "man" command.)


Specific routines for assignment five

For assignment five you might want to look at the man pages for:

    kjb_read_image
    kjb_write_image
    kjb_display_image

    ow_make_black_and_white_image
    bw_image_to_matrix
    matrix_to_bw_image

    get_1D_gaussian_mask
    get_2D_gaussian_mask

    x_convolve_matrix
    y_convolve_matrix
    convolve_matrix
(Either click on the link or use the "man" command.)