drawnow() causing very slow display of images
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Karl
am 18 Feb. 2014
Kommentiert: Yu Liu
am 13 Mai 2020
Hi all,
I've read several other questions on this but didn't find a satisfactory answer. My apologies however, if this is already up.
I am building a GUI to display processed video. I do this using
imshow(image,'Parent',axes)
then
drawnow
for each frame in a loop. It is VERY slow. Approx 0.5 seconds per frame (~12 seconds to display 1 second of video in real time). It also accounts for half my total processing time per frame.
Can I make it faster?
Any help is greatly appreciated!!
Cheers, KB
1 Kommentar
Akzeptierte Antwort
Image Analyst
am 18 Feb. 2014
I solved that problem with older versions of MATLAB by putting in a "cla" or "cla('reset')" into the code just before the imshow. Evidently with older versions sometimes the images "stack up" and are all in there and you're just piling one on top of another and it gets slower and slower as it runs out of memory. Try that and let me know if it speeds it up.
7 Kommentare
Weitere Antworten (1)
David Sanchez
am 18 Feb. 2014
I solved a similar issue by adding a very short pause, this will clean up the buffer and speed up the pseudo-video. Add:
pause(0.001)
right after drawnow
Siehe auch
Kategorien
Mehr zu Image Preview and Device Configuration finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!