Borrar filtros
Borrar filtros

The relative vertical position of the smallest connected black component

2 visualizaciones (últimos 30 días)
Hi guys.... I want your help in MATLAB to find the vertical position of the smallest connected black component.

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 12 de Mayo de 2011
CC = bwconncomp(~BW);
[junk, idx] = min(cellfun(@numel,CC.PixelIdxList))
[r c] = ind2sub(size(BW),CC.PixelIdxList{idx});
%How do you want to define vertical position? Middle, top bottom
mean(r); %middle by weight
min(r); %top point
max(r); %bottom point

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by