Borrar filtros
Borrar filtros

crop multiple objects from binary image

2 visualizaciones (últimos 30 días)
Gytis Raudonius
Gytis Raudonius el 3 de Nov. de 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

Respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by