OpenCV 安装攻略

经师弟推荐, opencv中文社区有一系列安装攻略. 写的挺详细的. 需要的朋友可以收藏下. http://www.opencv.org.cn/index.php/Template:Install

Tags:

Comments(0)

How to use OpenCV 2.0a in Visual Studio?

OpenCV 2.0 now uses CMake to organize the whole project. By default, it only provides linux library. So we need to compile it first.

Download Cmake for windows and install.

Go to C:\OpenCV2.0, execute the following cmd

 cmake . -G "Visual Studio 9 2008" 

Change "Visual Studio 9 2008" to your default compiler.

Cmake will generate a solution file (containing many projects) for you visual studio. Open it and build with “release”.

Add the following path to Tools–>Options–>Projects–>VC++ Directories–>Include files

C:\OpenCV2.0\include\opencv

Add following path to Tools–>Options–>Projects–>VC++ Directories–>Library files

C:\OpenCV2.0\lib\Release

When create a new project,

add following to “Project–>Properties–>Linker->Input–>Additional dependencies

cv200.lib cxcore200.lib highgui200.lib

Tested on OpenCV 2.0 on Visual Studio 2008

Related Post:

How to configue OpenCV 1.0 in Visual Studio – Reprice

Tags:

* Comments(35)

How to configue OpenCV in Visual Studio – Reprice

It has been quite a while since last time I post a howto of configuring OpenCV in Visual Studio. The post got a lot of attention and comments. As the the configuring has become simpler, the post becomes a bit bulky and out-of-date. So right now I am considering to rewrite the howto with a much simpler version.

  • Open Visual Studio, add following path to
    Tools–>Options–>Projects–>VC++ Directories–>Include files

    C:\Program Files\OpenCV\cv\include
    C:\Program Files\OpenCV\otherlibs\highgui
    C:\Program Files\OpenCV\cxcore\include
    C:\Program Files\OpenCV\otherlibs\cvcam\include
  • Add following path to Tools–>Options–>Projects–>VC++ Directories–>Library files
    C:\Program Files\OpenCV\lib
  • When create a new project,
    add following to “Project–>Properties–>Linker->Input–>Additonal dependencies

    cv.lib highgui.lib cvaux.lib cxcore.lib

    NOTE there is no difference between debug or release configurations

  • Tested on OpenCV 1.0 with Visual Studio 2008

    Links
    Original blogspot link1 link2.
    Li Hao’s post.

    Tags: ,

    * Comments(2)

    Using OpenCV in VC++.Net

    Continuous updating…
    Current testing version: OpenCV 1.0 (I do not recommend the latest 1.1pre1. I got strange error using it in VC.net). VC++.net 2008.

    Set up a project in Visual Studio

  • Choose VC++ -> Windows Forms Application (stand for dotnet framework)
  • Add opencv directory and dependent library from this post.
  • Add include <cv.h> to try out.
  • Compile, you might find an error saying ” cannot compile under /clr:safe or /clr:pure …”
  • Then goto Project setting: Configuration properties -> general -> Common Language Runtime Support -> change to  (/clr)
  • Compile again, it should work.
  • Convert IplImage to VC++.net Bitmap

    System::Drawing::Bitmap ^disp = gcnew System::Drawing::Bitmap(img->width, img->height, img->widthStep, PixelFormat::Format24bppRgb, System::IntPtr::IntPtr( img->imageData) );

    Tags: ,

    Comments(0)

    How to use OpenCV in QT under ubuntu

    Install OpenCV with Synaptic Package Manager
    Add one line in QT project file (*.pro)

    LIBS += -L/usr/local/lib -lcxcore -lcv -lhighgui -lcvaux

    Then, include OpenCV header file in your source code.
    Do whatever you like in your source file.
    Compile.

    Note: This post is incomplete so far and subject to change.

    Tags: , ,

    Comments(0)