how to find center of mass in each grid based on foreground pixels

1 visualización (últimos 30 días)
Raghu Rao
Raghu Rao el 19 de Mzo. de 2017
Comentada: Raghu Rao el 20 de Mzo. de 2017
i have an binary image B of size 100x100 and i divided into equal segments
where
clc;
clear all;
close all;
a = imread('i2eee.jpg');
figure;imshow(a);
% Normalizatoin
b = imresize(a,[100,100]);
figure;imshow(b);
% Binarization
th = graythresh(b);
figure;imshow(th);
a = im2bw(b,th);
figure,imshow(a);
s=0;
x=1;z=1;
w = 10;
h = 10;
c=100/w;
r=100/h;
a(r:c:end,:,:) = 0;
a(:,r:c:end,:) = 0;
figure;
imshow(a);

Respuestas (1)

Image Analyst
Image Analyst el 19 de Mzo. de 2017
Use regionprops(). See my full Image Segmentation Tutorial in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by