What the problem with this code of cropping image ?
2 ビュー (過去 30 日間)
古いコメントを表示
Hi all
I have apply this code to crop my images in any sizes
B = imread('bar5.jpg');
B = imresize(B,0.33);
B2 = im2bw(B1);
stat = regionprops(I,'area');
C(1:length(stat)) = stat(1:end).Area;
m = max(C);
J = bwareaopen(I,m);
imshow(J);
and I got this message
??? Undefined function or variable 'I'.
so any ideas
sorry I'm new in matlab
I want learning
Thanks
0 件のコメント
採用された回答
その他の回答 (2 件)
Image Analyst
2012 年 7 月 27 日
You can do this:
stat = regionprops(B2,'area');
allAreas = [stat.Area];
maxAreas = max(allAreas);
You didn't do any cropping (perhaps you meant "size filtering" instead). You just took your image and threw away all the objects smaller than the largest object by using bwareaopen(). In other words, you threw EVERYTHING away.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!