Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Can Labwindows/CVI work with Opencv?

OpenCV is a good and free lib for computer vision developer. I know it's an option to use it through Measurement Studio and Visual studio. But, can we use it in the CVI environment directly?  
Message 1 of 10
(7,854 Views)
I haven't used OpenCV yet, but you can take from here that it supports ANSI C. Should be no problem to use it with CVI.
Regards, Guenter
0 Kudos
Message 2 of 10
(7,841 Views)

Hello,

 

I also tried to use OpenCV with Labwindows CVI. But I get errors with präproc.  in cxtypes.h although only includfing "cv.h"

Did someone manage to use OpenCV already ?

Would be nice to hear.

 

0 Kudos
Message 3 of 10
(7,745 Views)
Hello Juergen.

I have had a look at the cxtypes.h that comes with OpenCV.
Lots of Borland and Microsoft specifics in it. It really doesn't look like prepared for use with CVI.
Regards, Guenter
0 Kudos
Message 4 of 10
(7,722 Views)

Hello Guenter,

thanks for your reply.

I already managed it. OpenCV is working. Just had to go around Borland and MSC defines.

In cxtypes.h:                          #define CV_INLINE static   // Modified to work for, here 

and two errors for typedefs:  "long long" i.e. "long int"

Just bind in cv.h, cxcore.lib and cv.lib

Then one just has to supply all appropriate dll within exe path.

 

 

0 Kudos
Message 5 of 10
(7,714 Views)

Hello Guenter,

thanks for your reply.

I already managed it. OpenCV is working. Just had to go around Borland and MSC defines.

In cxtypes.h:                           #define CV_INLINE static   // Modified to work for, here 

and two errors for typedefs:  "long long" i.e. "long int"

Just bind in cv.h, cxcore.lib and cv.lib

Then one just has to supply all appropriate dll within exe path.

 

 

0 Kudos
Message 6 of 10
(7,714 Views)

Hello Guenter,

thanks for your reply.

I already managed it. OpenCV is working. Just had to go around Borland and MSC defines.

In cxtypes.h:                           #define CV_INLINE static   // Modified to work for, here 

and two errors for typedefs:   "long long" i.e. "long int"

Just bind in cv.h, cxcore.lib and cv.lib

Then one just has to supply all appropriate dll within exe path.

 

 

Message 7 of 10
(7,713 Views)
Hi, Juergen, could you please talk about it a little bit more? I am very happy to be able to know that the openCV can work with the CVI.
0 Kudos
Message 8 of 10
(7,390 Views)

OpenCV does work with LabWindows. If you successfully "installed" the latest openCV, which is at the time of my post version 2.4.3, the header file "core_c.h" along with corresponding lib and dll files must be added to you project tree in order to use openCV functions. "core_c.h" includes "types_c.h" which for some reason LabWindows/CVI doesn't really like. The problem starts on line 137:

 

#ifndef CV_INLINE
#  if defined __cplusplus
#    define CV_INLINE inline
#  elif (defined WIN32 || defined _WIN32 || defined WINCE) && !defined __GNUC__
#    define CV_INLINE __inline
#  else
#    define CV_INLINE static
#  endif
#endif /* CV_INLINE */

 

The only option CVI likes is the last one (CV_INLINE static), so simply modify this segment so that it's the only choice and compile!

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

This how I have it BTW...

 

#ifndef CV_INLINE
#  define CV_INLINE static
#endif /* CV_INLINE */
0 Kudos
Message 10 of 10
(5,729 Views)