The difference and connection between EMGUCV learning and OpenCV

Source: Internet
Author: User

OpenCV is an open source visual library, which contains almost all of the classic image processing algorithms, and C and a small number of written C + +, the operation is very efficient, for image processing in this aspect of work, understanding OPENCV is a must work. But OpenCV has a big disadvantage, which is that it provides little GUI interface, it is difficult to meet the needs of the current application development, and the evil MFC framework ugly interface has become my Nightmare, MFC and OpenCV and interface optimization almost let me in the image processing this can not move.

C # is the star language on the. NET platform, making it easy to make beautiful interfaces. EMGUCV is a. Net library that is OPENCV encapsulated can be called by vc++,vc#,vb.net. The introduction of EMGUCV on the internet is very rare, not because it is useless, but because it uses almost the same way as OPENCV, OPENCV information can be directly used for EMGUCV. However, many novices use EMGUCV to give up after several uses. Here are a few reasons:

1. The influence of public opinion, many people say that C # is inefficient, using C/C++,OPENCV is written in C and C + +, it should be run in VC + +, image processing is a very large amount of work, C # not. C # operation Efficiency is certainly worse than C + +, but the use of hybrid programming method can be, with C # Framework and operating mechanism, calculation to C is good. EMGUCV many of the processing functions are managed calls with OPENCV. This can be seen in the EMGUCV installation package, which contains all the OPENCV DLLs.

2. Lack of information, learning frustration and give up (I give up this for about half a year). I have to admit that there are too few learning materials in EMGUCV. Many times there is a problem and there is basically no answer on the Internet. and EMGUCV earlier version of the OPENCV package is not comprehensive, many basic functions are not encapsulated, use is inconvenient, many people on the web baseless assertion, writing is very difficult. However, using version 2.3 does not have this problem, OPENCV basic functions have been well encapsulated. OPENCV image processing functions are encapsulated in the Cvinvoke

And the image<> structure is an important bridge connecting OpenCV and EMGUCV. Where C # 's IntPtr type can well pass the iplimage* pointer structure, I use an experiment to verify my judgment.

  1. Create a WinForm project, add a button and a PictureBox control

  2. Add the following code

    Capture Cam;

    private void Btopen_click (object sender, EventArgs e)

    {

    Cam = new Capture ();

    Application.idle + = new EventHandler (processframe);

    }

    private void Processframe (object sender, EventArgs arg)

    {

    IMAGE<BGR, byte> frame = cam. Queryframe ();

    Image<gray,byte> Ecanny=frame. Convert<gray,byte> ();

    Cvinvoke.cvcanny (Ecanny.ptr, Ecanny.ptr, 50, 150, 3);

    Cvcanny is a commonly used function in OpenCV, the original parameter should be iplimage* type, where INTPR is used instead of ecanny.ptr

    pictureBox1.Image = Ecanny.bitmap;

    }

  3. The operation results are as follows

  4. Of course, if it's just a simple canny algorithm, it's simpler to use the EMGUCV encapsulated structure image<> to modify the code as shown

  5. The result of the operation is as shown

    The above experiments show that EMGUCV can be well connected to C # and OPENCV, and can compensate for the shortcomings of OpenCV in GUI, which is beneficial to the work of machine vision developers.

The difference and connection between EMGUCV learning and OpenCV

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.