Reputation: 110
I have an rgb matrix rgb = imread('Map.jpg');
I'm changing its pixel colors in a while
loop. Is it possible to see the changes real-time?
I'm tested this script, but not working!
rgb = imread('Map.jpg');
figure
image(rgb);
axis image;
while (conditions)
pause(0.001)
% Change rgb matrix
drawnow
end
Upvotes: 0
Views: 62
Reputation: 173
The image command places an image on the figure from the rgb matrix. If you change the matrix after using the image command the figure will not change. Try calling image(rgb)
after you change the matrix but before the drawnow
command
Upvotes: 1