OpenCV and New Control System

I’ve been fascinated with OpenCV vision processing recently and I was wondering how I could implement it on the '09 control system. It looks as though it can’t be run on the VxWorks OS or on the hardware on the cRIO. Am I correct in stating this? Do you have any suggestions for how I could implement OpenCV or computer vision processing in general on the new control system?

Thanks,
Matt

I don’t claim to be an expert at OpenCV, but from what I understand, there are two parts of OpenCV. The video and image capture/import/export part, and the image processing part. While I doubt that the capture/import part of OpenCV is going to work on the cRio out of the box, I bet the image processing part will work quite well, provided you can compile it. Compiling it could be a challenge, especially resolving dependency problems. OpenCV is definitely a neat tool though.

Trying to port OpenCV to VxWorks/cRIO will lead to massive headaches on the trying to read and reprogram x86 assembly level (try just looking at the source code). OpenCV was designed for x86-based systems and is highly optimized for those architectures. (There was an effort to port it to ARM systems a couple years ago but it was only ever a partial job. I don’t know of any other ports that exist.) When you got done, you might have something that works but it would be a mess and would probably not give you the kind of performance you would want, unless you beat out all my assumptions and are proficient in high performance coding for both x86 and cRIO. I don’t mean to discourage you if you really want to try it, but you’re probably ahead to use the image processing framework included with LabVIEW. Trust me… LabVIEW really isn’t just the “easy way out” for programming.

If you want to use OpenCV on a robot (it can be really powerful), consider using a co-processor. I experimented with this configuration during the 2008 competition and got a quite robust system for recognizing trackballs. I’ve been meaning to post a whitepaper on it for a while. I’ll try to get it posted in the next week or so. Included will be info on my hardware set-up if you’re curious.

–Ryan

P.S.: AustinSchuh: You are correct that there are multiple sections in OpenCV: CV, CXCORE, HighGUI, and CVCam are the official ones that I know of. CV contains high-level image processing and filtering functions (Hough Transforms, Edge Detection, etc). CXCORE contains basic image/array/matrix manipulation functions (like add, dot product, scale, etc). HighGUI does what it sounds like and provides an easy to use way to display images and graphs and such but also contains a rudimentary camera interface. CVCam is a more full-featured camera interface module, but may be overkill for most projects. All, however, are written to be optimized for x86 and would be a pain to cross-compile properly.

Thanks for all the help (and the headaches you saved me)! I was afraid that it would come down to a co-processor or using the LabView libraries. I remember checking out your 'bot at the Seattle Regional and the eePC you guys were using with a usb webcam. Very impressive. Anyways, I would love to know how you guys pulled that off.

Thanks!
-Matt

OpenCV is great fun and one of the earliest community vision processing toolkits. However Intel started OpenCV with x86 and there has not been very many ports to VxWorks/PowerPC architecture.

But luckily there are many other libraries out there that can work for the 09 Control System.

*The Labview Image Processing Toolkit - probably going to be the easiest to use

Slight correction: It appears as if a couple of third party companies have ported OpenCV to the Cell processor for use on a PlayStation3 (not much use for FIRST, I think) and to the PlayStation Portable. I would love to see someone use the PSP on a FIRST robot, but the final version of the x86 coprocessor we put together was under two pounds and was several times as powerful as the PSP. And then you’d have issues conforming to the rules; the battery would need to be removed, etc. Either of these might be really interesting for off-season or personal projects though. 27x performance on the PS3 port supposedly. :yikes:

Whitepaper coming soon…

–Ryan

Just an update for those affected parties:

The white paper is still coming but it has to fit around my classes, which have taken an upturn around midterms. I’m also trying to make it as complete a guide as possible, which means there’s a decent bit of content to generate, but hopefully this will mean that the end product is more helpful.

It will be out as soon possible.

Apologies for the delay.

Just as a side note there is an entire book written on OpenCV by Oreilly publishing.

Thanks, Ryan, for taking the time to put together a whitepaper. I’m sure it will be amazing.

I picked up a copy of the O’Reilly book the other day. It’s very good, if anyone is interested in learning about how to use the OpenCV library.

This would appear to only support Intel hardware solutions. The cRIO is an ARM i do believe, thus the two would be incompatible.

correct me if I’m wrong.

The cRio has a powerPC and does not have an Intel module. Therefore the standard OpenCV will not work. There are ports available to powerpc but they might not be customized for vxworks,

https://launchpad.net/ubuntu/intrepid/powerpc/python-opencv

but am i correct in saying that the intel package that was put forward would not work on the cRIO because it would be incompatible with the powerpc?

anybody want to work on finding / making a stable port of openCV to the cRIO?