diagonal pixel differences of image matrix
古いコメントを表示
is there any method to get the diagonal pixel differences(left right diagonal) of a image matrix.for example , i have to obtain [-8 -2 -4;4 2 -16;0 2 4] from [2 1 8 24;9 10 3 12;2 5 8 19;1 2 3 4]
採用された回答
その他の回答 (1 件)
Teja Muppirala
2013 年 9 月 17 日
b = [2 1 8 24;9 10 3 12;2 5 8 19;1 2 3 4];
conv2(b,[-1 0; 0 1],'valid')
2 件のコメント
Andrei Bobrov
2013 年 9 月 17 日
Hi Teja! +1. I again forgotten about conv.
Teja Muppirala
2013 年 9 月 17 日
Hello Andrei! conv is simpler, but your solution is definitely more creative and interesting.
カテゴリ
ヘルプ センター および File Exchange で Operating on Diagonal Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!