Prev: General MATLAB text (was Re: 11 New MATLAB and Simulink Based Books)
Next: Restructuring cell arrays with cellfun
From: Anders Karlsson on 9 Aug 2010 07:46 Hi! I have a program that basically does three things. 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. What I would like is that the camera continuously collects images, in step two the processing is done to the latest image and in step three the last result is plotted, in parallel. This code is currently running on a machine with eight cores and yields about 15 FPS with about 25 % CPU usage. Is there any way to separate the three steps and make them run in parallel to better utilize the available cores?
From: Jan Simon on 9 Aug 2010 08:16
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 |