How to speedup image processing by parallel computing or multicore computing?

1 回表示 (過去 30 日間)
Arunas
Arunas 2012 年 8 月 30 日
編集済み: Vishal_R 2014 年 6 月 16 日
I have designed image processing systems, which takes the image, preprocess it and do data mining with classification three. The result (class number) of captured image is further transmitted by COM1 port.
Currently I can run 1 frame analysis per 0.1s. Unfortunately my Matlab uses only 1 CPU core of 8 available. Therefore current application is TOO slow for online usage.
How I could use the matlab’s multicore ability from main matlab window? With matlabpool(4), I could speed up calculations up to 4 times, i.e.
1. getting image snapshot.
2. sending to first available LAB.
3. Without sequential waiting of the result TAKE next snapshot -> send to second available LAB/worker. and so on..
4. Collecting classification results asynchronously and sending them to COM port.
So … How to do it? Any ideas?
Regards, Arunas
  2 件のコメント
Dan Hickstein
Dan Hickstein 2013 年 10 月 7 日
This is exactly what I would like to do. Not quite sure how to do it though...
Ashish Uthama
Ashish Uthama 2013 年 10 月 7 日
Most compute intensive parts of MATLAB are multi-threaded (i.e should use all the 8 cores). It might be worthwhile to use the profiler to identify bottlenecks and follow up on them to speed it up.

サインインしてコメントする。

回答 (1 件)

Vishal_R
Vishal_R 2014 年 6 月 16 日
編集済み: Vishal_R 2014 年 6 月 16 日
You can process your image in parallel using blockproc function.
blockproc(x, {32 32},"Use Parallel", true, func);
where x is your image matrix, {32 32} is the block size (you can increase the block size for better results), func can be any customized function you want to apply on your block.
Use parallel will spawn default numbers of workers. Another alternative would be to use this function on GPU for faster results as compared to CPU.
-Vishal

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by