http://blog.sina.com.cn/s/blog_661159d50100lpi0.html,。有图像不显示的,请查看我的sina博客
How to adjust white-balance in BumbleBee 2
Those days, we have put our project under Linux. And then there comes out some problems through transplantation. This chapter I talk about those problems which brought by
Setting up BumbleBee2 under Linux
Before setting BumbleBee2 camera under Linux, we should make sure some preconditions. Bumblebee2 only works under 32-bit Linux system due to the 32-bit static library provided by Point Grey Research, Inc. There are the steps on setting BumbleBee2 under Linux.
First we create the 1394 devices, and install the modules.
# create the 1394 devices
mknod /dev/raw 1394 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
Note that the "modprobe" installs the kernel modules for those devices. And then we install library. Point Grey Research, Inc. provides the Triclops SDK, which is an area based correlation with SAD (Sum of Absolute Differences), to per form the image rectification and stereo processing. To install the library, first please down load the package: Triclops3.2.0.8 FC3.tgz, by registering on Point Grey Research, Inc’s website. Second, also need to download the package pgr-stereo-examples libdc-2.0.2.tar.gz. It contains some example programs and a static library libpgrlibdcstereo.a. Then:
~$ sudo tar zxvvf Triclops3.2.0.8.tgz –C/usr/local/include
~$ sudo mv /usr/local/include/Triclops3.2.0.8
/usr/local/include/triclops
~$ sudo tar zxvf pgr-stereo-examples-libdc-2.0.2.tar.gz –C /opt
~$ cd /opt/pgr-stereo-examples-libdc-2.0.2/pgrlibdcstereo
We should modify its makefile with our favorite editor (there I use the gedit ) as below:
Figure1 modify the include and lib file
Then compile the source codes:
/opt/pgr-stereo-examples-libdc-2.0.2/pgrlibdcstereo$ sudo make
/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 BumbleBee2 camera ready. If we want run test program, we should modify makefile in every examples like above. And it lists my test pictures below:
Figure 2 up-left is disparity image; up-right is right camera;
down-left is rectified image ; down-right is right camera
You will see those pictures much blue. It follows another problem—adjusting white balance.
Adjusting white balance
I tried to take some solutions to get away this problem, just like reading their codes, finding similar problems on their web, and trying email them. Sadly, this problem still worked on. Then Vladimir Tucakov (Director of sales & marketing) came to our institutes to give the introduction on their products, and I asked them that problem. There I settle a document.
Those solutions based on Windows XP. It contains some parameters that correlated white-balance. We can configure those parameters under Windows XP; it also works well under Linux. It is included in ‘ Control and Status Registers’, look at figure 4, in camera register manipulation, there we can input 80ch which is white-balance, put on ‘Get Register’, then get the value about color camera. We can check the WHITE_BALANCE on ‘point grey digital camera register reference.
pdf ’, there list the bit value about those field ( figure 5)
We get the fields which is On/Off and One Push through figure 3, then we get bit values that On/Off is [6], One Push is [5]. We get changed the value below ‘Value’ like 82 to 86. At last you turn ‘General Settings’, like figure 6, put on ‘Windows Memory’ in ‘Save Properties’, then choose ‘1’ and at last put on ‘save’. It means you just save what you have changed the settings, and it will follow this settings when the BumbleBee2 restart.
Figure 3 white-balance
Figure 4 Registers
Figure 5 Format for the bit value about those filed
Figure 6
Then I get the right pictures through this way, and the white-balance works well when I unlatch wire. And it lists my test pictures below:
Figure 7 left for left image, and right for right image