centroid of an image

Please, I need help with Matlab code to center the upper half of a silhouette image with respect to its horizontal centroid(ie find the centroid of an image ), after which my output will still be in an image format. Thanks in anticipation.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 26 de Mzo. de 2011

0 votos

Threshold the image into black and white, and then call regionprops on the black and white image to get the centroid property.
Note: if the black part is your information and the white part is background, then call regionprops on the logical negation of your black and white image,
regionprops(~BW,'centroid') %or something similar

Más respuestas (0)

Etiquetas

Preguntada:

el 26 de Mzo. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by