matlab用来度量图像区域属性的函数——regionprops

在此用regionprops实现了二值图像划region,找质心

clc; clear all; close all;
I=imread('1.jpg');
I1 = im2bw(I);
figure; imshow(I, []);
figure; imshow(I1, []);
L = bwlabel(I1);
stats = regionprops(L, 'all');
 hold on;
for i = 1 : length(stats)
    temp = stats(i).Centroid;
    plot(temp(1), temp(2), 'r.');
end


  from:http://blog.csdn.net/abcjennifer/article/details/6672189

posted @ 2012-08-15 22:23  小鸡蛋的理想  阅读(837)  评论(0)    收藏  举报