Wednesday, May 6, 2009

Multi-Core Image Processing

If you’re reading this on a newer PC chances are it has a multi-core processor. If you haven’t already done so, call up the Task Manager (Ctrl-Alt-Del, then select “Task Manager,”) and take a look at CPU Usage (Under the “Performance” tab.) This is where you can see how hard each of the cores is operating.

Now load up some image processing software, set it running on a batch of images, and watch what the cores are up to. Unless you’re running the latest release of Halcon, MIL or VisionPro, you’ll see that one core is working its little socks off while the others are standing around watching. In other words, you are not getting the performance you thought you would.

There’s a very interesting discussion of this problem, and more usefully, some ideas for dealing with it, in “
Four Keys to Successful Multicore Optimization,” by John Petry of Cognex, published on EvaluationEngineering.com, May 2009.

The core issue (sorry, couldn’t resist the pun,) is that while multithreading is the way to harness all that CPU power, many image processing tasks don’t lend themselves to be handled that way.
Think about it: you have to acquire, then pre-process, and only then can you apply some machine tools, (such as edge detection.)

John Petry suggests that there are ways to overcome the serial nature of machine vision work, and that multicores can even take out some of the timing variability. Of course, if you’re strictly a “smart camera” engineer this discussion doesn’t really apply. Then again, I’d like to think my ramblings here will encourage you to explore PC-based machine vision, so take five minutes to read the article.

No comments: