Sep 28, 2009

Saliency Toolbox with ubuntu 8.10

The SaliencyToolbox is a collection of Matlab functions and scripts for computing the saliency map for an image, for determining the extent of a proto-object, and for serially scanning the image with the focus of attention. It has been cited in more than 60 papers.

System requirements:

* Any computer and operating system that runs Matlab
* Matlab Release 13 or later
* Image Processing Toolbox

What to do :

1- Unpacking the code creates a directory structure under SaliencyToolbox. Simply add the SaliencyToolbox directory including its subdirectories to your Matlab path:
[MATLAB] >> addpath(genpath(""));
2- Okay, now that installation was so simple, you have some time left for a test drive, right? Version 2.0 sports a new graphical user interface (GUI) version of the saliency code. In Matlab, change to the SaliencyToolbox directory, then type:
[MATLAB] >> guiSaliency('img/balloons.png');
Hit "Start" to start the saliency computation. Everything else should be fairly intuitive.

There is also the command-line version of the program:
[MATLAB] >> runSaliency('img/balloons.png');
After a few moments, you should see four figure windows with various intermediate results, and in the Matlab window you will see details about the most salient location, which is also marked in the image. You can now hit Return to go to the next most salient location and so forth. To quit, simply enter 'q' and press Return.

3- If you receive a fatal error "MEX file xxx could not be found." and you are sure that you have set the paths correctly, then you might need to compile the mex files for your system.

* You should export MATLABROOT
[TERMINAL] >> export MATLABROOT="PAth to matlab"
* Then type
[TERMINAL] >> make
* You can see some errors, such that The program 'mex' is currently not installed. You can install it by typing: sudo apt-get install texlive-lang-polish

Solution:
-> Edit makefile in src of saliency toolbox code

* MEXFLAGS := -cxx (This should be selected)
* MEXOPTS := {PATH_TO_SALIENCY_TOOLBOX}/src/mexopts.sh
* MEX := {PATH_TO_MATLAB}/bin/mex

-> Edit mexopts.sh

* change
CFLAGS='-fPIC -ansi -D_GNU_SOURCE -pthread -fexceptions -m32'
to
CFLAGS='-fPIC -ansi -D_GNU_SOURCE -pthread -fexceptions'

* If there is no error, go to matlab and again run saliency code. If it still gives this error:

Error:

{MATLABPATH}/sys/os/glnx86/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)

Solution:

Remove the libgcc_s.so.1 from: {MATLABPATH}/sys/os/glnx86/

After that, restart your computer !
Have fun while finding regions of importance =)

Note:

[TERMINAL]-> gcc --version)

gcc (Ubuntu 4.3.2-1ubuntu12) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

References:
http://www.saliencytoolbox.net/
http://mexcdf.sourceforge.net/faq.html
http://www.saliencytoolbox.net/doc/index.html

No comments:

Post a Comment

Visual Studio Keyboard Shortcuts

Playing with keyboard shortcuts is very interesting and reduce the headache of using the mouse again and again while programming with visu...