Hello,
I trying to to rotate an image in a GUI based on a transient input. Think of a Steering Wheel which should rotate in realtime (based on given input values). I have a solution but it takes up to 200 ms which is a bit slow. (Aiming for less to get it smoother) I am displaying the image with:
global Im_Theta Imshow(IMAGE, 'Parent', handles.ax_Image);
The Rotation is done by calling my rotation function:
function [Im_Rotated, Alpha_Rotated]=Im_rotate(Image, Alphamap, delta_theta)global Im_ThetaIm_Theta=delta_theta+Im_Theta;T = [cos(Im_Theta) -sin(Im_Theta) 0; sin(Im_Theta) cos(Im_Theta) 0; 0 0 1];form = maketform('affine', T);Image_Alpha = cat(3,Image, Alphamap);Image_Alpha = imtransform(Image_Alpha, tform);Im_Rotated = Image_Alpha(:,:,1:3);Alpha_Rotated = Image_Alpha(:,:,4);
And then reploting the Image
h_Imshow=Imshow(Im_Rotated, 'Parent', handles.ax_Image);set(h_Imshow, 'AlphaData', Alpha_Rotated);
The Problem is I dont need the rotated images' Information. All I need is the "spinning" Image on the GUI. I tried rotate and view but it doesn't seem to work with images.
Additional Infos:
– NO Image Processing Toolbox available
– It's a PNG Image with Alpha
– Using delta Theta and Theta to avoid fragments due to multiple rotations
– Summing up the Image with its Alpha in one matrix before imtransform helps to reduce by 50 ms.
Thanks in advance
Best Answer