Unable to perform assignment because the size of the left side is 56-by-37 and the size of the right side is 37-by-56. Error in myMeanShiftSegmentation (line 21) subsampled(:, :, i) = I1;

1 回表示 (過去 30 日間)
SC P
SC P 2018 年 12 月 5 日
編集済み: SC P 2018 年 12 月 5 日
getting above error when trying to run mean shift segmentation algorithm
original = imread(inpImg);
channelCount = size(original ,3);
num_rows_original = size(original, 1);
num_cols_original = size (original, 2);
subsampled = zeros(floor(num_cols_original/5)+1, floor(num_rows_original/5)+1, channelCount);
subsampled = uint8(subsampled);
for i = 1:channelCount
original1 = original(:, :, i);
original1 = double(original1);
gfilter = fspecial('gaussian', 5, 1);
I1 = conv2(original1, gfilter, 'same');
I1 = uint8(I1);
I1 = I1(1:5:end, 1:5:end);
subsampled(:, :, i) = I1;
end;

回答 (1 件)

madhan ravi
madhan ravi 2018 年 12 月 5 日
編集済み: madhan ravi 2018 年 12 月 5 日
Use a cell array to store the values :
P.S- I have no experience with mean shikft algorithm
subsampled=cell(1,n);
for i=1:n
subsampled{i}=I1;
end

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by