1

I am having trouble getting the Vlfeat computer vision library in Octave to work. I compiled it following the instructions on the vlfeat website http://www.vlfeat.org/install-octave.html But when i try to run vl_version, octave gives me this error:

>> vl_version verbose
error: invalid use of script /users/myu/downloads/vlfeat-0.9.18/toolbox/misc/vl_version.m in index expression

The same thing happens when I try to run a basic demo program:

>> vl_demo_sift_basic
error: invalid use of script /users/myu/downloads/vlfeat-0.9.18/toolbox/sift/vl_sift.m in index expression
error: called from:
error:   /Users/myu/Downloads/vlfeat-0.9.18/toolbox/demo/vl_demo_sift_basic.m at line 29, column 6

I'm working on mac os x mavericks. I'm pretty new to octave and mac so I apologize if this is a very basic question. Thank you in advance for your help! :)

Update: Here is line 29 of the vl_demo_sift_basic code: (I is an image)

[f,d] = vl_sift(I) ;

I did some more looking and I'm not sure if the MEX files were compiled successfully--the vlfeat website says that once the MEX files are successfully compiled I should be able to look for them in toolbox/mex/octave/, however I cannot find this directory.

user3922963
  • 35
  • 2
  • 5
  • Are you sure all the installation instructions on that page showed 0 error messages? Please show us line 29 of the `vl_demo_sift_basic.m` file. Did you cut the first error message? It should also contain a "called from:" part. – juliohm Aug 08 '14 at 22:23
  • Thanks you for your reply! I just added line 29--it calls the vl_sift script. I didn't cut the first error message, it does not specify a line number. I just looked again and didn't see any errors on the installation. The only thing remotely resembling an error is `Clang does not support OpenMP yet, disabling.` but I don't think that would affect my problem. – user3922963 Aug 09 '14 at 18:15
  • Find the directory where the files were compiled and also check the contents of `vl_sift()` function to see if it's being called properly. – juliohm Aug 10 '14 at 21:54
  • Thank you for your help! I just switched to Matlab yesterday, and vlfeat now works perfectly-unfortunately, I'm still not sure why it wasn't working for me in Octave. Many thanks for your suggestions. – user3922963 Aug 13 '14 at 20:46

1 Answers1

0

This is probably because the code for octave didn't compile correctly yet. There should be a folder /home/anne/setup/vlfeat-0.9.20/toolbox/mex/octave after the build process.

First of all do not forget the MKOCTFILE variable:

MKOCTFILE=mkoctfile make info | grep -i octave
** Octave support
OCTAVE support enabled (MKOCTFILE found)

Or else, you'll get:

make info | grep -i octave                    
** Octave support
OCTAVE support disabled (MKOCTFILE not found)

You will need to install:

sudo apt-get install liboctave-dev octave-image

Navigate to the directory build and run from there:

cd VLFEAT_ROOT/toolbox/mex/octave/mexa64
octave

octave:1> vl_version verbose
VLFeat version 0.9.20
Static config: X64, little_endian, GNU C 40901 LP64, POSIX_threads, SSE2, OpenMP
8 CPU(s): GenuineIntel MMX SSE SSE2 SSE3 SSE41 SSE42 AVX
OpenMP: max threads: 8 (library: 8)
Debug: no
SIMD enabled: yes

octave:2> addpath('../../..');
octave:3> vl_setup

And then something like this:

I=imread('place/some.jpg');
image(I)                                                                        
J = single(rgb2gray(I)) ;                                                       
[f,d] = vl_sift(J, 'edgethresh', 10, 'PeakThresh', 3) ;                         
perm = randperm(size(f,2)) ;                                                    
sel = perm(1:500) ;                                                             
h1 = vl_plotframe(f(:,sel)) ;                                                   
h2 = vl_plotframe(f(:,sel)) ;                                                   
set(h1,'color','k','linewidth',3) ;                                             
set(h2,'color','y','linewidth',2) ;  

Although the original question was solved by using Matlab instead, I can imagine someone wants to use octave. Especially because the functionality does not only require Matlab but also the Image Processing toolbox within Matlab (if you do not stick to octave).

Anne van Rossum
  • 3,091
  • 1
  • 35
  • 39