I am new to the Parallel toolbox from Matlab R2012b and was wondering what the best way is to overcome the following problem.
I am analyzing the neighbourhood of every pixel in an image. Which is extremely good case for parallelization. However, I can't seem to get it working.
The main catch in the problem is that some "constant" arguments should be passed to the function. So the function should be called for every pixel, however, it also needs to access the surrounding pixels. (Preferable by passing the image as some sort of constant parameter and the coordinates of the pixel to be analyzed).
The output is one value per pixel.
At the moment I have this:
z2 = arrayfun(@(x) analyze(x, image, const1, ...), gpuArray(1:m*n));
Where x is the dummy-var, image a 2D matrix containing the luminance values of the image, const1 (and others) are function-constants (e.g. size of the analyze window). m and n are the size of the dimensions of the image.
However, I get this error
Error using gpuArray/arrayfun Use of functional workspace is not supported.
Any ideas?
Cheers, Ruben