Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Want to use OpenCV function in LabVIEW

Hi All,

I am currenty working on labview 2013 with VDM 2013. I have written a small test code using OpenCV 2.4.8 in Python 2.7. How do I convert this into a dll to call in LabVIEW?

Any suggestions to assist me? 

 

Thank You.

Regards

Aveo 

0 Kudos
Message 1 of 9
(10,692 Views)

Do you have Vision Development Module, the Vision Library for LabVIEW? Are you asking how you can interface a LabVIEW Vision Image to OpenCV?

The typical way to do that is to use LabVIEW's Call Library Node, that allows to call DLLs from LabVIEW. You can use it to directly call functions in the OpenCV dll.

If you want to interface a Vision Image with OpenCV, you may need to write a wrapper DLL.

 

Do you want to do that because the Vision Development Module is missing some functions that are in OpenCV?

0 Kudos
Message 2 of 9
(10,673 Views)

Hi ChristopheC,

I have Vision Development Module 2013. The VDM has the fuctions that I need for my application. However the IMAQ RGBToColor 2.vi is taking taking a high execution time to convert a RGB image to CIE Lab. 

This function is available in OpenCV and it takes much lesser time to execute it. I was thinking to create a dll that would call this OpenCV function in LabVIEW.  Is there any tutorial for it? I am using OpenCV for the first time and dont know how to make a dll that can be called in LabVIEW. 

Also I have one more query- If i am able to make this dll to use OpenCV functions in LabVIEW, will I be able to use the same dll in a RT also? 

Thank You.

Regards

Aveo

0 Kudos
Message 3 of 9
(10,667 Views)

Hello,

 

maybe this will help you:

 

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

 

There are a couple of examples on how to create a .dll from c++ source code using OpenCV. There are also some examples on how to call such a .dll in Labview.

I don't use Python though, but VS.

 

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."
0 Kudos
Message 4 of 9
(10,658 Views)

Hi Klemen,

thanks for the reply. I will go through your blog posts. I have one more question- can the opencv dll used in labview be used in RT also?

Regards,

Aveo 

0 Kudos
Message 5 of 9
(10,653 Views)

Hi Klemen,

I went through the blog. I cannot find any info on how to build a dll that can be used in labview.

Can u please help?

Regards

Aveo

 

0 Kudos
Message 6 of 9
(10,651 Views)

Hello,

 

roughly 1/3 of the posts talk about calling .dll in Labview using the OpenCV libraries. Which ones did you check?

 

To build a .dll using cmake and Visual Studio, follow the instructions here:

 

https://decibel.ni.com/content/blogs/kl3m3n/2014/04/22/create-a-visual-studio-project-from-source-fi...

 

Other posts include source code, the .dll and the Labview examples. For example:

 

https://decibel.ni.com/content/blogs/kl3m3n/2014/05/08/detect-hough-circles-in-labview-using-opencv

https://decibel.ni.com/content/blogs/kl3m3n/2014/07/09/labview-vs-opencv-template-matching

https://decibel.ni.com/content/blogs/kl3m3n/2014/11/01/kalman-filter-opencv-and-meanshift-labview-tr...

https://decibel.ni.com/content/blogs/kl3m3n/2013/08/25/human-detection-in-labview-using-histogram-of...

https://decibel.ni.com/content/blogs/kl3m3n/2013/08/14/real-time-surf-tracking-in-labview-with-openc...

https://decibel.ni.com/content/blogs/kl3m3n/2013/07/30/color-histogram-matching-and-grabcut-segmenta...

 

etc...

 

Hope this helps.

 

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."
0 Kudos
Message 7 of 9
(10,633 Views)

Hi Klemen,

 I was confused with PCL in that post. So thought would ask you directly.  

Apologies for the inconvenience. I am going to start now.

Will keep you updated and if possible make screenshots of it and share. 

Regards

Aveo

0 Kudos
Message 8 of 9
(10,623 Views)

Hello aveo,

 

I found out that its not worthwhile to implement these functions on your own. There are some toolkits to help you out, some companies also offer to expand their function palette to fit your needs: http://ms-consultants.de/index.php/software/msc-image-processing/37-msc-image-processing-eng

 

 

0 Kudos
Message 9 of 9
(9,293 Views)