winggundam
Would you like to react to this message? Create an account in a few clicks or log in to continue.

MATLAB實驗:圖像灰化翻轉放大

向下

MATLAB實驗:圖像灰化翻轉放大 Empty MATLAB實驗:圖像灰化翻轉放大

發表 由 lung 周一 10月 08, 2012 11:22 am

lung
lung
Admin

文章數 : 26067
注冊日期 : 2009-07-12

回頂端 向下

MATLAB實驗:圖像灰化翻轉放大 Empty 回復: MATLAB實驗:圖像灰化翻轉放大

發表 由 lung 周一 10月 08, 2012 11:23 am

%用處:選擇一幅彩色圖像,將其變作灰度圖,再做上下、左右顛倒,逆時針90°,順時針180°
figure(1);
RGB = imread('my.jpg','jpg');%此時 my.jgp文件在默認的路徑下,否則GRB=imread(‘路徑’);
subplot(3,2,1);
imshow(RGB);
title('彩色');

GRAY=rgb2gray(RGB);%彩色圖片變成灰色圖
subplot(3,2,2);
imshow(GRAY);
title('灰色');

[X]=GRAY;
Y=flipud(X);%矩陣上下翻轉
subplot(3,2,3);
imshow(Y);
title('上下翻轉');

[i]=GRAY;
j=fliplr(i);%矩陣左右翻轉
subplot(3,2,4);
imshow(j);
title('左右翻轉');

A = imrotate(GRAY,90,'bilinear');
subplot(3,2,5);
imshow(A);
title('逆時針90°');

B=imrotate(GRAY,180,'bilinear');
subplot(3,2,6);
imshow(B);
title('順時針180°');
lung
lung
Admin

文章數 : 26067
注冊日期 : 2009-07-12

回頂端 向下

回頂端


 
這個論壇的權限:
無法 在這個版面回復文章