
Axes上に表示した画像を傾けたい
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
koji fukumoto
el 5 de Dic. de 2019
Respondida: Akira Agata
el 6 de Dic. de 2019
お世話になります。
Axes上に、imread関数で読み込んだpng画像をimage関数を用いて表示しています。
この画像を任意の角度傾ける方法が分かりません。

リファレンスを見る限り、imrotateを使うと出来そうな気がしますが、Toolboxを使わずに実装したいです。
rotate関数では思ったように傾けることができませんでした(軸に沿って回転してしまう)。
0 comentarios
Respuesta aceptada
Akira Agata
el 6 de Dic. de 2019
axesオブジェクトで、図の真上方向を示す CameraUpVector プロパティを回転させるのはいかがでしょうか?
ちなみに、2次元表示での CameraUpVector プロパティのデフォルト値は [0 1 0] ですが、imshowで画像を表示した場合はデフォルト値が [0 -1 0] になっていますのでご注意ください。
% Load image
I = imread('peppers.png');
% Show the image
figure
imshow(I)
% Set rotation angle
rotDeg = 20; % [deg]
rotRad = deg2rad(rotDeg); % [rad]
% Change CameraUpVector
ax = gca;
ax.CameraUpVector = [-1*sin(rotRad), -1*cos(rotRad), 0];

0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre イメージ算術 en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!