Quick Start
This Quick Start Tutorial will help you with your first steps regarding installation, where to find files, running examples and creation your first project. This Quick Start applies for always the latest of my wrappers. For earlier tutorials please look at Archive.
Installation
Download the latest release rar archive from the Dowload Page. Extract the rar file to a place of your choice. You will find two main folders called "bin" and "samples". Within the bin folder there are 3 subfolders. "Debug", "Release", "Images". The Debug and Release folders contain the wrapper libs (cvlib(d).dll, cvlibcs(d).dll), the opencv native lib's, some sample executables and some testimages used by the samples. Try to run some of the samples from the debug and release folder's gives you a first indication that your machine is configured to use the samples/libs.
The sample folder contains some samples usable with Visual Studio 2010 (Express). If you use the Express Version of VS Studio, debugging inside native code is not possible.
The "Images" folder you got after Installation contains some Images used by Calibration sample. But this sample is only a simple "C#" copy of the c++ sample from opencv sources. I suggest to compare the sources gives you a glimpse of how the wrapper is used.
Create your own project
Create a command line project with VS 2010. Run the empty project in Debug / Release mode creates the bin/Debug and bin/Release foldes within the project structure. Copy the wrapper lib's: Debug: cvlibd.dll, cvlibcsd.dll, cvlibd.pdb, cvlibcsd.pdb to the Debug folder and cvlib.dll, cvlibcs.dll to Release folder. Next copy the opencv dll's and pdb-files to Debug/Release folder.
Go to your project and select Debug mode. Find the reference entry in project explorer and add a reference to cvlibcsd.dll (Right mouse button->Add Reference-> search tab-> navigate to "bin/Debug" folder from the project).
Copy the Hello world sample below and run the application. Evering should work fine (hopefully).
For release mode, you need to change the link in references in project explorer to the release wrapper dll (cvlibcs.dll) before build.
For infos about coding topics, please read the "usage.txt" file included in the latest download or get here.
The "Hello World" Program
using System;
using System.Text;
namespace test
{
class Program
{
static void Main( string[] args )
{
IplImage img = cvlib.cvLoadImage("myimg.png", cvlib.CV_LOAD_IMAGE_COLOR);
cvlib.cvNamedWindow("Hello World", 0);
cvlib.cvShowImage("Hello World", img);
cvlib.cvWaitKey(0);
cvlib.cvReleaseImage(img);
}
}
}