How to setup Bumblebee stereo camera under Linux

Source: Internet
Author: User
Tags uncompress
Http://marhes.ece.unm.edu/index.php/TXT-1_Stereo_Camera

  • 1how to setup Bumblebee stereo camera under Linux
  • 2 preconditions
  • 3 install Library
  • 4run Test Program
  • 5 References
  • 6 author

How to setup Bumblebee stereo camera under Linux

This article introduces the general steps to make Bumblebee Stereo Camera (figure 1) work under Linux.

Preconditions

The bumblebee stereo camera has excellent reputation for its performance on the stereo vision. however, it is very "picky" on its running platform: it only works under 32-bit Linux system due to the 32-bit static library provided bypoint
Grey research, INC [3].

The preconditions are listed below:

Items Notes
32-bit Linux System Here we use Debian-2.6.26-2-686
PC or laptop with ieee1394 Interface I use FireWire (1394) PCI Card
Kernel module installed Ieee1394, ohci1394, raw1394
Library installed Libdc1394 (> = 2.0.2), libraw1394 (> = 1.2.0)

Technical notes:

  • <1> Configure the 1394 device kernel module for Redhat/Fedora Linux
  • Article [2] introduces how to setup the kernel modules of 1394 devices with RedHat 9.0 and Fedora Core 1 & 3
  • For Redhat EL5 or fedora 10 or aboved versions Linux, The 1394-kmdl-<version>-<arch>. rpm is available inatrpms
  • For other RedHat or fedora versions of Linux, if there is no 1394 device module installed in the kernel, You have to build a kernel with 1394 device support. The [5] lists detailed instruction
  • <2> Configure the 1394 device kernel module for Debian/Ubuntu Linux
  • To automatically load the kernel modules at Booting time, we can add following lines into file "/etc/rc. Local"

                # create the 1394 devices                mknod /dev/raw1394 c 171 0                chmod a+rw /dev/raw1394                mkdir /dev/video1394                mknod /dev/video1394/0 c 171 16                mknod /dev/video1394/1 c 171 17                mknod /dev/video1394/2 c 171 18                mknod /dev/video1394/3 c 171 19                chmod a+rw /dev/video1394/0                chmod a+rw /dev/video1394/1                chmod a+rw /dev/video1394/2                chmod a+rw /dev/video1394/3                # install the modules                modprobe raw1394                modprobe video1394

  • Also you can choose to manually load the kernel modules into the kernel by run commands in the terminal (root permission is needed)

                   modprobe ieee1394                   modprobe ohci1394                   modprobe raw1394                   modprobe video1394

  • <3> for libdc1394: You shoshould have a directory calledDc1394In which some headers are contained in path/Usr/includeOr else.

Install Library

Point grey research, Inc. Provides the triclops SDK, which is an area based correlation with sad (sum of absolute differences), to perform the image rectification and stereo processing.

The algorithm is fairly robust and it has a number of validation steps that reduce the level of noise. The method requires texture and contrast to work correctly. For more detail, please refer [6].

To install the library, first Please download the pacakge:Triclops3.2.0.8-fc3.tgz, By registering onpoint grey research, Inc's website
Or directly download from
Here.

Second, you also need to download the packagePgr-stereo-examples-libdc-2.0.2.tar.gzHere.
It contains some example programs and a static libraryLibpgrlibdcstereo..

1). uncompress the fileTriclops3.2.0.8-fc3.tgzTo the Directory/Usr/local/includeFirst:

            ~$ sudo tar zxvf Triclops3.2.0.8-FC3.tgz -C /usr/local/include

2). the uncompressed folder name is "triclops3.2.0.8", rename it as "triclops ":

             ~$ sudo mv /usr/local/include/Triclops3.2.0.8  /usr/local/include/triclops

3). uncompress the filePgr-stereo-examples-libdc-2.0.2.tar.gzTo some place, (I prefer/OPT)

            ~$ sudo tar zxvf pgr-stereo-examples-libdc-2.0.2.tar.gz -C /opt

4). Now the uncompressed files under/OPTShocould be:

              |--- /opt/pgr-stereo-examples-libdc-2.0.2                  |---  Makefile                  |--- pgrlibdcstereo                  |--- simplegrab                  |--- simplestereo                  |--- x3bstereo     

Go to the subdirectoryPgrlibdcstereo:

           ~$ cd /opt/pgr-stereo-examples-libdc-2.0.2/pgrlibdcstereo

Modify its makefile with your favorate editor as below:

           ROOT_INCLUDE = /usr/local/include           USER_INCLUDE = /usr/include           # compilation flags           CPPFLAGS += -I.           # libdc1394 installed in /usr/include location           CPPFLAGS += -I$(USER_INCLUDE)/dc1394           CPPFLAGS += -I$(ROOT_INCLUDE)/triclops/include           CPPFLAGS += -Wall -g           CPPFLAGS += -DLINUX           # library that will be generated            LIBRARY_NAME    = pgrlibdcstereo           LIBRARY         = libpgrlibdcstereo.a           LIBRARY_SRC     = pgr_conversions.cpp \                             pgr_stereocam.cpp \                             pgr_registers.cpp           all:    $(LIBRARY)           $(LIBRARY): $(LIBRARY_SRC:%.cpp=%.o)                   $(AR) $(ARFLAGS) $@ $^           %.o:%.cpp                   g++ -c $(CXXFLAGS) $(CPPFLAGS) $*.cpp -o $*.o           clean:                   rm -f *~ *.o *.d $(EXECS)

Then compile the source codes:

          /opt/pgr-stereo-examples-libdc-2.0.2/pgrlibdcstereo$ sudo make

Copy the generated library:

         /opt/pgr-stereo-examples-libdc-2.0.2/pgrlibdcstereo$ sudo cp libpgrlibdcstereo.a  /usr/local/include/triclops/lib         /opt/pgr-stereo-examples-libdc-2.0.2/pgrlibdcstereo$ sudo cp *.h  /usr/local/include/triclops/include

Now we get our libraries for Bumblebee camera ready!

Run Test Program

The other three folders under/opt/pgr-stereo-examples-libdc-2.0.2 are sample codes, to run them we need to compile the source codes to executable files first. For example:

         ~$ cd  /opt/pgr-stereo-examples-libdc-2.0.2/simplestereo

Modify the makefile here:

         ~/opt/pgr-stereo-examples-libdc-2.0.2/simplestereo$ vim Makefile         

DefineRoot_includeAs the parent directoryTriclops;
User_include
As parent directoryDc1394;User_libAs pathTriclops/lib; The modified makefile looks like:

       ROOT_INCLUDE = /usr/local/include       USER_INCLUDE = /usr/include       ROOT_LIB = /usr/local/lib       USER_LIB = /usr/local/include/triclops/lib       LOCALLIB = ../pgrlibdcstereo       # compilation flags       CPPFLAGS += -I.       # libdc1394 installed in /usr/local/include location       CPPFLAGS += -I$(ROOT_INCLUDE)/dc1394       CPPFLAGS += -I$(LOCALLIB)       CPPFLAGS += -I$(ROOT_INCLUDE)/triclops/include       CPPFLAGS += -Wall -g       CPPFLAGS += -DLINUX       # libraries flags       LDFLAGS += -L. -L$(ROOT_LIB)/triclops       LDFLAGS += -L$(LOCALLIB)       LDFLAGS += -L$(ROOT_LIB)       LDFLAGS += -L$(USER_LIB)       LIBS    += -ldc1394 -lraw1394 -pthread       LIBS    += -lpgrlibdcstereo -ltriclops -lpnmutils       # executable name and contents       EXEC1           = simplestereo       EXEC1SRC        = $(EXEC1).cpp       EXEC2           = simplestereo-profile       EXEC2SRC        = $(EXEC2).cpp       EXECS           = $(EXEC1) $(EXEC2)       # compile       all:    bin       bin: $(EXECS)       $(EXEC1): $(EXEC1SRC:%.cpp=%.o)               $(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)       $(EXEC2): $(EXEC2SRC:%.cpp=%.o)               $(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)        %.o:%.cpp               g++ -c $(CXXFLAGS) $(CPPFLAGS) $*.cpp -o $*.o       clean:               rm -f *~ *.o *.d $(EXECS) *.pgm *.ppm

RunMakeTo commile:

       ~/opt/pgr-stereo-examples-libdc-2.0.2/simplestereo$ sudo make

Now we can use the sample program to test the bumblebee stereo camera:

       ~/opt/pgr-stereo-examples-libdc-2.0.2/simplestereo$ ./simplestereo

The captured figures are listed below:

Figure 2: raw image of TXT's nametag captured by Bumblebee's left camera

Figure 3: raw image of TXT's nametag captured by Bumblebee's right camera

Figure 3: rectified Image

Figure 4: disparity Image

References
  • [1] Point grey research, Inc.
    Using Point grey stereo vision products under Linux
  • [2] Point grey research, Inc.
    Setting up 1394 devices using the Linux "udev" Device Manager
  • [3] Point grey research, Inc.
    64-bit Linux support for digiclops and triclops Libraries
  • [4] Point grey research, Inc.
    Source code examples of grabbing images under Linux
  • [5] www.fedoraproject.org
    Building a custom Kernel
  • [6] Point grey research, Inc.
    Triclops SDK
  • [7]
    Image Group at the Department of Computer Science, University of Copenhagen,
    How to work with the bumblebee2 stereo camera on Linux
  • [8] Point grey research, Inc.
    Technical Application note (tan2008005): Stereo Vision introduction and applications (PDF)

Author
    Yang Song 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.