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;

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Google Earth 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by