Using Matlab with OpenViBE

Come here to discuss about OpenViBE in general!
Post Reply
KedarPs
Posts: 2
Joined: Wed Dec 05, 2012 6:39 pm

Using Matlab with OpenViBE

Post by KedarPs »

Hello Everyone,

I am a new OpenViBE user and interested in using OV with Neurosky's Mindset dry electrode system. First of all let me first commend the efforts taken in making OpenViBE, it is really well made and quite easy to use as well :D . I am interested in using OV with Matlab, however I am having some issues with getting Matlab to work. I am using Windows 7 (64-bit) with 32-bit Matlab R2012b installation.

I am primarily using the tutorial given in http://openvibe.inria.fr/tutorial-using ... -openvibe/ and I was successful in building the Matlab plug-in but I could not get the tutorial to run. Here are the details:

To Build:
I added the following in win32-dependencies.cmd

Code: Select all

SET OV_DEP_MATLAB=c:\Program Files (x86)\MATLAB\R2012b
and in win32-dependencies.cmd

Code: Select all

SET PATH=%OV_DEP_MATLAB%\extern\lib\win32\microsoft;%PATH%
to provide path to libmex.lib, libmx.lib and libeng.lib.

I get the following output in the console after running win32-build.cmd:

Code: Select all

Configuring and building openvibe-plugins\matlab\trunc ...

--   Found OpenViBE...
--     [  OK  ] lib C:/Users/ksp6/Documents/OpenViBE/openvibe/trunc/lib/OpenViBE-dynamic.lib
--   Found OpenViBE-toolkit...
--     [  OK  ] lib C:/Users/ksp6/Documents/OpenViBE/openvibe-toolkit/trunc/lib/OpenViBE-toolkit-dynamic.lib
--   Found OpenViBE module System...
--     [  OK  ] lib C:/Users/ksp6/Documents/OpenViBE/openvibe-modules/system/trunc/lib/OpenViBE-module-System-dynamic.lib
--   Found OpenViBE plugins global defines...
--   Found Matlab [C:/Program Files (x86)/MATLAB/R2012b/bin/matlab.exe]
--      [  OK  ] Third party lib C:/Program Files (x86)/MATLAB/R2012b/extern/lib/win32/microsoft/libmex.lib
--      [  OK  ] Third party lib C:/Program Files (x86)/MATLAB/R2012b/extern/lib/win32/microsoft/libmx.lib
--      [  OK  ] Third party lib C:/Program Files (x86)/MATLAB/R2012b/extern/lib/win32/microsoft/libeng.lib
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/ksp6/Documents/OpenViBE/local-tmp/openvibe-plugins/matlab/trunc

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

[100%] Built target OpenViBE-plugins-matlab-dynamic

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

[100%] Built target OpenViBE-plugins-matlab-dynamic
Install the project...
-- Install configuration: "Release"
-- Up-to-date: C:/Users/ksp6/Documents/OpenViBE/openvibe-plugins/matlab/trunc/lib/OpenViBE-plugins-matlab-dynamic.lib
-- Up-to-date: C:/Users/ksp6/Documents/OpenViBE/openvibe-plugins/matlab/trunc/bin/OpenViBE-plugins-matlab-dynamic.dll
Running the Tutorial:
I was trying to test the share/openvibe-scenarios/box-tutorials/matlab/tuto1-signal-filter.xml but could not get it to run successfully.

I ran ov-designer.cmd and loaded the project. I can see that OV loads the matlab-plugin:

Code: Select all

[  INF  ] Added 2 plugin object descriptor(s) from [../bin/OpenViBE-plugins-matlab-dynamic.dll]
I also added the respective Matlab-path executables and Matlab working directory paths, but when I hit play I get the following error saying that it could not load the matlab engine.

Code: Select all

[ ERROR ] At time 0.0 sec <Box algorithm::Signal filter> First call to MATLAB engine failed.
        To use this box you must have MATLAB (32 bits version) installed on your computer.
[WARNING] Box algorithm <Signal filter> has been deactivated because initialization phase returned bad status
I would appreciate if you'll could help me in anyway. Thanks in advance.

-Kedar

KedarPs
Posts: 2
Joined: Wed Dec 05, 2012 6:39 pm

Re: Using Matlab with OpenViBE

Post by KedarPs »

Ok I think I got this one. I realised that in the Matlab executables path and the working directory path, you have to enter a '\' at the end of the path. e.g.

This path is invalid:
C:\Users\ksp6\Documents\OpenViBE\dist\share\openvibe-scenarios\box-tutorials\matlab

However this one is: (Note the additional '\' at the end of the path)
C:\Users\ksp6\Documents\OpenViBE\dist\share\openvibe-scenarios\box-tutorials\matlab\

Thanks though. And sorry for the previous post being so long.

-Kedar.

jlegeny
Posts: 239
Joined: Tue Nov 02, 2010 8:51 am
Location: Mensia Technologies Paris FR
Contact:

Re: Using Matlab with OpenViBE

Post by jlegeny »

Hello KedarPs,

thank you for mentioning this issue, we will look at it to make this more user friendly in the next release.

Cheers
Jozef

toncho11
Posts: 124
Joined: Tue Apr 19, 2011 7:58 pm

Re: Using Matlab with OpenViBE

Post by toncho11 »

Hi,

Also when setting the folders in the Matlab script box in the designer it is important to:

1) use "/" instead of "\"
2) use DOS names for "Program files" and similar long paths:

C:\Program Files = C:\Progra~1
C:\Program Files(x86) = C:\Progra~2

-Anton

Haneen
Posts: 12
Joined: Sat Feb 09, 2013 10:26 am

Re: Using Matlab with OpenViBE

Post by Haneen »

Where can I find win32-dependencies.cmd ?

I am facing the same problem actually :)!

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Using Matlab with OpenViBE

Post by jtlindgren »

In 0.15.0 prepackaged distributions its in dependencies\ under the openvibe install folder and called set-env.cmd. For source packages the file is created by the dependency installer .exe and is located in scripts\. We're currently working on related parts so expect SVN version to be possibly a little different again.


Happy hacking,
Jussi

Post Reply