Page 1 of 1

Using Matlab with OpenViBE

Posted: Wed Dec 05, 2012 9:49 pm
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

Re: Using Matlab with OpenViBE

Posted: Wed Dec 05, 2012 10:15 pm
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.

Re: Using Matlab with OpenViBE

Posted: Mon Jan 07, 2013 12:18 pm
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

Re: Using Matlab with OpenViBE

Posted: Sun Jan 13, 2013 12:19 pm
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

Re: Using Matlab with OpenViBE

Posted: Sun Feb 17, 2013 6:01 pm
by Haneen
Where can I find win32-dependencies.cmd ?

I am facing the same problem actually :)!

Re: Using Matlab with OpenViBE

Posted: Mon Feb 18, 2013 10:08 am
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