MagicWand

-
Looking for MagicWand ? click here
-

Thursday, December 29, 2011

Installing OpenCV 2.3.1 on Ubuntu

OpenCV (Open Source Computer Vision Library) is a library of programming functions mainly aimed at real time computer vision, developed by Intel and now supported by Willow Garage. This post describes the procedure to successfully install OpenCV 2.3.1 in your Ubuntu operating system,


We are not going to use any special IDE(like eclipse or visual studio), we will use our terminal and default compilers (gcc and g++), for the compilation of our code..


If you have earlier tried to install it and haven't got any success, I recommend you to use a fresh copy of Ubuntu, and then follow the below given procedure..



To install and configure OpenCV 2.3.1 with its dependencies, complete the following steps.
  1. Remove any installed versions of ffmpeg and x264 by entering the following command:
sudo apt-get remove ffmpeg x264 libx264-dev
  1. Get all the dependencies for x264 and ffmpeg by entering the following commands:
sudo apt-get update
sudo apt-get install build-essential checkinstall git cmake libfaac-dev libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libva-dev libvdpau-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev texi2html yasm zlib1g-dev
  1. Download and install gstreamer, a pipeline-based multimedia framework written in the C programming language, which allows a programmer to create a variety of media-handling components, including simple audio playback, audio and video playback, recording, streaming and editing. The pipeline design serves as a base to create many types of multimedia applications such as video editors, streaming media broadcasters, and media players, by entering the following command:
sudo apt-get install libgstreamer0.10-0 libgstreamer0.10-dev gstreamer0.10-tools gstreamer0.10-plugins-base libgstreamer-plugins-base0.10-dev gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad gstreamer0.10-ffmpeg
  1. Download and install x264, a free software library for encoding video streams into the H.264/MPEG-4 AVC format.
    1. Download a recent stable snapshot of x264 from ftp://ftp.videolan.org/pub/videolan/x264/snapshots/. The exact version does not seem to matter. To write this guide, I used version x264-snapshot-20110808-2245-stable.tar.bz2, but I have used previous versions too.
    2. Configure and build the x264 libraries by entering the following commands:
./configure --enable-static
make
sudo make install
  1. Download and install install ffmpeg, a free software project that produces libraries and programs for handling multimedia data.
    1. Download ffmpeg version 0.8.x from http://ffmpeg.org/download.html. Note: Versions of OpenCV prior to 2.3.1 require ffmpeg 0.7.x.
    2. Configure and build ffmpeg by entering the following commands in a terminal:
./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
make
sudo make install
  1. Download and install gtk, a cross-platform widget toolkit for creating graphical user interfaces, by entering the following command:
sudo apt-get install libgtk2.0-0 libgtk2.0-dev
  1. Download and install libjpeg, a library written entirely in C which contains a widely-used implementation of a JPEG decoder, JPEG encoder and other JPEG utilities, by entering the following command:
sudo apt-get install libjpeg62 libjpeg62-dev
  1. Download and install install v4l (video for linux), a video capture (from webcams, TV tuners etc.) application programming interface for Linux.
    1. Download v4l-utils-0.8.5.tar.bz2 from http://www.linuxtv.org/downloads/v4l-utils/
    2. Build v4l by entering the following commands in a terminal:
make
sudo make install
  1. Download and install install OpenCV.
    1. Download OpenCV version 2.3.1 from http://sourceforge.net/projects/opencvlibrary/files/
    2. Use the following command to untar the source files
tar xvf OpenCV-2.3.1.tar.bz2
cd OpenCV-2.3.1/
mkdir build
cd build
cmake ..
    1. Check that the output of cmake includes the following text:
      • found gstreamer-base-0.10
      • GTK+ 2.x: YES
      • FFMPEG: YES
      • GStreamer: YES
      • V4L/V4L2: Using libv4l
    1. Run make
    2. Run sudo make install
  1. Configure Linux.
    1. Tell linux where the shared libraries for OpenCV are located by entering the following shell command:
      export LD_LIBRARY_PATH=/usr/local/lib
      Add the command to your .bashrc file so that you don’t have to enter every time your start a new terminal.
      Alternatively, you can configure the system wide library search path. Using your favorite editor, add a single line containing the text /usr/local/lib to the end of a file named/etc/ld.so.conf.d/opencv.conf

    2. Using your favorite editor, add the following two lines to the end of /etc/bash.bashrc:
      PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
      export PKG_CONFIG_PATH
    3. Reboot.
After completing the previous steps, your system should be ready to compile code that uses the OpenCV libraries. The following example shows one way to compile code for OpenCV:
g++ `pkg-config opencv --cflags` `pkg-config opencv --libs` my_code.cpp  -o my_code


Facial recognition login for Ubuntu

Now you can log into your Ubuntu with your webcam using this facial recognition login .. :)


Installation

Open a terminal (Applications > Accessories > Terminal) and enter in the following two lines carefully.
sudo add-apt-repository ppa:antonio.chiurazzi/ppa
sudo apt-get update && sudo apt-get install pam-face-authentication
Now run the ‘Face Trainer’ application from the Applications > Other menu.
Now to add the face authentication module to GDM, Ubuntu’s default login-manager:
sudo sed -i '1i auth sufficient pam_face_authentication.so enableX' /etc/pam.d/gdm
sudo sed -i '1i auth sufficient pam_face_authentication.so enableX' /etc/pam.d/gnome-screensaver
Depending on your webcam model/make you may need to install and add libv4l to preload:
  • Create the file /etc/ld.so.preload
  • Paste in the path to the v411compat.so file commonly found in /usr/lib/libv4l (create it if not found)
Now everything is done,  just restart or logoff your system and have fun.. :)


Uninstall
In case you want to uninstall this service, just follow these steps-


edit /etc/pam.d/gdm and remove this line: 

auth sufficient pam_face_authentication.so enableX


then, edit /etc/pam.d/gnome-screensaver and remove this line

auth sufficient pam_face_authentication.so enableX


then, run this code in your terminal and wait for the system to get restart:

sudo /etc/init.d/gdm restart 

The service has already been discontinued, but you need to remove the useless support files from your system, so when the system resumes,  just remove the FACE TRAINER application

then, run the following code in your terminal:

sudo rm /etc/ld.so.preload

then, edit v411compat.so file commonly found in /usr/lib/libv4l, and remove the path:

/etc/ld.so.preload

Now you are done, The face recognition has been completely removed from your system..

Wednesday, December 28, 2011

India Against Corruption

We Indians are not living, we are just spending our days, is this a life where a common man has no value, people lack basic facilities and there is no security, everyday people get murdered and investigations result in nothing, our valuable taxes are getting deposited in Swiss accounts of our politicians.. is this the law and order, is this a life,, people just say that nothing can happen with India, and of course nothing will happen, if we would think in this way,, people just want to run to other countries to have a better lifestyle,, but running from situation can never help,, and for those who criticise people like Anna Hazare by saying that his views are just stupidity and anti democratic, all of them should understand that, first of all its a fundamental right of an Indian citizen to protest peacefully and if Gandhi would have thought in the same manner, we would have never got our independence,, fight against corruption is our fight with ourselves,, one should understand that we people don't have any problem, people are same who easily adapt the laws when migrate to developed countries, people stop littering streets, happily pay taxes and so on, but we feel difficult to do that in our own country, actually this isn't totally our fault, who wants to pay taxes, if we know that they are going to get in someone's Swiss accounts.. we know the names of ministers engaged in scams, media hypes the matter for few days and afterwards everything gets usual,, we have learnt to adjust rather then to fight,, people ask that no country has such strong anti corruption bill, so why we need it,, but the thing to understand is that as one shoe doesn't fits all,, similarly,  the situation of our country is alarming, we do need a strong anti corruption bill,, there are number of scams of thousands of crores,, and if this money would have been used for public welfare, we would have got so many benefits,, the problem is that we always go for shortcuts, people who get power starts misusing them,, in fact its the typical human behaviour,, and that what laws are meant for,, rules always make everybody suffer only bcoz of few spoiling elements,, but they are important for common good of all,, the problem lies with implementation, people get driving licences without ever sitting in a car.. people don't have fear of law,, everyday newspapers are full of murders, robberies and scams,, its now the time to bring some change,, fight of Anna is not against any govt official,, its a fight against corruption, a fight for common good of all,, of course it would affect life of all of us, but it will definitely be helpful in long term,, its a human nature, none of us wanna do anything, until a strictness is imposed on us,, children would never do their homework, if teachers and parents would not force them,, children do criticise, but still have to do it as they don't have any choice, but after a time they also realize that it was essential for them,, similarly we have started living in environment where we have have learnt to survive with paying easy bribes,, all of us somewhat rusted with corruption, so the strict rules are definitely gonna affect all of us to little or more extent,, and this is a main problem for which govt is hesitating to pass the bill, as many of the ministers are gonna get in big trouble after enactment of this bill,, but this is defiantly gonna help in long run,, help India to get better,, and if someone has a better idea, one should suggest it, and if someone can't, he/she also has no right to criticise it, first clearly study what a jan-lokpal bill is and then make up your suggestions, don't blindly follow the devastating comments of govt. officials , please don't let this movement to get failed, its a movement for our country,, this is our chance to bring a change.. show the world, the power of people in the biggest democracy, help India,, your country wants your support, be a part of mass-movement,, jai hind..

Tuesday, August 2, 2011

All NES characters in Super Mario world - highly innovative recreation

All the fans of old classic NES games should try this new Super Mario Bros. Crossover game,, its a new avatar of classic super mario with characters from other NES games. Moreover, each character behaves just like its own game, which makes this game very interesting to play. Click Here to play or to read more.

Friday, July 15, 2011

Bucky - the ultimate tutor on internet

Hey guys, I have found an ultimate collection of video tutorials from a guy called Bucky, and trust me.. his way of teaching is much more cooler then his name :D:D,.. this collection is a huge knowledge bank including dozens of things from photoshop to web development, C++ to iphone development and much much more.. Bucky is an excellent teacher ,,  and his way of teaching can bind anybody for hours.. he covers even the smallest details of every topic and that too very patiently.. in short,, his tutorials are perfect for all beginners to start with.. so just "buck" up and explore the world of Bucky Roberts at http://www.thenewboston.com . : )

Wednesday, July 6, 2011

MagicWand




MagicWand is my new android app which converts your phone into a bluetooth gyro-mouse and makes you able to control your PC by just waving your mobile device in the air.


Download MagicWand


Get MagicWand Android application for your mobile device from here,
or use this QR code for direct download.


To use this app you need to install the MagicWand server onto your PC too. Download PC server from here
(your PC should also have a bluetooth dongle and JRE properly installed.
Download JRE from here, if required.)


Parental rating: 
G: General Audiences (for all ages)
Screenshots: 

Application Permissions:
Bluetooth admin - Allows an application to configure the local Bluetooth device, and to discover and pair with remote devices.
Bluetooth - Allows an application to view configuration of the local Bluetooth device, and to make and accept connections with paired devices.
Wake lock - Allows an application to prevent the device from going to sleep.
Vibrate - Allows the application to control the vibrator.

Sunday, July 3, 2011

Fool your friends with anonymous emails

Have you ever got any email from santa or any email from Microsoft saying that you have won a million dollar lotto..:D:D... these are anonymous emails which carry fake identity details with them,, fortunately, now some of the email services like Gmail have developed techniques to filter such spams.. but most of the email providers still don't bother about them and above all, most of the people are not aware of this kind of stuff... the coolest thing is that there are hundreds of websites available on internet which helps user to send fake emails in few easy steps,, user need not have any knowledge of hacking or complex cyber stuff,, this is as simple as sending an ordinary email.. some of such websites are-

- http://www.sendanonymousemail.net
- http://www.emkei.cz

now start fooling your friends with this cool prank,, have fun..:)

Free SMS's... without ads


I have found a really cool service which allows users to send free 470 character sms's anywhere in india and that too without ads. This service is really quick and also has a cool phone app which can synchronize your phone contacts with web and also helps you sending free messages from your phone itself.. so now say bye to your old bulk sms plans and say hello to whozzat..

Learn Android app development: Marko Gargenta

 
Any one interested in learning Android app development?? well you don't need to pay even a single penny and can do it sitting in front of your pc and that too under guidance of an excellent teacher Marko Gargenta.. Marko has taught Android for companies such as Sony-Ericsson, Qualcomm, Ericsson Canada, and many others. Now full lectures from his 5 day Bootcamp are available online,, these are amazing videos and are really helpful...
Click here to access them and get ready to release your first app... :):)