フィルターのクリア

How to shuffle an image diagonally?

1 回表示 (過去 30 日間)
Sneha P S
Sneha P S 2018 年 4 月 11 日
回答済み: Jan 2018 年 4 月 11 日
I need to shuffle an image of size 256x256x3 along diagonally. That is the pixel value of upper left corner must come at the lower right corner and all the pixels at the corresponding position in the other half. Please help me with that code

採用された回答

Guillaume
Guillaume 2018 年 4 月 11 日
Sounds like a 180 rotation, so:
rot90(yourimage, 2)

その他の回答 (1 件)

Jan
Jan 2018 年 4 月 11 日
This can be either a rotation or a mirroring. A rotation works either by rot90 (see Guillaume's answer), or by:
s = size(img)
img2 = img(s(1):-1:1, s(2):-1:1, :);
The mirroring needs just an additional transposition of the first two dimensions:
img2 = permute(img(s(1):-1:1, s(2):-1:1, :), [2,1,3]);

カテゴリ

Help Center および File ExchangeImages についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by