From: Anders Karlsson on
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <i3ori2$jvg$1(a)fred.mathworks.com>...
> Dear Anders,
>
> > 1) Collect an image from a camera.
> > 2) Do some image processing.
> > 3) Plot the results.
> >
> > Step (2) and (3) are quite slow compared to step (1) and it would be preferable to execute all these steps in parallel. Step (1) is a call to a threaded mex-file and the rest i pure Matlab code.
>
> The fastest step (1) is a threaded mex. It would be more efficient, to use a threaded mex for the slowest step.
> But if Matlab is very practical for the image processing, it would be worth to post your code and hope, that CSSMers have some ideas for accelerations. A lot of Matlab functions are parallelized already, but there might be manual improvements also.
>
> Kind regards, Jan
Thanks for you reply,

The reason that the first step i the fastest is because its written i C++. The first step involves taking a picture, rectification and calculation of a disparity image. It would most certainly be the slowest step if it was written in Matlab.

Matlab is indeed very practical for the remaining processing and rewriting the code in another language would involve quite some work. Unfortunately, I cannot publish the code, maybe just some parts.

Is there no way for Matlab to execute these three parts in parallel? Like running three independent scripts at the same time.

/Anders
From: Jan Simon on
Dear Anders,

of course, you can run 3 instances of Matlab. Then you need a robust interprocess communication, which is not easy in Matlab. But you cannot run different threads in one Matlab session.

Kind regards, Jan