Machine Vision

Showing results for 
Search instead for 
Did you mean: 
Reply

Using OpenCV library in LabVIEW

Using OpenCV library in LabVIEW

Hello all!

I'd like to know how can I use some code I wrote in C/C++, using the OpenCV libraries, in LabVIEW.

Do I have to create a .DLL and load it in LabVIEW? If so, how does LabVIEW handles the different data types, pointers, etc.?

The script nodes (which I'm not very familiar with) of LabVIEW run C code?

Any help would be greatly appreciated.

Thanks in advance!

0 Kudos
Message 1 of 41 (41,173 Views)
Reply
0 Kudos

Re: Using OpenCV library in LabVIEW

Hi, Goju-Ryu,
 
Its not extremely complicated. All what you needed is to calling OpenCV functions. Theoretically you can call these functions directly from LabVIEW, but then you should figure out how to transfer structures from call to call. I prefer usually to create DLL wrapper, which will be called from LabVIEW, and inside of the wrapper you have to place OpenCV calls.
 
For example how to use Convolution (5x5 fixed kernel - gradient) from OpenCV:
We need to call cvFilter2D in this case.
I will create following code:
In the code above we will send to DLL the pointers of the Src/Dst, LineWidth of each image and Width/Height.
This DLL will be called from LabVIEW like this:
 
In the attachment you can found complete source code of the example.
 
Best regards,
Andrey
 
Message 2 of 41 (41,159 Views)

Re: Using OpenCV library in LabVIEW

Excelent answer Andrey, thank you very much.

I haven't tested it yet... Just one clarification, the code you wrote should then be created in a .dll, that will then be called in LabVIEW, right?

Thanks in advance.

Best regards!

0 Kudos
Message 3 of 41 (41,148 Views)
Reply
0 Kudos

Re: Using OpenCV library in LabVIEW

Exactly. This is call by following chain: LabVIEW>Convolution Test.DLL.dll>CV100.dll (cvFilter2D)
 
Andrey.
 
0 Kudos
Message 4 of 41 (41,146 Views)
Reply
0 Kudos

Subject: Re: Using OpenCV library in LabVIEW

Dear Sir,
 
I tested Convolution tester.
In then, I find error message as follows In the attachment
 
Please check
 
Sincerely yours,
 
Bongchan Park
 
0 Kudos
Message 5 of 41 (40,294 Views)
Reply
0 Kudos

Re: Subject: Re: Using OpenCV library in LabVIEW

Hi, Bongchan,
Just downloaded and checked it. It works without problem.
But you should have OpenCV library already installed, otherwise you can't use it. Provided DLL is the only wrapper to OpenCV.
best regards,
Andrey.
 
Message 6 of 41 (40,280 Views)

제목: Re: Subject: Re: Using OpenCV library in LabVIEW

Dear Andrey

Thank you for your response.

Best regards,

Bongchan Park

 

 

0 Kudos
Message 7 of 41 (40,234 Views)
Reply
0 Kudos

Re: Using OpenCV library in LabVIEW

Bump,

Hey everyone, could somebody be as kind as to save this example in a LabView 8.2 Version?

Would be much appreciated!
George
0 Kudos
Message 8 of 41 (40,090 Views)
Reply
0 Kudos

Re: Using OpenCV library in LabVIEW

Hello
 
Do you have any examples of using Open CV with regular LV to detect a face in a picture?
 
Thanks
Tim C.
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 9 of 41 (39,994 Views)
Reply
0 Kudos

제목: Re: Using OpenCV library in LabVIEW

Hi Andrey

It is good(ConvolutionTester).

By the Way, How use it in color image?

Best regards,

Bongchan Park

 

0 Kudos
Message 10 of 41 (39,568 Views)
Reply
0 Kudos