My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Tutorial  
This is a basic tutorial on how to use OpenCVDotNet
Updated Feb 4, 2010 by elad.ben...@gmail.com

Hello, OpenCVDotNet

We'll create a simple C# project that uses OpenCVDotNet to perform a simple image-wise operation on a video (AVI) file (show only the red color channel instead of all three color channels).

You will first need to Install OpenCVDotNet (and all needed components).

Creating the Project

  • Start Visual C# Express.
  • Create a new Windows Application project (File -> New Project, Windows Application).
  • Add references to the compiled DLL of OpenCVDotNet (if you used the installer to intsall OpenCVDotNet, the DLL should be under C:\Program Files\OpenCVDotNet) (Project -> Add Reference, Browse, find DLL).

CVImage.ToBitmap()

OpenCVDotNet's CVImage object has a wondrous method called ToBitmap(). This method turns an OpenCV image into a .NET Bitmap object, which can be used whenever a Bitmap object is accepted.

A common use of this method is to place a PictureBox on your form, and assign the resulting Bitmap into the Image of the PictureBox. This way, a CV image can be displayed on a Windows Form.

  • Add a PictureBox component to the form using the Forms Designer (double click on the PictureBox item in the Toolbox.
  • Dock the picture box to your form (set the Dock property of the picture box to "Full").

CVCapture

CVCapture can be used to capture images from a video - it can either be constructed to capture images from a Web Cam, or from an AVI file.

We will use a CVCapture and a .NET Timer object to play a video stream.

The Timer object will tick every 40 milliseconds (25 times per second), and in every tick, we will capture the next frame of the video, analyze it and display it into the picture box.

  • Add a Timer object to the form using the Forms Designer (double click on the Timer item from the Toolbox).
  • Configure the new timer object to tick every 40 milliseconds (set the Interval property to 40).
  • Enable the timer (set the Enabled property of the timer to True).
  • Add an event handler for the Timer.Tick event (double click on the Tick event of the Timer's event list).
  • Add a handler for the Load event of your main form (double click on the Load event of the form event list).
  • Press F7 to switch to code view of the form.
  • At the beginning of the file, add a using statement to include the OpenCVDotNet namespace.
  • Add a private member variable to contain the CVCapture object.

Your file should look like this:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using OpenCVDotNet;

namespace HelloOpenCVDotNet
{
    public partial class Form1 : Form
    {
        private CVCapture capture;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        private void timer1_Tick(object sender, EventArgs e)
        {

        }
    }
}

Opening the Video File

Type in the following code under Form1_Load handler (under <path to AVI file>, put a path to the AVI file that you wish to display).

private void Form1_Load(object sender, EventArgs e)
{
    capture = new CVCapture("<path to AVI file>");
}

QueryFrame

Use the CVCapture.QueryFrame() method to receive the next frame every tick, convert it to a Bitmap and assign it as the Picture Box's image.

private void timer1_Tick(object sender, EventArgs e)
{
    using (CVImage nextFrame = capture.QueryFrame())
    {
        pictureBox1.Image = nextFrame.ToBitmap();
    }            
}

Note that we use the using statement here, to make sure the CVImage object is disposed at the end of the method. Without 'using', we would have to explicitly call nextFrame.Release() at the end of the method.

Congrats! You can run your application and check it out. It should show the video you referenced in the picture box, and it should be playing!

Split and Merge

Now, we will do some changes to the image before it's displayed. We'll flip the color channels of the image, so that we will use the red channel instead of the green channel, the blue channel instead of the red and the green channel instead of the blue.

To do that, we will use the Split and Merge methods of CVImage. The Split method returns an array of 3 CVImage objects, corresponding to the blue, green and red channels (in that order). The Merge takes an array of three CVImage objects and merges them into the three channels (BGR order as well).

using (CVImage nextFrame = capture.QueryFrame())
{
    using (CVImage emptyImage = new CVImage(nextFrame.Width, nextFrame.Height, CVDepth.Depth8U, 1))
    {
        // set entire image to "0".
        emptyImage.Zero();

        // split the image into three channels
        CVImage[] bgrChannels = nextFrame.Split();
        nextFrame.Merge(new CVImage[] { emptyImage, emptyImage, bgrChannels[2] });
        pictureBox1.Image = nextFrame.ToBitmap();

        // release channel images.
        foreach (CVImage ch in bgrChannels)
            ch.Release();
    }
}            

Notes:

  • After the QueryFrame, we create a new CVImage object named emptyImage that is in the same size of the original image, but with only one channel.
  • Then, we call Zero() to initialize the image to 0.
  • Then, we use Split to split the image to its 3 channels and Merge to merge the channels back, taking only the 3rd component (red) and using emptyImage for the blue and green.
  • Note that we must release the images received from Split().

Comment by sleepysh...@live.cn, Mar 2, 2008

I think that you didn't consider of the end of the avi playing.It will lead to "System.NullReferenceException?".To avoid this ,we could easily add these codes: if (nextFrame != null) { capture = new CVCapture("<path to AVI file>");} else { capture = new CVCapture("g:\\1.AVI");//reload} But,many avi files couldn't be opened: unsettled “OpenCVDotNet.CVException” type of exceptional occured in OpenCVDotNet.dll Unable to open file 'g:\1.AVI' for capture

Why?

Comment by simone.l...@gmail.com, Apr 23, 2008

can you show the use of CVCapture function to show a webcam output??

Comment by fri...@gmail.com, May 2, 2008

@simone.laurenzano: doing "capture = new CVCapture();" in the load method will tend to get any attached camera. "capture = new CVCapture(0);" gets the zeroth webcam and so forth.

Comment by char...@gmail.com, May 26, 2008

Can you show how to capture images using a web cam in C? If somebody can I will be so much thankful to him/her.

Comment by sleepysh...@live.cn, May 30, 2008

@friism: How could I get the 2nd camera ? I use "capture = new CVCapture(1);" or other number but I can't get anything .

Comment by hryspa0...@gmail.com, Jun 2, 2008

to charkac, here is some code from vc++. you have to use some lib. of openCV.

…… 
CvCapture *  capture = 0; //for saving the captured video 
IplImage * frame = 0; // for getting a frame from video 
capture = cvCaptureFromCam(0);//record video from cam 
frame = cvRetrieveGrame(capture);//get a frame from the captured video 
……
Comment by steven.p...@gmail.com, Jun 27, 2008

i get the following when trying to run in VS 2005 studio with C#. it compiles fine, but i get the following at run time

System.IO.FileNotFoundException? was unhandled

Message="The specified module could not be found. (Exception from HRESULT: 0x8007007E)" Source="Examples" StackTrace?:
at OpenCVDotNet.Examples.Program.Main() at System.AppDomain?.nExecuteAssembly(Assembly assembly, String args) at System.AppDomain?.ExecuteAssembly?(String assemblyFile, Evidence assemblySecurity, String args) at Microsoft.VisualStudio?.HostingProcess?.HostProc?.RunUsersAssembly?() at System.Threading.ThreadHelper?.ThreadStart_Context?(Object state) at System.Threading.ExecutionContext?.Run(ExecutionContext? executionContext, ContextCallback? callback, Object state) at System.Threading.ThreadHelper?.ThreadStart?()

Comment by daniel.G...@gmail.com, Aug 16, 2008

This does not seem to work for me. I am getting a Bad Image Header error from cvCloneImage function. Does anyone know what the problem could be?

Comment by jeanlucf...@gmail.com, Sep 2, 2008

hello

when I try the project I got this error message: FileNotFoundException? Exception from HRESULT: 0x8007007E

I think it is a opencvdotnet registration or something. can you help. regards

Comment by ZoltanHa...@gmail.com, Sep 25, 2008

Hello all,

so I try to fix a problem with error signature and I make it, I download another opencvdotnet dll libraries and program working very well.

>>>> But I want to use tracking for webcam not only for movie file. Please help me somebody.<<<<<<

Bizzzar

If somebody want please write down your email adress and I send to you.

Comment by anoopsame@gmail.com, Dec 6, 2008

When i try to run the sample code that i got from the googles tutorial page ... here is the code

using System; using System.Collections.Generic; using System.ComponentModel?; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using OpenCVDotNet.UI; using OpenCVDotNet.Algorithms; using OpenCVDotNet;

namespace WindowsFormsApplication1? {

public partial class Form1 : Form {
public CVCapture capture; public Form1() {
InitializeComponent?();
}

private void timer1_Tick(object sender, EventArgs? e) {
try {
using (CVImage nextFrame = capture.QueryFrame?()) {
pictureBox1.Image = nextFrame.ToBitmap?();
}
} catch(Exception k) {
MessageBox?.Show(k.ToString?());
}
}
private void Form1_Load?(object sender, EventArgs? e) {
try {
capture = new CVCapture(@"..\\..\avi.avi");
} catch (System.Exception k) {
MessageBox?.Show(k.ToString?());
}
}
}

I got the error message " Could not load file or Assembly 'OPenCVDotNet, Version=1.0.2615.24735, Culture=neutral, PublicKeyToken?=null' or one of its dependencies . This application has failed to start because the application configuration is incorrect . HRESULT:0x800736B1 See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

Exception Text System.IO.FileLoadException?: Could not load file or assembly 'OpenCVDotNet, Version=1.0.2615.24735, Culture=neutral, PublicKeyToken?=null' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1) File name: 'OpenCVDotNet, Version=1.0.2615.24735, Culture=neutral, PublicKeyToken?=null' ---> System.Runtime.InteropServices?.COMException (0x800736B1): This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)

at WindowsFormsApplication1?.Form1.timer1_Tick(Object sender,
EventArgs? e)
at System.Windows.Forms.Timer.OnTick?(EventArgs? e) at System.Windows.Forms.Timer.TimerNativeWindow?.WndProc?(Message& m) at System.Windows.Forms.NativeWindow?.Callback(IntPtr? hWnd, Int32
msg, IntPtr? wparam, IntPtr? lparam)

Loaded Assemblies mscorlib

Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase?: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

WindowsFormsApplication1?
Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase?:
file:///C:/Documents%20and%20Settings/Anoop%20Krishnan%20G/My%20Documents/Visual%20Studio%202008/Projects/WindowsFormsApplication1/WindowsFormsApplication1/bin/Debug/WindowsFormsApplication1.exe
System.Windows.Forms
Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase?: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System
Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase?: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

System.Drawing
Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase?: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Configuration
Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase?: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Xml
Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase?: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

JIT Debugging To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.

For example:

<configuration>

<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

This is the error message i got when running , the application compiles but run time errors are occuring am using Visual Studio 2008 with OPENCV 1.0 with the OPENCVDOTNET.

Regards

Anoop Krishnan G

Comment by jb8...@gmail.com, Mar 13, 2009

Hi

I've been trying to use OpenCVDotNet for more than two weeks however I keep on getting the same error:

Could not load file or Assembly 'OPenCVDotNet, Version=1.0.2615.24735, Culture=......

I also added <system.windows.forms jitDebugging="true" /> to the c# config file but this did not solve the problem.

I think that the problem is related to the location of the DLLs. I added a referance to the OpenCVDotNet.dll in folder "C:\Program Files\OpenCVDotNet". Should I do something else?

I need to use OpenCV as part of my thesis project where i would need to use the face detection part. Your help would be greatly appreciated.

Thanks in advance

James

Comment by vgame...@gmail.com, Mar 23, 2009

Hi I've been trying to use OpenCVDotNet but I've got this : 'System.IO.FileNotFoundException?' when I want to load the path of the .avi what can I do ?

Thanks

Comment by barne...@gmail.com, Apr 12, 2009

I'm getting this error, anyone have any ideas?

System.BadImageFormatException? was unhandled

Message="Could not load file or assembly 'OpenCVDotNet, Version=1.0.3103.29996, Culture=neutral, PublicKeyToken?=null' or one of its dependencies. An attempt was made to load a program with an incorrect format." Source="webcamTest-uno" FileName?="OpenCVDotNet, Version=1.0.3103.29996, Culture=neutral, PublicKeyToken?=null" FusionLog?="=== Pre-bind state information ===\r\nLOG: User = OptimusV\\Thomas Anderson\r\nLOG: DisplayName? = OpenCVDotNet, Version=1.0.3103.29996, Culture=neutral, PublicKeyToken?=null\n (Fully-specified)\r\nLOG: Appbase = file:///R:/My Documents/Visual Studio 2005/Projects/webcamTest-uno/webcamTest-uno/bin/Debug/\r\nLOG: Initial PrivatePath? = NULL\r\nCalling assembly : webcamTest-uno, Version=1.0.0.0, Culture=neutral, PublicKeyToken?=null.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: No application configuration file found.\r\nLOG: Using machine configuration file from C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\config\\machine.config.\r\nLOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).\r\nLOG: Attempting download of new URL file:///R:/My Documents/Visual Studio 2005/Projects/webcamTest-uno/webcamTest-uno/bin/Debug/OpenCVDotNet.DLL.\r\nERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.\r\n" StackTrace?:
at webcamTest_uno.Form1.timer1_Tick(Object sender, EventArgs? e) at System.Windows.Forms.Timer.OnTick?(EventArgs? e) at System.Windows.Forms.Timer.TimerNativeWindow?.WndProc?(Message& m) at System.Windows.Forms.NativeWindow?.DebuggableCallback?(IntPtr? hWnd, Int32 msg, IntPtr? wparam, IntPtr? lparam) at System.Windows.Forms.UnsafeNativeMethods?.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager?.System.Windows.Forms.UnsafeNativeMethods?.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext?.RunMessageLoopInner?(Int32 reason, ApplicationContext? context) at System.Windows.Forms.Application.ThreadContext?.RunMessageLoop?(Int32 reason, ApplicationContext? context) at webcamTest_uno.Program.Main() in R:\My Documents\Visual Studio 2005\Projects\webcamTest-uno\webcamTest-uno\Program.cs:line 17 at System.AppDomain?.nExecuteAssembly(Assembly assembly, String args) at Microsoft.VisualStudio?.HostingProcess?.HostProc?.RunUsersAssembly?() at System.Threading.ExecutionContext?.Run(ExecutionContext? executionContext, ContextCallback? callback, Object state) at System.Threading.ThreadHelper?.ThreadStart?()

thx

Comment by ngohoang...@gmail.com, Jun 2, 2009

Why the program or debug it when running normal but when you click button to load the avi file do not see anything even load This is code:

using System; using System.Collections.Generic; using System.ComponentModel?; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using OpenCVDotNet; using OpenCVDotNet.UI; using OpenCVDotNet.Algorithms;

namespace WindowsApplication1? {

public partial class Form1 : Form {
private CVCapture capture; //private CVImage image = null; public Form1() {
InitializeComponent?();
} private void Form1_Load?(object sender, EventArgs? e) {
try {
capture = new CVCapture(@"E:\phuongv.AVI");
} catch(Exception k) {
MessageBox?.Show(k.ToString?());
}
} private void button1_Click(object sender, EventArgs? e) {

timer1.Enabled = true;
} private void timer1_Tick(object sender, EventArgs? e) {
try {
using (CVImage nextFrame = capture.QueryFrame?()) {
pictureBox1.Image = nextFrame.ToBitmap?();
}
} catch(Exception k) {
MessageBox?.Show(k.ToString?());
}
}
private void Form1_Load?_1(object sender, EventArgs? e) {
}
}

}

Comment by APMai...@gmail.com, Jun 30, 2009

I have the same issue and am wondering if it is related to the fact that I am running a 64 bit OS and I suspect the OpenCVDotNet is a 32 bit one. I am looking at the project settings to force it to compile a 32 bit solution etc.

Comment by consuelo...@gmail.com, Oct 3, 2009

I have this error: L'assembly référencé 'OpenCVDotNet' n'a pas un nom fort Do you have an idea please????

Comment by lynndah...@yahoo.com, Nov 23, 2009

Anyone know which one is better OpenCVDotNet / Aforge / Emgu CV for writing C# code for Opencv. Any pointers will be appreciated! Anyone also know how to do thresholding in OpenCV dot net? thanks!

Comment by Barbaria...@gmail.com, Jan 31, 2010

INSTALL C++ 2005 EXPRESS FOR "The specified module could not be found. (Exception from HRESULT: 0x8007007E)" ERROR 2008 || 2010 does not help with the problem.

Emrah YILMAZ emrah@emrahyilmaz.com http://www.emrahyilmaz.com

Comment by sfi.leho...@gmail.com, Mar 10, 2010

I'm have more than one webcam, can I get an array of Webcam's name (or ID) and pass this to a combobox ?!

Comment by em0tionl...@gmail.com, Jul 4, 2010

i got same problem wif 'System.IO.FileNotFoundException??' What's the main point of this problem? coz of using VS 2008? which ways can solve it out?

Comment by elhadyle...@gmail.com, Jul 5, 2010

when i debug my application it wrote this error message


Could not load file or assembly 'OpenCVDotNet, Version=1.0.2615.24735, Culture=neutral, PublicKeyToken?=null' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
inside Application.Run(new Form1());

help me pleaze!

Comment by Sylom...@gmail.com, Jul 13, 2010

Hi, am quite new to opencv and currently working on a university project. using opencvDotNet, if i passed an image of a face via a webcam, can you detect and track the movemenet of the eyes?

please advise sylomope@gmail.com

Comment by sidhu.na...@gmail.com, Jan 4, 2011

hai i am sidharth,i am going to do project ,my project is as per the facial expression the os wall paper will change as per the situation.. any one can tell how get and process the image from webcam and detcting mouth and co ordinates,i am going to use c#.net and open cv

facial expression means if u are in happy the wall paper will change as happy joyful wallpaper...

please help me iam in confusion....

Comment by elcoc...@gmail.com, Feb 10, 2011

Theres a problem with the input and output in cvcapture, i keep getting the same error as everyone else, it just says "A first chance exception of type 'System.IO.FileLoadException?' occurred in System.Windows.Forms.dll" has anyone found a way to fix this?

Comment by ilpongi...@gmail.com, Apr 5, 2011

The 'System.IO.FileLoadException?' is caused by the OpenCvDotNet?.dll library that was compiled in Debug Mode and references the 'Microsoft.VC80.DebugCRT' non-redist library. The solution is to find 'msvcm80d.dll', 'msvcp80d.dll' and 'msvcr80d.dll' and copy these files into the same folder of your compiled application. Remember that is always bad practise release software compiled in Debug mode!

Comment by sheraz.a...@gmail.com, Apr 6, 2011

Hi, I want to use GMM in c#. I have installed opencv and opencvsharp

Can any body please guide me how to use GMM ?

Comment by Boby4...@gmail.com, Jun 14, 2011

Hi, if someone is still reading this thread,I also get the Could not load file or assembly 'OpenCVDotNet, Version=1.0.2615.24735, Culture=neutral, PublicKeyToken?=null' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1) exception at Application.Run() methode. I am using Visual Studio 2008.Does anyone know if this problem can be solvet for VS2008 or VS 2010?

Comment by julien.g...@ahpc-services.com, Jul 10, 2011

Hi,

You are porobably trying to load from a 64bits Windows version. If you do so, you have to set the target platform to x86 in your .NET project, and the problem will be solved.

Comment by ccetprab...@gmail.com, Sep 27, 2011

System.IO.FileLoadException? was unhandled

Message=Could not load file or assembly 'OpenCVDotNet.dll' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1) Source=OpenCV_1 FileName?=OpenCVDotNet.dll FusionLog?="" StackTrace?:
at OpenCV_1.Form1.Form1_Load?(Object sender, EventArgs? e) at System.Windows.Forms.Form.OnLoad?(EventArgs? e) at System.Windows.Forms.Form.OnCreateControl?() at System.Windows.Forms.Control.CreateControl?(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl?() at System.Windows.Forms.Control.WmShowWindow?(Message& m) at System.Windows.Forms.Control.WndProc?(Message& m) at System.Windows.Forms.ScrollableControl?.WndProc?(Message& m) at System.Windows.Forms.Form.WmShowWindow?(Message& m) at System.Windows.Forms.Form.WndProc?(Message& m) at System.Windows.Forms.Control.ControlNativeWindow?.OnMessage?(Message& m) at System.Windows.Forms.Control.ControlNativeWindow?.WndProc?(Message& m) at System.Windows.Forms.NativeWindow?.DebuggableCallback?(IntPtr? hWnd, Int32 msg, IntPtr? wparam, IntPtr? lparam) at System.Windows.Forms.SafeNativeMethods?.ShowWindow?(HandleRef? hWnd, Int32 nCmdShow) at System.Windows.Forms.Control.SetVisibleCore?(Boolean value) at System.Windows.Forms.Form.SetVisibleCore?(Boolean value) at System.Windows.Forms.Control.set_Visible(Boolean value) at System.Windows.Forms.Application.ThreadContext?.RunMessageLoopInner?(Int32 reason, ApplicationContext? context) at System.Windows.Forms.Application.ThreadContext?.RunMessageLoop?(Int32 reason, ApplicationContext? context) at System.Windows.Forms.Application.Run(Form mainForm) at OpenCV_1.Program.Main() in g:\documents and settings\developer\my documents\visual studio 2010\Projects\OpenCV_1\OpenCV_1\Program.cs:line 18 at System.AppDomain?.nExecuteAssembly(RuntimeAssembly? assembly, String args) at System.AppDomain?.ExecuteAssembly?(String assemblyFile, Evidence assemblySecurity, String args) at Microsoft.VisualStudio?.HostingProcess?.HostProc?.RunUsersAssembly?() at System.Threading.ThreadHelper?.ThreadStart_Context?(Object state) at System.Threading.ExecutionContext?.Run(ExecutionContext? executionContext, ContextCallback? callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext?.Run(ExecutionContext? executionContext, ContextCallback? callback, Object state) at System.Threading.ThreadHelper?.ThreadStart?()
InnerException?:

while i am doing my first example i am getting this error can any one help me pls.....?

advance thanks......!

Comment by rodril...@gmail.com, Feb 3, 2012

The solution for the error "System.IO.FileLoadException?" is because the OpenCVDotNet require the c++ libraries OpenCV in the same folder, so go to the directoty "C:\Program Files\OpenCV\bin" and copy this files in the "..\bin\Debug or Release\" folder: - cv100.dll - cxcore100.dll - highgui100.dll - libguide40.dll

But after do this, i got a next error, "unable to open file 'C:\\temp\video.avi'" in the Form1_Load? method. I need some help. Thanks


Sign in to add a comment
Powered by Google Project Hosting