ni.com checkout is currently experiencing issues.
Support teams are actively working on the resolution.
ni.com checkout is currently experiencing issues.
Support teams are actively working on the resolution.
10-19-2016 10:27 PM
NI recently released a set of VIs to easily integrate LabVIEW and Vision Development Module with OpenCV. You can download them at this link:
http://sine.ni.com/nips/cds/view/p/lang/en/nid/213723
They contain examples to easily get started.
03-11-2017 03:09 AM
Hi everyone, have anybody tried to use the examples from the above link? I am going step by step through the manual, however, when I launch example programs the following error occurs: The procedure entry point could not be located ?default_num_threads@task_scheduler_init@tbb@@SAHXZ in library C:\Windows\System32\NIVisOCV\opencv_imgproc300.dll.
I have no idea how to solve this problem.
01-02-2018 06:05 AM
Philippe_RSA wrote:
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).
There is! According to the official documentation for Emgu CV (Working with images -> Accessing the pixels from Mat) there are three ways to obtain pixels data from Mat object. Sadly methods 1 and 2 don't work in LabVIEW - I can't find mat.ToImage in Invoke Node parameters and can't construct a Matrix object to copy into (still no support for Generic types?). But the last method with pinned memory does work!
//load your 3 channel bgr image here Mat m1 = ...; //3 channel bgr image data, if it is single channel, the size should be m1.Width * m1.Height byte[] data = new byte[m1.Width * m1.Height * 3]; GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned); using (Mat m2 = new Mat(m1.Size, DepthType.Cv8U, 3, handle.AddrOfPinnedObject(), m1.Width * 3)) CvInvoke.BitwiseNot(m1, m2); handle.Free();
I translated this code into LV. Here's a simple example, which shows how to load a RGB image from the file, apply some bilateral filtering (just for fun) and read back the image from Mat object into common IMAQ image.
The BD is kinda lengthy but you may wrap it into a SubVI if you want. I should note also that bitwise NOT is required here to restore colors back to normal.
Tested this with the recent version of Emgu - libemgucv-windesktop-3.3.0.2824.exe.
01-02-2018 10:59 AM
I have just realized that I did a little mistake when connecting rows' and columns' wires to Reshape Array and double For Loop (I was working with a square image). To get it working with any width / height you need to connect the wires like this:
Sorry for that.
01-04-2018 01:08 AM - edited 01-04-2018 01:08 AM
Are you facing issues in 32bit or 64bit?
Could you please check if you have NIVisOCVTBB folder under System32 or SysWOW64 folders?
Thanks,
Antony
01-04-2018 08:26 AM
@invancea wrote:
Are you facing issues in 32bit or 64bit?
Could you please check if you have NIVisOCVTBB folder under System32 or SysWOW64 folders?
Thanks,
Antony
If your message was meant for me, then no - I have not come across any issues when playing with Emgu CV or OpenCV in LabVIEW. I didn't try in 32-bit LabVIEW though, x64 only.
In SysWOW64 I don't see such folder, but in System32 I see NIVisOCVTBB symlink, which redirects to C:\Program Files (x86)\National Instruments\NIVision OpenCV Utilities\tbb\x64\bin. Another two there - NIVisOCV (C:\Program Files (x86)\National Instruments\NIVision OpenCV Utilities\opencv\x64\vc110\bin) and NIVisOCVSample (C:\Program Files (x86)\National Instruments\NIVision OpenCV Utilities\nivisionextlib\samples\x64\vc110\bin). Yes, I have NIVision OpenCV Utilities installed. But as I know Emgu doesn't need this or any additional packages. It works "out of box".
05-13-2020 12:58 AM
Thanks fot ur nice work. Yet, still i have a question: the version of opencv& EMGU have to be the same?
05-21-2020 01:47 AM
the key point now is to convert a 2D int array into a mat, which is the image format in emgucv can be processed in emgucv. I got one idea, that is using the method CvArrToMat in emgucv,see picture
,
but the input arr is a intptr, which can not be wired with a 2D int array. Anyone can give some advice?
05-21-2020 03:47 AM
Hi, the method ByteListToArray is from EMGUCV? Which constructor?