フィルターのクリア

crop multiple objects from binary image

2 ビュー (過去 30 日間)
Gytis Raudonius
Gytis Raudonius 2015 年 11 月 3 日
hi, everyone how can i crop multiple objects and show it's from my code
warning off img = imread('6.jpg');
img = rgb2gray(img); imshow(img);
level = graythresh(img); BW = im2bw(img,level); figure, imshow(BW);
BW1 = imclearborder(BW); figure, imshow(BW1);
CC = bwconncomp(BW1, 8); S = regionprops(CC, 'Area'); L = labelmatrix(CC); P = 1500; BW2 = ismember(L, find([S.Area] >= P)); figure, imshow(BW2);
st = regionprops(BW2, 'BoundingBox' ); L = labelmatrix(CC); for k = 1 : length(st) thisBB = st(k).BoundingBox; rectangle('Position', [thisBB(1),thisBB(2),thisBB(3),thisBB(4)],... 'EdgeColor','r','LineWidth',2 ) end

回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by