Azzera filtri
Azzera filtri

crop multiple objects from binary image

2 visualizzazioni (ultimi 30 giorni)
Gytis Raudonius
Gytis Raudonius il 3 Nov 2015
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

Risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by