Install and configure emgu cv2.4.2 on 64-bit Windows 7

Source: Internet
Author: User

1. From http://sourceforge.net/projects/emgucv? Source = directory download the latest emgu
Cv2.4.2;

2. Copy the libemgucv-windows-x86-gpu-2.4.2.1777 to the d: \ soft \ emgu2.4.2folder, run the .exe file, install it to the D: \ soft \ emgu2.4.2 \ emgucv-windows-x86-gpu2.4.2.1777 folder, the installation will automatically restart;

3. d: \ soft \ emgu2.4.2 \ emgucv-windows-x86-gpu2.4.2.1777 \ bin; D: \ soft \ emgu2.4.2 \ emgucv-windows-x86-gpu2.4.2.1777 \ bin \ x86 (the x86 folder contains the corresponding dynamic library opencv2.4.2, after this directory is added to the environment variable, emgu does not need to install the corresponding opencv.) add it to the path of the system environment variable and restart;

4. Open vs2008 and create a new windows form-based application;

5. Import the UI plug-in: tool --> choose toolbox items -->. net
Framework components --> Click Browse and select emgu under D: \ soft \ emgu2.4.2 \ emgucv-windows-x86-gpu2.4.2.1777 \ bin. CV. UI. when the DLL is opened, histogrambox, imagebox, matrixbox, and panandzoompicturebox are added to the list;

6. add reference: Select references under project --> Add reference --> browse select emgu under D: \ soft \ emgu2.4.2 \ emgucv-windows-x86-gpu2.4.2.1777 \ bin. CV. DLL, emgu. CV. ML. DLL,
Emgu. cv. UI. dll, emgu. util. dll, and zedgraph. dll dynamic libraries. Click OK;

7. Click solution platforms --> Configuration Manager: Active solution
Platform changes the original any CPU to x86. Otherwise, the error "emgu. cv. cvinvoke type Initial Value Setting item causes an exception" is displayed.

An online code example is compiled and run successfully:

Usingsystem;

Usingsystem. Collections. Generic;

Usingsystem. componentmodel;

Usingsystem. Data;

Usingsystem. drawing;

Usingsystem. LINQ;

Usingsystem. text;

Usingsystem. Windows. forms;

Usingemgu. CV; // emgu

Usingemgu. cv. structure;

Usingemgu. util;

Usingsystem. Threading;

Namespacetestemgu

{


Public partial
Class form1:
Form


{

Public
Form1 ()

{

Initializecomponent ();

}

Privatecapturecapture;

Privateboolcaptureinprocess; // you can call this operation to determine the camera status.

Privatevoidbutton#click (objectsender,
Eventargse)

{

If (capture! = NULL)

{

If (captureinprocess)

{

Application. Idle-= new
Eventhandler (processframe );

Button1.text = "Stop! ";

}

Else

{

Application. Idle + = new
Eventhandler (processframe );

Button1.text = "start! ";

}

Captureinprocess =! Captureinprocess;

}

Else // if the camera is empty, it is called using the capture () method.

{

Try

{

Capture =
Newcapture ();

}

Catch (nullreferenceexceptionexcpt)

{

MessageBox. Show (excpt. Message );

}

}

}

Privatevoidprocessframe (objectsender,
Eventargsarg)

{

Image <BGR, byte>
Frame = capture. queryframe ();

Imagebox1.image = frame;

}


}

}

References:

1.
Http://www.emgu.com/wiki/

2.
Http://blog.163.com/woshitony111@126/blog/static/71379539201282511180304/

3.
Http://blog.csdn.net/gaaranaruto/article/details/6328358

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.