am getting a error "Error using == Matrix dimensions must agree."
Show older comments
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 Comment
Jan
on 4 Mar 2019
Please post a copy of the complete error message, such that the readers do not have to guess, in which line the problem occurs.
Answers (1)
Jan
on 4 Mar 2019
If this is the failing line:
tumor_label = find(area == max_area);
check the sizes:
size(area)
size(max_area)
What do you observe?
Categories
Find more on Solver Outputs and Iterative Display in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!