加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

基于Matlab的图像区域特征识别

(2011-05-20 15:53:16)
标签:

matlab

图像区域

特征识别

分类: 技术文章

lyqmath

http://blog.sina.com.cn/lyqmath

简介
图像特征识别是经常遇到的问题之一,这里介绍一种基于图像区域属性的方法。

实例
原图:

http://s6/middle/72586626ha3b0702dde95&690

% By lyqmath
% DLUT School of Mathematical Sciences 2008
% BLOG:http://blog.sina.com.cn/lyqmath
clc; clear all; close all;
img = imread('c:\\ce.jpg');
if ndims(img) == 3
    img1 = rgb2gray(img);
else
    img1 = img;
end
img1 = medfilt2(img1, [4, 4]);
bw = im2bw(img1, graythresh(img1));
bw = imclose(bw,strel('disk', 3));
bw = bwareaopen(bw, 500);
bw = imclearborder(bw);
bw = imclose(bw,strel('disk', 5));
L = bwlabel(bw);
stats = regionprops(L,'all');
imshow(bw);
hold on;
corn1 = stats(1).Extrema;
t1 = 2 : 2 : size(corn1, 1)
plot(corn1(t1, 1), corn1(t1, 2), 'r.', 'MarkerSize', 20);
corn2 = stats(2).Extrema;
t2 = 1 : 2 : size(corn2, 1)
plot(corn2(t2, 1), corn2(t2, 2), 'r.', 'MarkerSize', 20);
figure;
imshow(img); hold on;
plot(corn1(t1, 1), corn1(t1, 2), 'r.', 'MarkerSize', 20);
plot(corn2(t2, 1), corn2(t2, 2), 'r.', 'MarkerSize', 20);
plot(corn1(t1, 1), corn1(t1, 2), 'go', 'MarkerSize', 8);
plot(corn2(t2, 1), corn2(t2, 2), 'go', 'MarkerSize', 8);

结果

http://s14/middle/72586626ha3b098aa9f7d&690



总结
图像的阈值分割、区域属性特征信息,可以用来做特定的图像识别。

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有