Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCV wrapper for LabVIEW

Eran,

 

Your software was fine.  It was all the malware that downloaded with your software that was the problem.  This was from the download site, I am sure, not from your software.  No, I cannot tell you what Malware it was, because I had our IT guys get rid of it ASAP.

 

I suggest finding a new download site.  Can you use Sourceforge?

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 11 of 17
(2,295 Views)

Has anyone managed to link LabView to Opencv without a wrapper?

All opencv dll's are very nicely documented, so I think this should be quite possible.

 

The wrappers offered by many users on this forum are great, but they usually have a very limited subset of the opencv instructions (and contain bugs or limitations).

If someone has a brief example of doing this without wrappers on just a few of the opencv instructions, I am sure the remainder of the instructions would be quite easy.

(basically my difficulty is the memory management of the images, as they are not strictly images in opencv, but a form of a handle to the images with a short header)

0 Kudos
Message 12 of 17
(2,091 Views)

You could use the Call Library Function nodes to directly call the OpenCV DLLs. It would be a fair amount of work but you could implement any of the functions that you need. I am not aware of anyone who has done this and made it publicly available but it is possible with enough elbow grease.  

 

Tutorial: Configuring the Call Library Function Node to call a Simple DLL

https://decibel.ni.com/content/docs/DOC-9069

0 Kudos
Message 13 of 17
(2,066 Views)

Hi fblerg

 

Connecting to a dll is easy enough... you just need the function prototype, which is well documented by opencv (awesome piece of work that).

problem for me is that Opencv uses pre-defined types, and memory allocations of unknown size (objects).

For example, an image has a header, and then the data, which sounds easy (as for a bitmap).

However when I copy a ROI (in opencv) of an existing mage, it actually uses the same memory internally, with a different header.

Only when I clone this does it make a copy of the data.

This is super efficient, amazing work.....

In effect, the images are not pointers to data, but a handle to a header, which internally than has a pointer to data (which then has a count allocation to determine if it is still in use, or if it can be cleared by the dll).

 

By using a wrapper, only the functions in the wrapper are shared, so any extension to opencv needs to be written into the wrapper.

This is then no longer open source so to speak.... as the wrappers are not shared (not in the spirit of the licence agreement I must add).

By accessing the dll directly, this disappears (and performance will improve), as most wrappers allocate and deallocate memory for the images less effectively than opencv.

 

Possibly you have an example for defining the objects as used in opencv??    any assistance appreciated.

0 Kudos
Message 14 of 17
(2,052 Views)

Interfacing to OpenCV without a wrapper DLL is very difficult, except in very limited cases. While LabVIEW has a fairly flexible model for interfacing with DLLs, there are lots of limitations when it comes to dealing with complex structures (like a function that returns a pointer to a structur). There are clever hacks for dealing with some of this on the LV diagram, but you are going to be far better off making a wrapper DLL to do what you want. 

0 Kudos
Message 15 of 17
(2,038 Views)

Hi Eran,

 

I'm trying to use the opencv wrapper with one of our applications and facing a problem. I just have a couple of very simple questions

Is the wrapper compatible with LabView 2016 or LabView 2017? 

I installed opencv 2.4.9 from opencv2.4.9 download and set the environmental variable according to the opencv document page here Installation instructions but the LabView wrapper example from your Youtube post OpenCV example throws errors for all the Vi's that I have in the example and some Vi's appear to be missing as shown in the screenshots. Can you advise on if I'm still missing something that is preventing the Vi's to be linking and loading?

 

Thanks,

 

Error.PNG

 

0 Kudos
Message 16 of 17
(1,248 Views)

The wrapper has only a very limited subset of OpenCV.

Try using the real thing....

 

Do a search for : Using OpenCV library in LabVIEW

(uses emgu version of OpenCV, thus .net calls)

 

 

 

0 Kudos
Message 17 of 17
(1,242 Views)