Questions tagged [emgucv]

EmguCV is a cross-platform .NET wrapper to the OpenCV image processing library. Allowing OpenCV functions to be called from .NET compatible languages such as C#, VB, C++-CLI, IronPython etc. The wrapper can be compiled in Mono and run on Linux or Mac OS X.

About EmguCV

EmguCV opens the OpenCV (Open Source Computer Vision Library) library of programming functions mainly aimed at real time computer vision to .NET developers. OpenCV was originally developed by Intel and now supported by Willow Garage.

Current versions for x86 , x64 and ARM(only for iOS and Android) architectures are available for download at their SourceForge website, https://sourceforge.net/projects/emgucv/.

A download and installation guide is available here. This is particularly useful for newcomers as ensuring the correct references are used and that the associated OpenCV .dll files are copied to the output directory can be difficult.

EmguCV uses a dual-license business model for its software development library and offers licenses for two distinct purposes: open source, and commercial development. More information can be found here.

Cross Platform

Unlike other wrappers such as OpenCVDotNet, SharperCV or Code Project which use unsafe code, EmguCV is written entirely in C#. The benefit is that it can be compiled in Mono and therefore is able to run on any platform Mono supports, including Linux, Solaris and Mac OS X. A lot of efforts have been spent creating a pure C# implementation since the headers have to be ported, compared with managed C++ implementation where header files can simply be included. But it is well worth it if you see EmguCV running on Fedora 10! Plus it always gives you the comfort knowing that your code is cross-platform.

EmguCV can be used from several different languages, including C#, VB.NET, C++-CLI and IronPython. On this wiki, we provide examples for all those languages, which are available from the Examples section on Tutorial page. Our discussion forum is also available if you have any questions related to your favorite programming language.

Other Advantages

  • Image class with Generic Color and Depth
  • Automatic garbage collection
  • XML Serializable Image
  • XML Documentation and intellisense support
  • The choice to either use the Image class or direct invoke functions from OpenCV
  • Generic operations on image pixels

Architecture Overview

EmguCV has two layers of wrapper as shown below

  • The basic layer (layer 1) contains function, structure and enumeration mappings which directly reflect those in OpenCV.
  • The second layer (layer 2) contains classes that mix in advantages from the .NET world.

EmguCVArchitecture.png

2204 questions
5
votes
1 answer

Calculating distance using a single camera

I would like to calculate distance to certain objects in the scene, I know that I can only calculate relative distance when using a single camera but I know the coordinates of some objects in the scene so in theory it should be possible to calculate…
Hamza Yerlikaya
  • 49,047
  • 44
  • 147
  • 241
5
votes
2 answers

C# New bitmap() - Out of memory

I'm newbie at DotNet programming. I got a serious problem for me but I don't know why. I already used Dispose() method but "Out of memory" problem still occurs. At about first 30 times, everything works perfectly. Then, Out of memory happens.…
Tin Chip
  • 135
  • 9
5
votes
1 answer

EmguCV - Mat.Data array is always null after image loading

When I am trying to read image from file, then after load Mat.Data array is alway null. But when I am looking into Mat object during debug there is byte array in which are all data from image. Mat image1 = CvInvoke.Imread("minion.bmp",…
eridanix
  • 818
  • 1
  • 8
  • 27
5
votes
3 answers

How to implement Optical Flow tracker?

I'm using the OpenCV wrapper - Emgu CV, and I'm trying to implement a motion tracker using Optical Flow, but I can't figure out a way to combine the horizontal and vertical information retrieved from the OF algorithm: flowx = new Image
João Cardoso
  • 351
  • 3
  • 5
  • 13
5
votes
1 answer

Focus-stacking using OpenCV / Emgu CV

I have a C# (Emgu CV) application where I capture mutliple images of the same scene at varying focal lengths. Now I want to create a multifocus image simular like described in this article…
Simon
  • 51
  • 1
  • 4
5
votes
1 answer

Navigate through hierarchy of contours found by FindContours method?

This must be simple for C++ developers using OpenCV directly. However what I'm using is Emgu (an OpenCV wrapper for .NET) and in the latest version we have the method CvInvoke.FindContours returning void, the output result is passed by parameter…
Hopeless
  • 4,397
  • 5
  • 37
  • 64
5
votes
0 answers

Emgucv C# Image Stabilization

I have two successive images which I want to stabilize using EmguCv in C#. I found much information on how to perform image stabilization, however I could not find any detailed explanation on how to use Emgu to stabilize two successive frames…
Spyros
  • 261
  • 2
  • 14
5
votes
1 answer

Follow ridges with OpenCV - return array of 'ridges'

I'm looking for a method which finds the ridges (local maxima) in an image and returns them as an array of ridges ( where a ridge is a vector of points defining the ridge). That is, a method which behaves exactly like findContours (which finds…
mchristos
  • 1,487
  • 1
  • 9
  • 24
5
votes
3 answers

Emgu CV 3 findContours and hierarchy parameter of type Vec4i equivalent?

I'm attempting to translate the following OpenCV C++ code into Emgu CV 3: std::vector > contours; std::vector v4iHierarchy; cv::findContours(imgThreshCopy, contours, v4iHierarchy, cv::RETR_TREE,…
cdahms
  • 3,402
  • 10
  • 49
  • 75
5
votes
2 answers

How to attach third-part libraries in release version

I have a program on .NET 4 for Windows. I'm trying to port it for Mac computers with mono and Xamarin studio. I have third-part library EmguCV (it's a wrapper for OpenCV library). I'm using official manual to install it. It installs both OpenCV and…
Artem Kulikov
  • 2,250
  • 19
  • 32
5
votes
3 answers

Convert a byte[] into an Emgu/OpenCV Image

I have a byte array representing a greyscale image that I would like to use with openCV in C#, using the Emgu wrapper. I am trying to figure out how to convert this into an Emu.CV.Image without first converting it to a System.Drawing.Bitmap. So far,…
QRohlf
  • 2,795
  • 3
  • 24
  • 27
5
votes
5 answers

How can I compare two still images using emgu cv in c#

Have searched on Stackoverflow.com and google. But didn't found any proper method to do so apart from the link shown below. compare two images and extract the difference using emgu cv library Please suggest or give helpful feedback so that i can…
Prakash Vishwakarma
  • 814
  • 2
  • 9
  • 25
5
votes
4 answers

EMGU QueryFrame returns "streaky" Image over RTSP

I have a HD network camera that I am trying to grab frames over rtsp and using the following code: //in Form_Load Application.Idle += getNextFrame; And the Event Handler: private void getNextFrame(object sender, EventArgs ags) { //where…
Tom
  • 136
  • 1
  • 9
5
votes
2 answers

C# - Emgu cv How to load an image from a folder using CvInvoke.cvLoadImage("ClassPic1.jpg") as intptr and access it

How to load an image from a specific folder using Emgu cv CvInvoke.cvLoadImage(...)?I am tryng to do it like this IntPtr inputImage = CvInvoke.cvLoadImage("C:\\Users\\...\\ClassPic1.jpg"); Is that ok? If so, How am i gonna access it later as an…
Sisay
  • 681
  • 7
  • 16
  • 31
5
votes
2 answers

How to Convert Emgu.Cv.Image to System.Image

I was new to Emgu Cv and i was wondering if someone could let me know how i change Emgu.Cv.Image to System.Image?If there is a need for further explanation, let me know and i will do it.The language i am using is C#.
Sisay
  • 681
  • 7
  • 16
  • 31