Monday, September 7, 2009

Mightex USB Camera

Just thought I'd share my experiences with the Mightex Systems USB camera that I'm using for my project. There's not a lot of info available on these, at least not the last time I did search. The device I'm using is an 8 bit buffered USB 2.0 camera listed here on Mightex's webiste: http://www.mightexsystems.com/family_info.php?cPath=1_16&categories_id=16

So far their support has been pretty good, every query I've made has been replied to within a day at most and the developers always seem keen help. Unfortunately while I was able to get the Windows drivers and applications to work straight up, the Linux drivers needed some modifications to compile. Luckily the source code was included so I was able to do the modifications and provide the developers with my .diff file.

The issue with the drivers is that they were originally written for and tested with Fedora Core 5, which is based on an earlier version of the 2.6 kernel than the Ubuntu 9.04 I'm using now. The Video4Linux library has since undergone some changes but the driver was not updated to follow suit. This unfortunately leads to compilation errors as the Mightex driver tries to reference some deprecated functions. Luckily the changes were relatively minor as the functions still exist, they've just been moved to different locations and so the new relevant header files have to be included. If you're really interested let me know and I can provide the .diff file to patch your driver.

After fixing that up I was able to compile the included application to test the camera. Quality is pretty good, and I'm getting a steady 25 fps at 1280 x 1024 resolution. Right now I'm trying to get it working with my OpenCV program so stay tuned for more info.

Friday, July 10, 2009

OpenCV on Gumstix Overo

I managed to get OpenCV working properly on the Overo so for those that are interested here's how I did it.

After bitbaking the most recent build of omap3-destkop-image I downloaded the project files from here:

git clone git://github.com/pixhawk/pixhawk-oe.git pixhawk.collection

as listed on this page:

http://www.pixhawk.ethz.ch/wiki/tutorials/omap/openembedded_bitbake_installation


I used these files because they contain a convenient recipe for opencv which I know works. I had some trouble with the recipes included with OE but that might have been due to my limited understading of OE and bitbake.

The recipe requires libdc1394 and ffmpeg to be bitbaked first as well, and possibly some others I can't quite remember.

After the bitbake finished, I installed the libdc1394, ffmpeg, and OpenCV packages on the Gumstix. These packages also depend on others, if you have a net connection they'll download automatically, otherwise you may need to bitbake them in your build environment and install them manually.

Since I've decided to do native compiling on the Overo I also installed the GCC and G++ compilers and libraries, as well as pkgconfig. This allows me to simply compile my programs on the Overo without having to worry about cross compiling.

Finally here's a video of my simple hough-circle detector. I used a Logitech Quickcam Pro 9000. As you can see frame rate is really low, around 1fps. Even after removing the code for object detection, leaving only the video streaming and display I was only able to improve this marginally. I'm not sure how this compares to the Overo Water, so if anyone has any experience please let me know.


Tuesday, June 23, 2009

OE and bitbake failures

A little update to my previous post on OE. I decided to do a clean reinstall of Ubuntu 9.04 on a VM for testing and I ran into a couple of errors with a recent git pull of the Overo OE tree.

The first failure was related to a changed URL for the DirectFB 1.2.8 recipe. Sometime in the last month the URL changed from http://directfb.org/downloads/Core/DirectFB-1.2.8.tar.gz to http://directfb.org/downloads/Core/DirectFB-1.2/DirectFB-1.2.8.tar.gz. This was easily fixed by changing the corresponding recipe file to reflect the new location, however, I also had to change the URL in the /overo-oe/org.openembedded.dev/conf/checksums.ini file so that the MD5 checksum can be verified.

The second failure was due to a commit which changed the desktop image dependency to gconf instead of gconf-dbus. Somehow this cause neither of these recipes to be built, and so image building failed. My fix was to just build these 2 recipes manually before trying to build the desktop image again, I don't think I needed both but I did it just to be on the safe side.

Anyway after all this I've found the most recent commits have fixed these errrors but now require a rebuild of the images, as noted by this post: http://www.nabble.com/Heads-up-on-disruptive-OE-commit-td24122398.html. OE is in constant development so it's a good idea to check the mailing list archives or even the git repository itself for updates if an image or recipe fails.

Wednesday, June 17, 2009

Gumstix and OpenEmbedded

Even before I bought my Gumstix I have been playing around with the build environment. Originally I started with Ubuntu 8.04 in VMWare virtual machine on a Windows Vista host. Running on this VM I had the emulator QEMU (http://www.nongnu.org/qemu/about.html) running the X11 image for the Verdex Pro. Having an emulated system running inside a VM was terribly slow but this was more of a proof of concept test before I went ahead and ordered a Gumstix.

I have since moved away from VM's to a dedicated development machine connected to my home network. It's an old single core Athlon 64 3000 something + but compilation speed is faster than in my dual core VM's. Having a dedicated machine means I don't have to worry about opening a virtual machine everytime I want to do something, or worry about synchronising virtual machines between my laptop and desktop. As long as I have internet access and an SSH client, I can log into my development machine from anywhere in the world.

I'm currently running my build environment on Ubuntu 9.04. Previously I had issues with bitbake referencing a different vesion of Python than that installed with the OS, but this has been fixed recently. I've used a combination of the instructions listed in these pages to setup OE:

http://www.gumstix.net/Software/view/Software-Overo/Setting-up-a-build-environment/111.html

http://www.pixhawk.ethz.ch/wiki/tutorials/omap/openembedded_bitbake_installation

The Pixhawk page in particular has a nice tutorial on setting up OE, just copy and paste the commands on the page and you're pretty much set.

So far I've tried bitbaking omap3-console-image and omap3-desktop-image, which worked fine. I have also tried bitbake world but I haven't had a lot of luck getting it to finish. It seems there are quite a number of issues with some of the recipes, anything from simple typos to dependencies on renamed or abandoned recipes. I don't actually need all of the packages so I haven't been bothered to explore it further.

So far so good with the Gumstix. Next step will be to recompile the Mightex camera drivers for the Gumstix architecture and test their performance.

Friday, June 12, 2009

Windows 7

I decided to test the new Windows 7 RC the other day to see how it stacks up against Vista. Vista always performed well for me on this machine and so far I haven't found a huge difference in performance. It does seem to be more responsive when opening applications but then Vista was no slouch either.


Firstly my hardware specs:


AMD Athlon 64 X2 4600+
4GB DDR2 800 SDRAM
Gigabyte GA-M52S-S3P Motherboard
Nvidia 9600GT video card
2 x 80 GB, 1 x 320GB, 1 x 640GB hard drives
Leadtek DTV1000T PCI TV tuner card
Netgear WG311V3 Wireless PCI card
Logitech USB Wireless Keyboard and Mouse
22" Asus VW224 and 17" Benq FP71G+S monitors
HP Laserjet 4000TN network printer


The installation managed to find drivers for all of these through Windows Update, although I encountered some minor issues. Nividia has updated drivers on its site and I installed these over the ones supplied through Windows Update.

The Netgear card refuses to work, and from the brief googling that I've done it seems to be a common problem with the 7100 build. This particular card gave me grief with both XP and Vista so this is no surprise. Hopefully this will be fixed with some updated drivers in the final release. I replaced the card with a Netcomm NP545 USB dongle which was detected instantly and had no issues with the included Windows drivers. As the computer uses Ethernet to connect to my router having no wifi was not a big issue for me, but it's useful to have for when I occasionally setup an ad-hoc network.

The HP printer was correctly detected but I'm not able to print multiple pages per sheet like I did with Vista. Whenever I choose this setting, they just come out blank. Considering I'm using the same version of Foxit reader, this seems like a problem with included HP printer driver. Again I'm hoping this willl be fixed with updated drivers.

The biggest surprise is that my TV tuner card works perfectly with Media Centre, which I find better to use than the Winfast PVR software I was using in Vista.

The software I've installed is below, none had any major issues installing but I'm yet to do much functionality testing.

Matlab 2007b - needed Vista compatability mode and install as admin
Foxit 3.0 Build 1506
CutePDF
Acronis TrueImage Home 11
Whisper32
Avast
Daemon Tools Lite 4.30.4
DVD Decrypter
DVD Shrink
EndNote X2
ImgBurn
Eaton/Powerware LanSafe 6
Logitech Setpoint 4.72.40
Maxthon 2.5.1.4751
Mihov Image Resizer
Spybot 1.62
SSH Secure Shell
TortoiseSVN
VMWare Workstation 6.52 - NAT doesn't work, changed to bridge mode networking
Winamp
WinRAR
RipIt4Me
LTSpice
Utorrent
Microsoft Office 2007

Things I like:
Taskbar buttons can now be moved around on the taskbar.
Homegroup looks promising but I have no other Win 7 computers to test.
Initial install is great, specially using Windows Update straight up to search for drivers.

So far I'm pretty happy overall and I'll definitely be switching when it's finally released.

Wednesday, June 3, 2009

Gumstix adventures

I've been a little busy with uni and life in general but finally have time to do some blogging, even if it is 2am.

I'm currently doing a thesis project involving image processing for a UAV to compete in the 2009 UAV Outback Challenge (see http://www.uavoutbackchallenge.com.au/uavoutbackchallenge/ for more info). Since the image processing is to be done on board the UAV, I needed something light but with enough processing power to run OpenCV. I ended up settling on a Gumstix Overo Earth (http://www.gumstix.com/).
It's based on a TI OMAP3 processor (ARM Cortex A8 architecture) and according to this Wikipedia article: http://en.wikipedia.org/wiki/Million_instructions_per_second#Million_instructions_per_second has just under the processing power of a PIII. Although I haven't yet tested my program on the Gumstix, others have used OpenCV succesfully on it so it should be sufficient for my needs.

Firstly a couple of pictures showing size compared to my Nokia 6300 phone.







The picture above also shows the camera I'm using, it's a 1.3 MP Monochrome USB camera from Mightex Systems, the details of which I'll leave for another post.

I haven't done much development on the Gumstix yet, mainly just hooking up some peripherals and playing around with the GUI. The pictures above show the connectors on the Summit expansion board: Power, USB OTG, Audio in/out, HDMI, USB host, USB serial console.

Connecting peripherals requires a USB mini-A cable, which isn't all that easy to find locally. Luckily there's a couple of options. The OTG port behaviour is determined by the grounding of the 4th pin: if grounded then the port acts as a host, if floating then it acts as a device. Since the OTG port accepts both mini-A and mini-B connectors, a mini-B connector can be modified by soldering a bridge between pin 4 and pin 5, preferably on the cable side. Although this involves hacking up a mini-B cable, it's a perfectly workable solution which I can confirm works.

I ended up purchasing a standard A female to mini-A male adaptor from Ebay as this was a much neater solution for connecting up my powered USB Hub (an $8 Ritmo job from MSY). So far the Gumstix has been able to detect all the peripherals I've connected to it. It's not a huge list by far but it's great to be able to connect something up and know it works.

So far I've tested: a Netcomm NP545 Wireless USB Adapter; a Swann Ethernet USB Adapter; a Logitech Quickcam Pro 9000 Camera; a Logitech USB wireless keyboard/mouse. I've also managed to hook it up through HDMI to my computer monitor. Below are some pics of the Gumstix default window manager (whose name escapes me right now). I even managed to get ekiga running with my camera:




Stay tuned for my experiences with OpenEmbedded and OpenCV.

Saturday, May 16, 2009

First post

So I got bored and decided to start a blog. Really I should be doing uni work but I'm pretty much over it right now. I plan to document my experiences with UAV's, OpenCV, and Gumstix, but I'll probably fill it with random crap initially.