How to applying miror effect on only last row last column first row first column of image

1 回表示 (過去 30 日間)
bay rem
bay rem 2016 年 1 月 5 日
回答済み: Walter Roberson 2016 年 1 月 6 日
i have image m, and i want to apply a miror effect on only last row last column first row first column of the matrix of image thanks in advance
  1 件のコメント
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2016 年 1 月 6 日
follow two steps.. step one.. select the last row last column.. second step.. apply your concept

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 1 月 6 日
I am not sure what you mean by "mirror effect", but perhaps you mean
M = zeros(size(YourArray)+2, class(YourArray)); %one larger in each direction
M(2:end-1,2:end-1) = YourArray; %original goes in center
M(1,2:end-1) = YourArray(1,:); %copy of top row
M(end,2:end-1) = YourArray(end,:) %copy of bottom row
M(2:end-1,1) = YourArray(:,1); %copy of first column
M(2:end-1,end) = YourArray(:,end); %copy of last column
M(1,1) = YourArray(1,1); %fill in top left corner
M(1,end) = YourArray(1,end); %fill in top right corner
M(end,1) = YourArray(end,1); %fill in bottom left corner
M(end,end) = YourArray(end,end); %fill in bottom right corner
This could be coded more efficiently, but that can wait until you have figured out if this is even what you want.

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by