Display same image with different rotations

1 回表示 (過去 30 日間)
Idris Shareef
Idris Shareef 2021 年 3 月 7 日
編集済み: Jorg Woehl 2021 年 3 月 8 日
I want to display the same image 16 times with 4 different rotations (0,90,180,270 degrees), each for 1 secs with a gap of 0.5 secs in between. How can I do it ?

回答 (1 件)

Jorg Woehl
Jorg Woehl 2021 年 3 月 8 日
編集済み: Jorg Woehl 2021 年 3 月 8 日
I assume you are talking about 2D images:
% prepare an image but hide it initially (for better timing)
h = imagesc(peaks, 'Visible', 'off')
daspect([1,1,1]) % display image without distortion
axis off % don't draw axes
for alpha = 0:90:1350 % this produces a total of 16 images
% display the image view for one second
view(alpha,90)
h.Visible = 'on'
pause(1)
% hide the image for half a second
h.Visible = 'off'
pause(0.5)
end

カテゴリ

Help Center および File ExchangeImage display and manipulation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by