导航:首页 > 源码编译 > 特征提取算法matlab

特征提取算法matlab

发布时间:2022-08-04 10:49:29

Ⅰ matlab实现SIFT特征点检测及配准

sift是一种提取特征点的算法,可以用matlab编程实现,但没有现成的语句,得自己写程序。另外还有很多提取特征的算法,sift是其中比较好的一种。

Ⅱ 如何利用matlab实现特征提取

Ox=sum(x)/2;
Oy=sum(y)/2;
%求E1,E2的中心O(Ox,Oy)
I1=imcrop(OriImg,[Ox-0.9*d
Oy-0.5*d
1.8*d
2*d]);
%切割人脸
str=strcat('H:\CMU表情库\cohn-kanade\cohn-kanade\cohn-kanade\S010\001\Standard\',int2str(i),'.bmp');
eval('imwrite(I1,str);');
%执行字符串
每次循环读入img
%读入图像
%保存归一化后的人脸图像
close
all;
end

Ⅲ matlab 中有提取图像特征点的函数吗

本人恰巧正在做角点的提取与匹配,特征点有很多种,看是基于区域还是边缘,先是要检测特征点,这个主要是利用微分,然后再提取,貌似没有现成的函数,这个给你参考一下,效果还可以
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Harris提取算法
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc,clear all;
filename='camera2.bmp';
X= imread(filename); % 读取图像
Info=imfinfo(filename); %这个要习惯用
% f=rgb2gray(X);
f=X;

ori_im=double(f)/255; %unit8转化为64为双精度double64
fx = [-2 -1 0 1 2]; % x方向梯度算子(用于Harris角点提取算法)
Ix = filter2(fx,ori_im); % x方向滤波 善于使用filter
% fy = [5 8 5;0 0 0;-5 -8 -5]; % 高斯函数一阶微分,y方向(用于改进的Harris角点提取算法)
fy = [-2;-1;0;1;2]; % y方向梯度算子(用于Harris角点提取算法)
Iy = filter2(fy,ori_im); % y方向滤波
Ix2 = Ix.^2;
Iy2 = Iy.^2;
Ixy = Ix.*Iy;
clear Ix;
clear Iy; %消除变量哈

h= fspecial('gaussian',[10 10 ],2); % 产生7*7的高斯窗函数,sigma=2

Ix2 = filter2(h,Ix2);
Iy2 = filter2(h,Iy2);
Ixy = filter2(h,Ixy); %分别进行高斯滤波

height = size(ori_im,1);
width = size(ori_im,2);
result = zeros(height,width); % 纪录角点位置,角点处值为1 ,背景都是黑色的哈

R = zeros(height,width);

Rmax = 0; % 图像中最大的R值 以便设置门限
for i = 1:height
for j = 1:width
M = [Ix2(i,j) Ixy(i,j);Ixy(i,j) Iy2(i,j)]; %2*2的矩阵
R(i,j) = det(M)-0.06*(trace(M))^2; % 计算R ,求得RMAX,看来是整体求得的,角点响应函数
if R(i,j) > Rmax
Rmax = R(i,j);
end;
end;
end;

cnt = 0; %记录点数的
for i = 2:height-1
for j = 2:width-1 % 进行非极大抑制,窗口3*3
if R(i,j) > 0.01*Rmax && R(i,j) > R(i-1,j-1) && R(i,j) > R(i-1,j) && R(i,j) > R(i-1,j+1) && R(i,j) > R(i,j-1) && R(i,j) > R(i,j+1) && R(i,j) > R(i+1,j-1) && R(i,j) > R(i+1,j) && R(i,j) > R(i+1,j+1)
result(i,j) = 1;
cnt = cnt+1;
end;
end;
end;
%
% i=1;
% for j=1:height
% for k=1:width
% if result(j,k)==1;
% corners1(i,1)=j;
% corners1(i,2)=k;
% i=i+1;
% end;
% end;
% end;

[posc, posr] = find(result == 1);
cnt % 角点个数
imshow(ori_im*255) %和 X的效果是一样的
hold on;
plot(posr,posc,'g+');

Ⅳ matlab中使用快速pca提取特征

1、参数mA代表A的均值,也就是mean(A)

其实这个参数完全没必要,因为可以从参数A计算得到。

2、解释一下你问的两个语句的含义:

Z=(A-repmat(mA,m,1)); 作用是去除直流成分
T=Z*Z'; 计算协方差矩阵的转置

3、关于函数的调用:

MATLAB统计工具箱中有函数princomp,也是进行主成分分析的(2012b之后有函数pca),基本调用格式:

[pc,score]=princomp(x)

其中,输入参数x相当于你这个函数的A,输出参数score相当于你这里的pcaA,而pc大致相当于你这里的V(符号相反)。具体说明请参考函数的文档。

Ⅳ 如何用matlab实现指纹图像特征的提取

其实学数字图像处理,关键的不是源代码(和一般编程还是有区别的,这个是经验之谈,其实一般博导未必会编程,但是你和他说说你的方法,他一般都能切中要害),而是你能理解基于概念及适用场所。
基于颜色、纹理、形状都属于低层特征,这些你理解就够了,关键是对你的课题适合哪种方法来映射到高层语义上面,例如:识别物体轮廓,那可能形状就比较适合等。
我之所以写上面那段话,主要是我感觉你索取代码也不说明具体要求,也就是方向不明确。
如今颜色特征提取算法有很多,诸如颜色直方图、颜色矩、颜色集、颜色聚合向量、颜色相关图等,既然你没说,我就给个IEEE CSVT 2001的一篇关于颜色直方图法的论文(源码版权归作者所有):
function colorhist = colorhist(rgb)
% CBIR_colorhist() --- color histogram calculation
% input: MxNx3 image data, in RGB
% output: 1x256 colorhistogram == (HxSxV = 16x4x4)
% as the MPEG-7 generic color histogram descriptor
% [Ref] Manjunath, B.S.; Ohm, J.-R.; Vasudevan, V.V.; Yamada, A., "Color and texture descriptors"
% IEEE Trans. CSVT, Volume: 11 Issue: 6 , Page(s): 703 -715, June 2001 (section III.B)
% check input
if size(rgb,3)~=3
error('3 components is needed for histogram');
end
% globals
H_BITS = 4; S_BITS = 2; V_BITS = 2;
%rgb2hsv可用rgb2hsi代替,见你以前的提问。
hsv = uint8(255*rgb2hsv(rgb));

imgsize = size(hsv);
% get rid of irrelevant boundaries
i0=round(0.05*imgsize(1)); i1=round(0.95*imgsize(1));
j0=round(0.05*imgsize(2)); j1=round(0.95*imgsize(2));
hsv = hsv(i0:i1, j0:j1, :);

% histogram
for i = 1 : 2^H_BITS
for j = 1 : 2^S_BITS
for k = 1 : 2^V_BITS
colorhist(i,j,k) = sum(sum( ...
bitshift(hsv(:,:,1),-(8-H_BITS))==i-1 &...
bitshift(hsv(:,:,2),-(8-S_BITS))==j-1 &...
bitshift(hsv(:,:,3),-(8-V_BITS))==k-1 ));
end
end
end
colorhist = reshape(colorhist, 1, 2^(H_BITS+S_BITS+V_BITS));
% normalize
colorhist = colorhist/sum(colorhist);

%基于纹理特征提取灰度共生矩阵用于纹理判断
% Calculates cooccurrence matrix
% for a given direction and distance
%
% out = cooccurrence (input, dir, dist, symmetric);
%
% INPUT:
% input: input matrix of any size
%
% dir: direction of evaluation
% "dir" value Angle
% 0 0
% 1 -45
% 2 -90
% 3 -135
% 4 -180
% 5 +135
% 6 +90
% 7 +45
%
% dist: distance between pixels
%
% symmetric: 1 for symmetric version
% 0 for non-symmetric version
%
% eg: out = cooccurrence (input, 0, 1, 1);
% Author: Baran Aydogan (15.07.2006)
% RGI, Tampere University of Technology
% [email protected]

function out = cooccurrence (input, dir, dist, symmetric);

input = round(input);
[r c] = size(input);

min_intensity = min(min(input));
max_intensity = max(max(input));

out = zeros(max_intensity-min_intensity+1);
if (dir == 0)
dir_x = 0; dir_y = 1;
end

if (dir == 1)
dir_x = 1; dir_y = 1;
end

if (dir == 2)
dir_x = 1; dir_y = 0;
end

if (dir == 3)
dir_x = 1; dir_y = -1;
end

if (dir == 4)
dir_x = 0; dir_y = -1;
end

if (dir == 5)
dir_x = -1; dir_y = -1;
end

if (dir == 6)
dir_x = -1; dir_y = 0;
end

if (dir == 7)
dir_x = -1; dir_y = 1;
end

dir_x = dir_x*dist;
dir_y = dir_y*dist;

out_ind_x = 0;
out_ind_y = 0;

for intensity1 = min_intensity:max_intensity
out_ind_x = out_ind_x + 1;
out_ind_y = 0;

[ind_x1 ind_y1] = find (input == intensity1);
ind_x1 = ind_x1 + dir_x;
ind_y1 = ind_y1 + dir_y;

for intensity2 = min_intensity:max_intensity
out_ind_y = out_ind_y + 1;

[ind_x2 ind_y2] = find (input == intensity2);

count = 0;

for i = 1:size(ind_x1,1)
for j = 1:size(ind_x2,1)
if ( (ind_x1(i) == ind_x2(j)) && (ind_y1(i) == ind_y2(j)) )
count = count + 1;
end
end
end

out(out_ind_x, out_ind_y) = count;

end
end

if (symmetric)

if (dir < 4)
dir = dir + 4;
else
dir = mod(dir,4);
end
out = out + cooccurrence (input, dir, dist, 0);
end

Ⅵ matlab 特征点提取。

新建个ff.m文件:

%%MATLABR2013a
functionfeature=ff(im)
rot=@(t)[cos(t)-sin(t);sin(t)cos(t)];
im=~im2bw(im);
Size=size(im);
CC=bwconncomp(im);

feature=zeros(CC.NumObjects,1);
fori=1:CC.NumObjects
[x,y]=ind2sub(Size,CC.PixelIdxList{i});
t=fminsearch(@(t)Loss([xy],t),0);
[~,width]=Loss([xy],t);
feature(i)=width(1)/width(2);
end
feature=sort(feature,1,'descend');

function[Loss,width]=Loss(G,t)
R=rot(t);
G=G*R;
width=max(G,[],1)-min(G,[],1);
Loss=-width(1)/width(2);
end
end

主程序:

im=imread(图片名称);
feature=ff(im)

对于题目中的输入图片,得到的feature是:


分别对应四个区域的长宽比。

Ⅶ matlab图像提取特征算法

可以在网上下载bwconncomp这个函数,然后放到你的matlab7.0库函数目录就行了啊,就可以用这个函数了

Ⅷ 如何用matlab 处理图像提取特征值呢

,你可以参照一下图像增强的有关算法(Image Enhancement)

2.周长、面积、角度都需要你知道图像中所包含的几何形状,建议看一下Hough变换的原理

Ⅸ 有关matlab的图像特征提取问题

方程 take_character 输入为RBG三维数组图像,输出为像素统计character三维数组,首先读取图像数组width宽,height高。统计RGB各像素值到相应二维数组。灰度量化,对RGB每个像素值与256灰度比较,赋值灰度。character数组统计灰度值。返回结果。

阅读全文

与特征提取算法matlab相关的资料

热点内容
java按钮设置图片 浏览:864
php数字分页代码 浏览:791
旅游业程序员 浏览:395
区块链第三代加密数字资产 浏览:525
把播放清单放在云服务器上 浏览:869
phpppt下载 浏览:300
1929pdf 浏览:366
编译器是终端吗 浏览:525
pdf改b4 浏览:380
命令通道 浏览:702
pdf去 浏览:543
嵌入式编译器优化 浏览:127
不同品牌安卓一键换机用什么软件 浏览:957
二年下册运算法则 浏览:137
兰溪两级压缩空压机 浏览:137
网页如何取回服务器上的文件 浏览:96
linuxphp重启命令行 浏览:575
为什么我的所有app都登录不了 浏览:583
别样app海淘怎么样 浏览:513
联通app扣费是什么意思 浏览:403