Subscripted assignment dimension mismatch

3 ビュー (過去 30 日間)
Manisha Jaiswal
Manisha Jaiswal 2018 年 4 月 14 日
コメント済み: Manisha Jaiswal 2018 年 4 月 15 日
N = 4;
tps=10;
status = [0 0 0 0 0 0 0 0 0 0 0];
img = zeros(540,960,N);
for i = 1:N
img_tmp = imread(f_list(i).name);
img(:,:,i) = img_tmp(:,:,1);
end
bck_img = (mean(img,3)); %average background template
%subplot(121);imagesc(bck_img)
%subplot(122);imagesc(img(:,:,1))
clear img;
pause(5)
%gaussian filter
hsize = 80;
sigma = 20;
gaus_filt = fspecial('gaussian',hsize , sigma);
%gaus_filt = fspecial('log',hsize , sigma);
%subplot(121); imagesc(gaus_filt)
%subplot(122); mesh(gaus_filt)
colormap(gray)
SE = strel('diamond', 0)
Here, I am getting the error as subscripted assignment dimension mismatch but I am unable to figure out where is the error.
  3 件のコメント
Manisha Jaiswal
Manisha Jaiswal 2018 年 4 月 15 日
編集済み: per isakson 2018 年 4 月 15 日
Thank you, for helping me out. I got an error in the below line,
img(:,:,i)=img_tmp(:,:,1).
Can you please help me in this.
per isakson
per isakson 2018 年 4 月 15 日

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

採用された回答

Walter Roberson
Walter Roberson 2018 年 4 月 15 日
Your images are not all the same size when they are read in. You will need to read into a temporary variable and then either crop or pad or imresize() to fit the expected space.
  1 件のコメント
Manisha Jaiswal
Manisha Jaiswal 2018 年 4 月 15 日
Thanks for the help.

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

その他の回答 (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