Display image inside parfor loop

2 ビュー (過去 30 日間)
Nima Mojtahedi
Nima Mojtahedi 2014 年 8 月 5 日
回答済み: Edric Ellis 2014 年 8 月 6 日
Dear Experts I am doing Parallel computation in matlab and I use simple parfor but inside of parfor I need to use imshow function. But matlab stopped by Error using imshow (line 208) IMSHOW unable to display image. I searched for solution and just I found batch work. Actually I couldn't used batch inside parfor. I put my code here and I appreciate if somebody can help me.
parfor i=5:nuframe
ts=read(video,i);
org_img=ts(:,:,1);
hisq_img=histeq(org_img);
imshow(hisq_img);
end

採用された回答

Ben11
Ben11 2014 年 8 月 5 日
I'm afraid you can't control image display inside a parfor loop, i.e. inside individual workers. However you can store all the images in a temporary array/cell array/whatever and wait until the parfor loop terminates before displaying them.
  2 件のコメント
Nima Mojtahedi
Nima Mojtahedi 2014 年 8 月 5 日
The problem is that this is good idea for small size of data, when I use long video actually this is not possible. Any solution for huge amount of data?
Best, Nima
Ben11
Ben11 2014 年 8 月 5 日
Mhh maybe allow some case inside the parfor loop in which you exit the loop to display some frames and then come back inside the loop? This is just an idea though I don't know if it's possible.

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

その他の回答 (1 件)

Edric Ellis
Edric Ellis 2014 年 8 月 6 日
One option is to use PARFEVAL and display the images back at the host when they're ready. Here's an example: http://blogs.mathworks.com/loren/2013/12/09/getting-data-from-a-web-api-in-parallel/

カテゴリ

Help Center および File ExchangeParallel for-Loops (parfor) についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by