Imshow on Parallel Computing Toolbox
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dimitris Vayenas
el 8 de Abr. de 2013
Comentada: Walter Roberson
el 13 de Feb. de 2020
I am converting my code to utilise the Parallel Computing Toolbox and I am getting a peculiar error in an imshow instruction:
Error using imshow (line 209) IMSHOW unable to display image.
Error in GPUDemo (line 9) parfor (HSize = 1:n);
Caused by: Error using imshow (line 209) IMSHOW unable to display image.
line 209 of Imshow is the error message:
if ~images.internal.isFigureAvailable() error(message('images:imshow:needJavaFigure')); end
The error appears only when I use the matlabpool.
Obviously I am using many pools in order to have each pool applying a different value for a parameter (eg. HSize or Sigma in an imfilter) to the image
So I cant quite get the Aprils fool joke here: http://blogs.mathworks.com/steve/?s_cid=global_nav :(
Thank you.
0 comentarios
Respuesta aceptada
Walter Roberson
el 8 de Abr. de 2013
It is not possible to display graphics from inside a worker. The joke was in saying that it was possible.
Note the reference to the non-existent R2011c, and to running on TRS-80's.
5 comentarios
Walter Roberson
el 9 de Abr. de 2013
As far as I have determined, the protocol used between the parent and the workers is a message-passing protocol that (for whatever reasons) has not been designed to handle graphics messages. It appears that except for spmd, the protocols might possibly have been designed to send in the data and only listen for the result message -- though perhaps that approach would be too simplistic to account for distributed arrays.
Each worker is a separate process that does not have access to the graphics (which is in the memory space of the parent process... which might not even be on the same computer.)
I do agree that it would seem plausible to be able to handle graphics through a message passing protocol (e.g., X Windows is designed that way.) I do not know why that was not used.
rgb2gray() is, at heart, a fairly simply matrix multiplication; it should not be difficult to write a replacement for it that would execute on GPU, except possibly over the issue of single precision vs double precision.
Más respuestas (3)
Daniel Golden
el 29 de Abr. de 2014
I'm running R2014a and the image and imagesc functions do work within parfor loops, although the imshow function does not. If you substitute image for imshow, follow it with this command to get similar results:
axis image off
However, the pixels shown on the screen won't be 1:1 like they are by default with the imshow command.
0 comentarios
Dimitris Vayenas
el 29 de Abr. de 2014
Editada: Dimitris Vayenas
el 29 de Abr. de 2014
0 comentarios
kinjal shah
el 6 de Mzo. de 2015
what is about the imshow error? what is solution?
2 comentarios
shital shinde
el 13 de Feb. de 2020
Editada: shital shinde
el 13 de Feb. de 2020
anybody please tell me how to convert matlab code into many core and multi core. I attached the file for image watermarking. but i want to perform parallelization on it. please help me for code.
Ver también
Categorías
Más información sobre Asynchronous Parallel Programming en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!