Changes between Version 1 and Version 2 of UnifiedCameraAccess


Ignore:
Timestamp:
Feb 23, 2011, 4:34:24 PM (14 years ago)
Author:
Matthias Vogelgesang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UnifiedCameraAccess

    v1 v2  
    11= Unified Camera Access =
     2
     3`libuca` is a thin wrapper to make the different cameras (via !CameraLink or PCIe) accessible in an easy way.
    24
    35== Specification ==
     
    1820== Code ==
    1921
     22Followingly, we will build libpco (the hardware-dependent pco.edge "driver") and libuca. First of all, get the sources
     23{{{
     24#!sh
     25cd some-empty-dir
     26bzr clone bzr+ssh://user@ufo.kit.edu/vogelgesang/pco-diag libpco
     27bzr clone bzr+ssh://user@ufo.kit.edu/vogelgesang/uca libuca
     28}}}
     29
     30Make sure, that you have installed the Silicon Software [http://www.silicon-software.de/download.html Runtime Environment]. Then build and install libpco using
     31{{{
     32#!sh
     33mkdir build && cd build
     34cmake ../libpco
     35make && sudo make install
     36}}}
     37If everything went okay, you can try the `diagnose` program in the build directory. It tries to open the camera and frame grabber, prints out some information and stores one frame as `out.raw`.
     38
     39Finally, you can build libuca
     40{{{
     41#!sh
     42rm -rf *
     43cmake ../libuca
     44make
     45}}}
     46
     47== Using libuca ==
     48
     49The following test program is supplied with `libuca` and demonstrates the general functionality of the library:
     50
     51{{{
     52#!c
     53#include <stdio.h>
     54#include "uca.h"
     55
     56int main(int argc, char *argv[])
     57{
     58    struct uca_t *uca = uca_init();
     59    if (uca == NULL) {
     60        printf("Couldn't find a camera\n");
     61        return 1;
     62    }
     63
     64    uint32_t width = 800, height = 600;
     65    uca->cam_set_property(uca, UCA_PROP_WIDTH, &width);
     66    uca->cam_set_property(uca, UCA_PROP_HEIGHT, &height);
     67
     68    char camera_name[256] = "foobar";
     69    uca->cam_get_property(uca, UCA_PROP_NAME, camera_name);
     70
     71    printf("Camera name: %s\n", camera_name);
     72
     73    uca_destroy(uca);
     74    return 0;
     75}
     76}}}