フィルターのクリア

Error with permute function : which order to use??

7 ビュー (過去 30 日間)
Aude Rapet
Aude Rapet 2016 年 11 月 8 日
コメント済み: Aude Rapet 2016 年 11 月 8 日
Hi,
I am using a code written by someone else, and I think he used an older version of Matlab than mine. Anyway, when I try to run the code, I have : "Error using ' Transpose on ND array is not defined. Use PERMUTE instead."
So then I tried to change those lines:
gconv = conv2(image_array',gaussian_kernel','same');
gconv = conv2(gconv',gaussian_kernel'),'same');
into (with permute) :
gconv = conv2(permute(image_array,[2 1]),permute(gaussian_kernel,[2 1]),'same');
gconv = conv2(permute(gconv,[2 1]),permute(gaussian_kernel,[2 1]),'same');
But I have this error message :
Error using permute
ORDER must have at least N elements for an N-D array.
Error in bpass (line 125)
gconv = conv2(permute(image_array,[2 1]),permute(gaussian_kernel,[2 1]),'same');
I read in the documentation that Given any matrix A, the statement " permute(A,[2 1]) " is the same as A.'.
But it is not working in my case...what should I change?
Thank you very much for your help!!

採用された回答

Walter Roberson
Walter Roberson 2016 年 11 月 8 日
You are working with an RGB array and trying to treat it as if it is a grayscale array.
permute(image_array, [2 1 3])
  1 件のコメント
Aude Rapet
Aude Rapet 2016 年 11 月 8 日
Thank you very much Walter!!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by