# Steve on Image Processing

## Cluster-based image display

Although this is the time of year that I normally mention some of the new features from the "a" release, today I thought I would focus on a feature added several releases ago that I think deserves more attention: parallel cluster-based image display. I can't remember exactly when this was released; I think it might have been R2011c.

Anyway, it turns out image display speed can be dramatically increased if we exploit the capabilities of today's massive parallel computing clusters. You start by opening a MATLAB pool from your desktop session using the Parallel Computing Toolbox function matlabpool. The Parallel Computing Toolbox has a new cluster profile that makes it easy to set things up for fast image display:

matlabpool image-display

Once the pool is configured, then the Image Processing Toolbox function imshow automatically uses the workers in the pool.

Let's try it with my blog author picture:

(I'm writing this blog post at home, so for a cluster I'll be using my home-brew video game console, which runs on a cluster of 128 TRS-80s.)

imshow

Here's what the display looks like on worker #37:

And here is the display on worker #92:

If you look carefully, you can see that the pixel block is not exactly the same size on the two workers. That's because of the automatic worker load balancing feature. Way cool!

Let's get down to some numbers. Specifically, I was interested to see how well image display performance scales with the number of workers. I used my function timeit to measure the display speed as I varied the number of workers. The plot below is "normalized speed-up." That is, 1 is the image display speed for normal MATLAB, with no use of the Parallel Computing Toolbox.

As you can see, we get almost perfectly linear scaling with the number of workers. (I'm not sure what's going on with that blip on the left. I think it might have been caused by a bad tape unit on worker #25.)

So, Parallel Computing Toolbox users, please give this a try and let us know about your experience!

Before I wrap it up for today, I can't resist giving a hint about future development directions. (Long-time readers know how much MathWorks loves to preannounce features.) We recently got our hands on one of the experimental new superfluidic clusters. Early indications are that we'll be able to get image display speed to scale with the square of the number of workers! Woo-hoo!

Get the MATLAB code

Published with MATLAB® R2013a

### 3 Responses to “Cluster-based image display”

1. Jiro Doke replied on :

Awesome, Steve! Thanks for this cool post! I tested it out, and I really like the load balancing feature. If you examine closely how the image is broken up, workers seem to balance based on the color variations. Places where the color variation is small (like the gray background), the workers get more pixels, while places with lots of color variations are broken up into smaller clusters of pixels.

Outstanding!

2. Cal replied on :

April Fools’! – very good :)

3. Dimitris replied on :

Hi Steve,

I just posted a reference to your joke here: http://www.mathworks.co.uk/matlabcentral/answers/71099-imshow-on-parallel-computing-toolbox as I am troubled on a related issue ;)

Steve Eddins is a software development manager in the MATLAB and image processing areas at MathWorks. Steve coauthored Digital Image Processing Using MATLAB. He writes here about image processing concepts, algorithm implementations, and MATLAB.

These postings are the author's and don't necessarily represent the opinions of MathWorks.