フィルターのクリア

plz help me with this error "Matrix dimensions must agree."

1 回表示 (過去 30 日間)
Vignesh
Vignesh 2015 年 5 月 1 日
編集済み: Walter Roberson 2015 年 5 月 4 日
i1=imread('1.jpg');
i2=imread('3.jpg');
j1=rgb2gray(i1);
j2=rgb2gray(i2);
k=abs(j1-j2);
l=colfilt(k,[8 8],'sliding',@sum);
sad_result=imshow(l);
  2 件のコメント
Stephen23
Stephen23 2015 年 5 月 1 日
編集済み: Stephen23 2015 年 5 月 1 日
@Vignesh: there are lots of people here who are happy to volunteer their time to help you. But simply pasting some code is not enough for us to know what you are doing, or where this error is occuring. For a start, please paste the whole error message, not just this extract. And please format your code using the {} Code button above the textbox.
You need to give information, explain and show what is happening, otherwise it is very difficult for us to help you:
Vignesh
Vignesh 2015 年 5 月 1 日
編集済み: Vignesh 2015 年 5 月 1 日
sorry abt tat . lemme explain, my intention is to obtain sum of absolute difference between two images and to display the result, but i am facing some error for tat '-' operator .

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

採用された回答

Roger Stafford
Roger Stafford 2015 年 5 月 1 日
From your error message I would guess that the matrix created for i1 is of different size from that of i2, and consequently matlab complained at the line
k=abs(j1-j2);
since j1 and j2 would also be of different sizes. You can easily check this by displaying the respective sizes of i1 and i2 in your code.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by