![]() |
在MATLAB中翻转和旋转彩色图像
如何在MATLAB中翻转彩色图像(RGB)? fliplr似乎在不丢失颜色内容的情况下不起作用,因为它仅处理2D。
同样, imrotate可以不旋转的彩色图像。 [B]回答:[/B] 函数[URL="http://www.mathworks.com/help/matlab/ref/flipdim.html"]flipdim[/URL]适用于ND矩阵,而函数[URL="http://www.mathworks.com/help/matlab/ref/flipud.html"]flipud[/URL]和[URL="http://www.mathworks.com/help/matlab/ref/fliplr.html"]fliplr[/URL]仅适用于二维矩阵: img = imread('peppers.png'); %# Load a sample image imgMirror = flipdim(img,2); %# Flips the columns, making a mirror image imgUpsideDown = flipdim(img,1); %# Flips the rows, making an upside-down image [B]注意:[/B]在最新版本的MATLAB(R2013b和更高版本)中,现在建议使用功能[URL="http://www.mathworks.com/help/matlab/ref/flip.html"]flip[/URL]而不是[URL="http://www.mathworks.com/help/matlab/ref/flipdim.html"]flipdim[/URL] 。 [url=https://stackoverflow.com/questions/4010113]更多&回答...[/url] |
所有时间均为北京时间。现在的时间是 23:35。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.