Display image inside parfor loop
조회 수: 2 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
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
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
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/
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!