Sunday, February 24, 2013

Error: device not ready(firmware missing) while enabling wi-fi ubuntu 12.04

When I tried to enable wi-fi on my laptop, a ubuntu 12.04 system,
I got the following Error: 
device not ready(firmware missing)

To solve this, first check if wireless driver is installed in your system.
Check for wireless driver in the following path:
Applications-> System Tools-> System settings->Additional Driver

If it is present and activate it.

If not, we need to install the driver. Use the following commands for the same and you are done! 
$ sudo apt-get install firmware-b43-installer
$ sudo apt-get install firmware-b43-lpphy-installer  


Reference:
 
http://askubuntu.com/questions/149999/how-do-i-install-missing-firmware 

Sunday, January 20, 2013

If font size in the figures do not change in Matlab..

If you wish to change the font of the text in your Matlab figure globally, then you have to set :

>>set(gca, 'FontSize', xx);

And if you want to change it only for a specific legend or text or axis-handles just add the option 'FontSize',  xx  to your parameters.

But this did not work in my Ubuntu 12.04 system. No matter what changes I made, Matlab displayed a fixed font size.

Thanks to the following forums, I could sort it out:
 
 
http://www.mathworks.in/matlabcentral/newsreader/view_thread/301184
http://ubuntuforums.org/showthread.php?t=1762805

You need to go to terminal and install following two packages, log in again.
 
$sudo apt-get install xfonts-75dpi
$sudo apt-get install xfonts-100dpi

Saturday, January 5, 2013

Manage your time at work: timer for Ubuntu

Well, sometime back I was finding it difficult to focus and manage my time. Some times, I would sit at work for long period at a stretch affecting my health, some other time I would not be able to focus for 10 minutes. I searched for a timer that will help me set a fixed duration in which I will be bound to focus. I found a tool in the following link for usage in Ubuntu. I also found many more tools, but I liked this particular one because it is simple and has the visual clock like effect. As the time recedes, I become more alert since I need to finish the task within that period.

http://www.upubuntu.com/2011/10/beautimer-quick-and-lightweight.html

I found it very useful in managing my time and focusing as well. Hope it helps you too. :)

Happy working!

Friday, November 30, 2012

Gabor Filters, some useful links for overview

I had to go through the functionality of gabor filter for a group discussion. It was really interesting and engaging discussion where everyone really got involved, and I learned more than I taught :)..

Well, I am putting down the links I referred for my study,

http://en.wikipedia.org/wiki/Gabor_filter
http://upload.wikimedia.org/wikipedia/commons/b/b5/Gabor-ocr.png
http://matlabserver.cs.rug.nl/edgedetectionweb/web/edgedetection_params.html
https://ccrma.stanford.edu/~jos/sasp/Dyadic_Filter_Banks.htmlhttp://www.cs.utah.edu/~arul/report/node13.html

I also found a beautiful presentation about Gabor filters and texture segmentation (The most important application of Gabor filters). Here it is...

 vplab.iitm.ac.in/courses/CV_DIP/PDF/Lect-Gabor_filt.pdf

There is a matlab implementation also available :
http://www.mathworks.in/matlabcentral/fileexchange/5237-2d-gabor-filterver123
 
Enjoy!

Tuesday, November 27, 2012

compressing in Linux : the 'tar' command

I find  the 'tar' command very useful for my work especially when I work with lots of files and maintain lot of versions of code. The man page of tar is huge and I am sure there are many more flavours to it. However, I always find it confusing...there are certain customizations of 'tar' that come handy to me often and here they are...

$tar -cvzf filesDir.tgz  filesDir/
Compress all files in directory filesDir to filesDir.tgz

Suppose, you edit only a few files of a huge directory with lots of sub-folders, then you would want to save only those few files.

In such case you should maintain a fileList which contains all filenames with relative path to the parent folder.

$cat fileList.txt
file1
file2
subdir1/subdir2/file3
subdir3/file4
subdir4/


$tar -cvzf filesDir.tgz -T fileList.txt
This will compress  the files mentioned in fileList.txt. Note that subdir4/ is an entire folder. In this case, we are compressing all files contained in subdir4/

Now, comes the uncomressing part.

Go to the required path.
$ mkdir filesDir
$cd filesDir
filesDir]$ tar -xvzf filesDir.tgz


In case when you want to merge this data into another version of the same library/code, you can go into that directory and simply untar as above. The corresponding files in respective paths will get replaced by the files in filesDir.tgz, and new files and folders will be added.


Before untarring, we may want to check the difference to make sure that we are doing the right thing.


Here are the commands:
$diff -r dir1/ dir2/
This will display all the differences in two directories and their contents recursively (-r).


If you want to just see the files which correspond to changes, not the contents, then
$diff --brief -r dir1/ dir2/

Saturday, November 24, 2012

beautiful Matlab tutorials for advance usage

Found  an excellelent tutorial on Matlab for advance usage such as speed-up, debugging, using OOP.  Its been really useful to me, hope anyone who finds it will be equally delighted having found it :)

YAGTOM: Yet Another Guide TO Matlab

Enjoy!

Monday, November 19, 2012

UGM Library for Undirected Graphical Models

I was in search for  suitable library for CRF implementation for my segmentation work and found the UGM library useful, since it has some demos and nice explanations for different functionalities. It also seems to be up-to-date with different inference techniques.

Here is the link for the directory:
http://www.di.ens.fr/~mschmidt/Software/UGM.html

They have clearly explained the download and setup process. However, I found that bit scattered across different pages, so here are the steps that I went through:

1. Download the tgz from the homepage .
The 2011 version is available in www.di.ens.fr/~mschmidt/Software/UGM_2011.zip

2. There are also some updates in 2012. Download them as well.

3.Download the mex-wrapper for maxflow from the link http://www.mathworks.com/matlabcentral/fileexchange/21310-maxflow and place it under the directory UGM/

4.Download maxflow-v3.01.zip from  http://vision.csd.uwo.ca/code/ and place it inside UGM/maxflow/  under the name maxflow-v.3.0 (since the different files refer to it in the same name.)  Note: there is a  Readme.txt in UGM/maxflow/ to guide us too.

5.In matlab command window,
 >> cd UGM/
 >> addpath(genpath(pwd))
>> mex -setup
>> mexAll

In case you find errors like the following while running mexAll, sort it out using help from the other blogpost :  matlab-error-of-type-usrbinld

: /usr/bin/ld: matlab/sys/os/glnx86/libstdc++.so.6: version `GLIBCXX_3.4.10' not found (required by /usr/bin/ld) 

 

 5. >> cd maxflow/
      >> make
     >> test1 
     >> test2   % to test the functionality
      >> cd ..

In case you are in a 64-bit system, you will face an error like this:

>> make     
>> test1

??? Error using ==> maxflowmex
Function "mxGetIr_700" is obsolete in file "compat32.cpp", line 282.
(64-bit mex files using sparse matrices must be rebuilt with the "-largeArrayDims" option.  See the R2006b release notes for
more details.)


Error in ==> maxflow at 35
[flow,labels] = maxflowmex(A,T);

Error in ==> test1 at 32
[flow,labels] = maxflow(A,T)


The solution is, 

edit the file maxflow/make.m as follows:


mex -O -largeArrayDims maxflowmex.cpp maxflow-v3.0/graph.cpp maxflow-v3.0/maxflow.cpp


Then
>> make
>> test1 
>> test2   % to test the functionality
>> cd ..


6.  Run any demo present in UGM/examples/. For example,
  >> example_UGM_AlphaBeta