am getting a error "Error using == Matrix dimensions must agree."
古いコメントを表示
am not sure why am getting this error, is it bec i have to use strcat? if yes how to?
img =imread('image1.jpg');
bw= imbinarize(img, 0.5);
label= logical(bw);
stats = regionprops(label,'Solidity','Area');
denisty = [stats.Solidity];
area = [stats.Area];
high_dense_area= denisty > 0.5;
max_area = max(area(high_dense_area));
tumor_label = find(area == max_area);
tumor = ismember(label, tumor_label);
se = strel('square',5);
tumor = imdilate(tumor,se);
figure(2)
subplot(1,3,1)
imshow(img,[])
title('brain')
subplot(1,3,2)
imshow(tumor ,[])
title('tum alone')
[B,L]= bwboundaries( tumor ,'noholes')
subplot(1,3,3)
imshow(img,[])
hold on
for i =1: lenght(B)
plot(B{i}(:,2), B{i}(:,1), 'y','linewidth',1.45)
end
tittle('detected tumor')
hold off
1 件のコメント
Jan
2019 年 3 月 4 日
Please post a copy of the complete error message, such that the readers do not have to guess, in which line the problem occurs.
回答 (1 件)
Jan
2019 年 3 月 4 日
If this is the failing line:
tumor_label = find(area == max_area);
check the sizes:
size(area)
size(max_area)
What do you observe?
カテゴリ
ヘルプ センター および File Exchange で Solver Outputs and Iterative Display についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!