【发布时间】:2020-07-03 17:31:29
【问题描述】:
I = imread("C:/Users/Hp/Desktop/download.jpg");
J = imrotate(I,90,nearest);
image(J);
这是我用来旋转图像的代码。该代码没有给出任何错误,但它没有显示旋转的图像。 帮助将不胜感激
【问题讨论】:
I = imread("C:/Users/Hp/Desktop/download.jpg");
J = imrotate(I,90,nearest);
image(J);
这是我用来旋转图像的代码。该代码没有给出任何错误,但它没有显示旋转的图像。 帮助将不胜感激
【问题讨论】:
你有一个错误。试试:
J = imrotate( I, 90, 'nearest' );
而不是
J = imrotate( I, 90, nearest );
第一个使用字符串 'nearest' 作为选项。后者期望nearest 是一个现有变量。
更新:
这是一个完整的示例(图片来自网络)。
pkg load image
I = imread('https://i.imgur.com/I7GUK.jpg');
J = imrotate( I, -90, 'nearest' );
subplot( 1, 2, 1 ); image( I ); axis square off;
subplot( 1, 2, 2 ); image( J ); axis square off;
【讨论】:
image 函数将矩阵显示为图像。 (这是你要问的吗?)