Search This Blog

Showing posts with label Embedded. Show all posts
Showing posts with label Embedded. Show all posts

Saturday, 11 August 2012

Experiment with OpenCV

    We have started the process for making our project. You can monitor the process, in our project blog Project Athena. Here is a demonstration, that I have done this evening. This video summarizes, a tutorial written in OpenCV doc. In my previous, I did explained how to compile a OpenCV program.



   The program demonstrated loads and plays a video present in the current directory and provides a slider to position the current frame. Happy Coding !!!

Saturday, 28 July 2012

Get Started: OpenCV development

    Setting up OpenCV development environment in Ubuntu 12.04. In general, if you want to use any of the development libraries or API's, you need to download the development packages. This packages contains headers required, and pre-compiled libraries available for linking from our executable or our custom library. In ubuntu, these packages are suffixed with "-dev".
 for example: libopencv-dev, libcv-dev.
Installing OpenCV:
   Installing opencv development libraries is very simple. I have used Synaptic Package manager to install opencv libraries, and their dependencies.

Here is the screenshot:

   Second one is the source code editor setup. Setting up an source editor requires another separate post. I'll use emacs and will post the instruction soon.

    Then comes the compilation part. Almost all the projects written in C/C++ use GCC/G++ compiler for compilation.

Compilation command syntax is:
  gcc -oOutputFilename SourceFilename.c `pkg-config opencv --cflags --libs`

where, gcc : compiler,
            OutputFilename : the name of the compiled executable or library,
            SourceFilename.c: the name of file containing source code,
            pkg-config: a utility used ease the job for including library headers.
                  pkg-config arguments.
                         opencv: tell the pkg-config utility to provide the paths for
                         libraries related to OpenCV.
                         - -cflags: option to obtain paths to headers.
                         - -libs:     option to obtain paths to libs.

     and note that it's  | ` | and not |  ' | in the compilation command.