From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-07-2017 01:33 AM
Hi,
we are using NI Vision OpenCV Utilities package to write a wrapper for OpenCV.
Do you have some idea on how to pass the contours generated by the FindContours function back to LabView?
Contours data type is the following:
vector<vector<Point> >
Thanks in advance for your help
04-28-2017 09:30 AM
Hi MarcoMauri,
can you explain better what do you mean?
You are developing a wrapper in labVIEW, but I don't understand your phrase: "Do you have some idea on how to pass the contours generated by the FindContours function back to LabView?"
If you are developing in LabVIEW, why do you need to pass back a value in LabVIEW? You should already have it...
04-28-2017 10:27 AM
Hi!
I was not clear in my first post: we are developing a wrapper for LabView and not with LabView.
It's not easy to call the FindContour function of OpenCv directly in LabView,
so we are developing a wrapper in Visual C compiled as a DLL.
The function FindContour is called in our wrapper and then the result needs to be passed back to LabView.
Since it is not a simple data type but an array of arrays of points, this is quite tricky.
05-02-2017 02:33 AM
Hi MarcoMauri,
as you know, with the "CallLibraryFunction" node you can get only simple data types and pointers. I suggest you to share out the memory location's pointer of your function result. In LabVIEW you can access the data using the MoveBlock function.
Have a look on these links:
http://www.ni.com/example/27242/en/
You will find some explenations and examples!
Good luck!
Stefano Fois
11-26-2021 07:13 AM
I have the same question. Do you find a way to solve the problem?
12-06-2021 02:10 AM
Here attached I've put some sample code, I hope this helps.
You'll need to include some libreries to compile it, for instance:
#include <C:\Program Files (x86)\National Instruments\NIVision OpenCV Utilities\nivisionextlib\include\NIVisionExtLib.h>
#include "C:\Program Files (x86)\National Instruments\NIVision OpenCV Utilities\nivisionextlib\include\lv_prolog.h"
Hope this helps,
Marco
11-29-2022 02:17 AM
Hi Marco,
I am currently trying to tackle exactly the same problem. There are still some undefined types in your code like 'LVArrayOfArray' and 'LV_Array_XYPoint_Int'. Would you mind sharing your .h file?