Blank screen after installing nvidia driver (ubunbu安装nvidia显卡驱动后黑屏)

2014年1月30日 11:18

Problem: ubunbu安装nvidia显卡驱动后黑屏

导致黑屏原因: 

运行完如下命令后,系统就呵呵了

sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install nvidia-current

评论(0) 阅读(1664)

Install Kinect on Ubuntu 12.10

2013年4月09日 16:48

This is a simple and short tutorial on how to set up Kinect for your Linux Mint 12 (It also should work fine with Ubuntu 12.04 or 12.10). For this task OpenNI Framework is going to be used. The official short description of OpenNI is :

The OpenNI Framework provides the interface for physical devices and for middleware components. The API enables modules to be registered in the OpenNI framework and used to produce sensory data. Selecting the hardware or middleware module is easy and flexible.

This Tutorial will use the NITE middleware to enable skeleton tracking.

To install KInect with OpenNI and NITE please follow the next 5 steps, with your Kinect Unplugged.

Step 1 - Install Required support library

First step is to check if you have all the needed libraries, and if they are up to date.

 

 
sudo apt-get install libusb-1.0-0-dev freeglut3-dev g++

If you have a Nvidia graphics card it's recommended to have the latest drivers: Instruction here

Step 2 - Create a folder for holding the download and the installation

I recommend to create a 'kinect'  in your home folder:


cd ~
mkdir kinect

Step 3 - Download the OpenNI , NITE

It's going to be necessary to download to the created folder the latest OpenNI  Binary and the NITE middleware. Until the publication of this tutorial the most recent version available were :

Update 06-JUN-2012*

If you are using Ubuntu 12.04 make sure to have the following versions (I tried Openni version 2.1.0, not working, but 1.5.4 works!):

  1. OpenNI UNstable build for Ubuntu 12.04- - v1.5.4 https://github.com/OpenNI/OpenNI/tree/unstable
  2. PrimeSense and NITE UNstable build for Ubuntu 12.04 - v1.5.2.21 https://github.com/PrimeSense/Sensor/tree/unstable

Step 4 - Extract the downloaded zip to the desired folder

Now Extract The files and Rename the folders:

Your 'kinect' folder should have 3 zipped files. 


cd ~/Kinect/OpenNI-unstable/Platform/Linux/CreateRedist$ ls

sudo ./RedistMaker

cd ../Redist

sudo ./install.sh



cd ~/Kinect/SensorKinect/Platform/Linux/CreateRedist

sudo ./RedistMaker

cd ../Redist/

sudo ./install.sh

cd ~/kinect/NiTE-2.0.0/

sudo ./install.sh

Step 5 - Test it!


cd ~/Kinect/OpenNI-unstable/Platform/Linux/Redist/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Samples/Bin/x86-Release

./Sample-NiSimpleViewer

Bug Fix:

" Failed to set USB interface "

this module allows Kinect to be used as a standard camera, so you can record video from it with the applications you're used to. Thus, it conflicts with OpenNI when trying to access the Kinect.

And then blacklisting to avoid it to be auto-loaded on boot:

 sudo modprobe -r gspca_kinect

 sudo sh -c 'echo "blacklist gspca_kinect" > /etc/modprobe.d/blacklist-kinect.conf'

Reference:
http://igorbarbosa.com/articles/how-to-install-kin-in-linux-mint-12-ubuntu/
https://groups.google.com/forum/?fromgroups=#!topic/openni-dev/LZpcyCfh9UE
http://adriangerardcooke.com/kinect-on-ubuntu-12-04/
http://www.20papercups.net/programming/kinect-on-ubuntu-with-openni/

评论(0) 阅读(4846)

A Comprehensive Tutorial of Installing OpenCV 2.4.3 in Ubuntu 12.10 [ i386 ]

2013年2月17日 12:03

THIS NICE ARTICLE IS ORIGINALLY FROM OzBotz

http://www.ozbotz.org/opencv-installation/

(few modifications are made for 12.10 version ubuntu system here)

The Installation Procedure

To install and configure OpenCV 2.4.1, complete the following steps. The commands shown in each step can be copy and pasted directly into a Linux command line.

  1. Remove any installed versions of ffmpeg and x264.
    sudo apt-get remove ffmpeg x264 libx264-dev
  2. Get all the dependencies for x264 and ffmpeg.
    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
  3. Download and install gstreamer.
    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
  4. Download and install gtk.
    sudo apt-get install libgtk2.0-0 libgtk2.0-dev
  5. Download and install libjpeg.
    sudo apt-get install libjpeg8 libjpeg8-dev
  6. Create a directory to hold source code.
    cd ~
    mkdir src
  7. Download and install install x264.
    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-20120528-2245-stable.tar.bz2, but I have used previous versions too.
          cd ~/src
      
          wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20120528-2245-stable.tar.bz2
      
          tar xvf x264-snapshot-20120528-2245-stable.tar.bz2
      
          cd x264-snapshot-20120528-2245-stable
    2. Configure and build the x264 libraries.
      ./configure --enable-static
      
      make
      
      sudo make install

      IMPORTANT: If you are running a 64-bit version of Ubuntu, you must configure x264 as shown in the following command

      ./configure --enable-shared --enable-pic
    3. The -shared and -pic options might also be required when you compile for some other architectures, such as ARM. You know you need these options if you get the following error when compiling OpenCV:

      [ 25%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/bitstrm.cpp.o
      Linking CXX shared library ../../lib/libopencv_highgui.so
      /usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32S against `av_destruct_packet' can not be used when making a shared object; recompile with -fPIC
      /usr/local/lib/libavcodec.a: could not read symbols: Bad value
  8. Download and install install ffmpeg.
    1. Download ffmpeg version 0.11.1 from http://ffmpeg.org/download.html.
      cd ~/src
      
      wget http://ffmpeg.org/releases/ffmpeg-0.11.1.tar.bz2
      
      tar xvf ffmpeg-0.11.1.tar.bz2
      
      cd ffmpeg-0.11.1
    2. Configure and build ffmpeg.
      ./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

      IMPORTANT: Just like with x264 in the previous step, you must configure ffmpeg with the -shared and -pic options if you are running a 64-bit version of Ubuntu or some other architectures, such as ARM.

      ./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 --enable-shared --enable-pic
  9. Download and install install a recent version of v4l (video for linux) from http://www.linuxtv.org/downloads/v4l-utils/. For this guide I used version 0.9.3.
        cd ~/src
    
        wget http://www.linuxtv.org/downloads/v4l-utils/v4l-utils-0.9.3.tar.bz2
    
        tar xvf v4l-utils-0.9.3.tar.bz2
    
        cd v4l-utils-0.9.3
    
        ./configure
    
        make
    
        sudo make install
  10. Download and install install OpenCV 2.4.3.
    1. Download OpenCV version 2.4.3 from http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.3/OpenCV-2.4.3.tar.bz2/download
          cd ~/src
      
          tar xvf OpenCV-2.4.2.tar.bz2
    2. Create a new build directory and run cmake:
      cd OpenCV-2.4.2/
      
      mkdir build
      
      cd build
      
      cmake -D CMAKE_BUILD_TYPE=RELEASE ..
    3. Verify 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
    4. Build and install OpenCV.
      make
      
      sudo make install
  11. 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. In the standard Ubuntu install, the opencv.conf file does not exist; you need to create it. Using vi, for example, enter the following commands:

      sudo vi /etc/ld.so.conf.d/opencv.conf
      G
      o
      /usr/local/lib
      <Esc>
      :wq!

      After editing the opencv.conf file, enter the following command:

      sudo ldconfig /etc/ld.so.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

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` my_example.cpp -o my_example `pkg-config opencv --libs` 

Sample c++ file here, my_example.cpp, used for opening an image:

#include <stdio.h>
#include <opencv2/opencv.hpp>

using namespace cv;

int main( int argc, char** argv )
{
  Mat image;
  image = imread( argv[1], 1 );

  if( argc != 2 || !image.data )
    {
      printf( "No image data \n" );
      return -1;
    }

  namedWindow( "Display Image", CV_WINDOW_AUTOSIZE );
  imshow( "Display Image", image );

  waitKey(0);

  return 0;
}

Once compiled, run command to see the sweetie :D

./my_example cLena.bmp

评论(5) 阅读(8092)

[ubuntu] Google Chrome: Could not load plugin error fixed

2013年2月04日 14:59

Problem Description:

Ubuntu 12.10 , Chrome Version 22.0.1229.94

For unknown reason it could not play any videos or sounds
and error "could not load plugin" reported.

Solution:

Run command in terminal :

rm -rf ~/.config/google-chrome/PepperFlash/

评论(0) 阅读(3052)

ubuntu下force quit 的快捷键

2013年2月02日 13:52

There are easier ways to force quit apps, of course.

Hit Alt-F2 to bring up the "Run Application" dialog, then type xkill there and hit enter.

先按Alt+F2

输入xkill会出现一个黑色小骷髅

把小骷髅移到程序上点一下就可以了

评论(0) 阅读(1748)