Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Using OpenCV library in LabVIEW

he memebr

is the performace or time of excution of code open cv code in open cv enviroment(visual studio) will be same as in labview??

hi ?Q>

Message 21 of 49
(7,640 Views)

hello,I come up with some troubles,Cannot open include file: 'cvidef.h': No such file or directory ,what‘s wrong with it,looking upward to your reply,thinks。

0 Kudos
Message 22 of 49
(7,564 Views)

@YANYUNMENG wrote:

hello,I come up with some troubles,Cannot open include file: 'cvidef.h': No such file or directory ,what‘s wrong 


The given example was created in NI CVI. If you using other compiler such as MSVC - then you will need to correct headers a little bit. Just remove cvidef.h.

 

Andrey.

Message 23 of 49
(7,561 Views)

hello,andrey!think you for your reply ,I have do with what you had said,but there come up with another mistake, Cannot open include file: 'utility.h': No such file or directory,if i remove'utility.h"agian,then mistake is error C2146: syntax error : missing ')' before identifier 'hinstDLL',what 's wrong?

0 Kudos
Message 24 of 49
(7,560 Views)

hi ,Andrey ,unresolved external symbol _InitCVIRTE,What should I do,The hope obtains your reply, thanks!

0 Kudos
Message 25 of 49
(7,533 Views)

Hello,

 

here are some examples on using OpenCV in Labview in case anyone is interested:

 

https://decibel.ni.com/content/blogs/kl3m3n

 

There is also some source code, dll's and Labview example code. Some of the examples are face and eye detection, human detection, SURF, etc...

 

The images are passed as data pointers, so they are first converted from Labview image reference to 2D array. Some would say that it is better to pass the image pointer directly, but the conversion to 2D array works for me (the average time for 10000 conversions from IMAQ reference to 2D array (U8 datatype) and back to IMAQ reference is ~1.5 ms for image resolution of 1600x1200 pix) .

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 26 of 49
(7,497 Views)

hello,

  I am sorry to reply so slowly ,I now solve the problem, but also thank you for your help, these examples topic is very helpful to me, hope to communicate later.

                                                                                                                                                                                               

 

0 Kudos
Message 27 of 49
(7,472 Views)

I have finally managed to get OpenCV working in LabView.... with all credit to Reyn Vlietstra.

I previously used wrappers from various people, some on this forum.... all great, but always only a subset of the OpenCV library (e.g. no SolvePnP, InRange and many other functions)

A few steps to using opencv, without wrappers, and full functionality (to version 3, with Cuda) is listed below:

 

1) download the opencv with .net :  I used the version on        http://sourceforge.net/projects/emgucv/files/emgucv/3.0.0/libemgucv-windows-universal-3.0.0.2157.exe

I used this one, but there are 3 other variants also.... make your pick

2) I then had to make use of a tiny app made by Reyn Vlietstra such that the .mat can be used as a pointer to data (there must be a more direct way in LabView.... anyone?) this is called SCM.LabView.Utils.dll (attached).

place this in the same directory as opencv above (bin)

3) I then used .net to access all the required functions.

an example is attached.... note all the links to the dll (in the .....\emgucv-windows-universal 3.0.0.2157\bin directory) will need to be refreshed for your specific inatallationn path.

I am not a .net expert, but in 10 minutes managed to create a frame grabber, display the image, and perform a Canny edge detection, and display this also.

 

example ported to LabView 8.... so it should be quite generic.

 

Good luck.

Download All
Message 28 of 49
(5,892 Views)

Good job, Philippe_RSA. I have finished your example and it seems good! But now my question is:how can we transfer 2d array to emgu image? just like IMAQ ArrayToImage.

http://forums.ni.com/t5/LabVIEW/LabVIEW-Datatypes-to-NET-reference/m-p/2551719 maybe give me some help. But still now I cannot get a good solution. Anybody gets good advice?

thanks!

0 Kudos
Message 29 of 49
(5,803 Views)

I have tried using LabView for this.... but hit a brick wall.

Possibly I need to make another dll to do this.... quite a shame, since I see many requests for this funcionality in LabVIEW.

 

0 Kudos
Message 30 of 49
(5,794 Views)