O'Reilly logo

Emgu CV Essentials by Shin Shi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hello World in C++

We can only compile our Emgu CV C++ projects on Windows, because Mono, the Linux and OSX .NET platform, cannot compile managed C++ code. We can find a project called Hello World written in C++ at D:\Emgu\emgucv-windows-universal-gpu 2.4.9.1847\Emgu.CV.Example\CPlusPlus.

Here we will generate a C++/CLR example. Create a new C++/CLR empty project and add references and a new Windows form. Add a button on the form and edit the click event.

The most crucial part of the source code is given here:

String ^ winname = "First Cpp Window"; //Create a window with the specific name CvInvoke::cvNamedWindow(winname); //Create an image of 480x200 with color yellow Emgu::CV::Image<Bgr,Byte>^ img1 = gcnew Emgu::CV::Image<Bgr,Byte>(480, 200, Bgr(0, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required