资源简介
HoG SVm 人脸识别方法, 做人脸识别的同学,可以研究一下
代码片段和文件信息
function [ped] = classify_region(row col size img)
%UNtitleD2 Summary of this function goes here
% Detailed explanation goes here
%disp(‘Classifying region... r c s‘);
region = zeros(14);
ped_ratio = 0.5;
h = size;
w = h*ped_ratio;
file = fopen(‘classifiers/svm_classifier.txt‘ ‘r‘);
ped = 0;
res = 0;
neg = 0;
region(11) = str2double(fscanf(file‘%s‘ 1));
while (~feof(file) && neg==0)
region(12) = str2double(fscanf(file‘%s‘ 1));
region(13) = str2double(fscanf(file‘%s‘ 1));
region(14) = str2double(fscanf(file‘%s‘ 1));
SVM_name = fscanf(file ‘%s‘ 1);
a = str2double(fscanf(file ‘%s‘ 1));
structSVM = load (SVM_name);
%DESNORMALIZE BLOCK in relation to REGION
region(11)=region(11)*h;
region(12)=region(12)*w;
region(13)=region(13)*w;
if(size>128)
region(13) = ceil(region(13));
if(mod(region(13)2) ~= 0)
region(13) = region(13)-1;
end
region(12) = floor(region(12));
region(11) = floor(region(11));
elseif(size<128)
region(13) = ceil(region(13));
if(mod(region(13)2) ~= 0)
region(13) = region(13)-1;
end
region(12) = ceil(region(12));
region(11) = ceil(region(11));
end
% Feature block coordinates: r c s.
r = (row-1)+region(11);
c = (col-1)+region(12);
s1 = region(13);
s2 = region(13)*region(14);
%Select only the image region / block we want to evaluate --> (r1:r2 c1:c2)
I = img((r:(r+s1-1)) (c:(round(c+s2-1))));
plot=0;
if(plot)
imshow(img);
rectangle(‘Position‘[col row size*ped_ratio size] ‘LineWidth‘ 1 ‘EdgeColor‘ ‘b‘);
rectangle(‘Position‘ [c r s2 s1] ‘LineWidth‘ 1 ‘EdgeColor‘ ‘r‘);
pause()
imshow(I)
pause()
end
switch (region(14))
case 1
HOG = extractHOGFeatures(I ‘CellSize‘ [floor(length(I)/2) floor(length(I)/2)]);
case 0.5
HOG = extractHOGFeatures(I ‘CellSize‘ [floor(length(I)/2) floor(length(I)/4)]);
case 2
HOG = extractHOGFeatures(I ‘CellSize‘ [floor(length(I)/4) floor(length(I)/2)]);
otherwise
disp(‘WRONG ASPECT RATIO!‘)
end
%HOG = extractHOGFeatures(I ‘CellSize‘ [round(length(I)/2) round(length(I)/2)]); % 36-D vector
%HOG = extractHOGFeatures(I ‘NumBins‘ 6 ‘BlockSIze‘ [3 3] ‘CellSize‘ [floor(length(I)/3) floor(length(I)/3)]
weak_res = (svmclassify (structSVM.weak_svm HOG))*a;
res = res + weak_res;
aux = str2double(fscanf(file ‘%s‘ 1));
if(aux==999999)
%disp(‘END OF STAGE‘);
t =
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-06-10 09:16 hogsvm-master\
目录 0 2014-06-10 09:16 hogsvm-master\HOG+TREE\
目录 0 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\
文件 1116 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\svm_classifier.txt
文件 2548 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\training_results.txt
文件 758449 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\weak_tree_11.mat
文件 760158 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\weak_tree_12.mat
文件 758437 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\weak_tree_21.mat
文件 767419 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\weak_tree_22.mat
文件 764484 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\weak_tree_31.mat
文件 794183 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\weak_tree_32.mat
文件 775521 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\weak_tree_41.mat
文件 790006 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\weak_tree_42.mat
文件 786421 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\weak_tree_51.mat
文件 802000 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\weak_tree_52.mat
文件 778448 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\weak_tree_61.mat
文件 768193 2014-06-10 09:16 hogsvm-master\HOG+TREE\classifiers\weak_tree_62.mat
文件 3414 2014-06-10 09:16 hogsvm-master\HOG+TREE\classify_region.m
文件 823 2014-06-10 09:16 hogsvm-master\HOG+TREE\count_blocks.m
文件 4375 2014-06-10 09:16 hogsvm-master\HOG+TREE\feature_extraction.m
文件 3244 2014-06-10 09:16 hogsvm-master\HOG+TREE\learning.m
文件 7567 2014-06-10 09:16 hogsvm-master\HOG+TREE\prepare_samples.m
文件 1600 2014-06-10 09:16 hogsvm-master\HOG+TREE\runtime.m
文件 2998 2014-06-10 09:16 hogsvm-master\HOG+TREE\sample_negatives.m
文件 4063 2014-06-10 09:16 hogsvm-master\HOG+TREE\select_tree.m
文件 1189 2014-06-10 09:16 hogsvm-master\HOG+TREE\test.m
文件 1612 2014-06-10 09:16 hogsvm-master\HOG+TREE\test_neg.m
文件 1193 2014-06-10 09:16 hogsvm-master\HOG+TREE\test_pos.m
文件 917 2014-06-10 09:16 hogsvm-master\HOG+TREE\testing.m
文件 4798 2014-06-10 09:16 hogsvm-master\HOG+TREE\train_cascade_ilevel.m
文件 3402 2014-06-10 09:16 hogsvm-master\classify_region.m
............此处省略9个文件信息
- 上一篇:BP神经网络PID S函数
- 下一篇:介绍两种汽车纵向动力学整车模型
相关资源
- matlab仿真的载波同步算法-Fitz算法
- 超宽带TOA定位卡尔曼滤波定位算法m
- WCDMA系统中随机接入(PRACH)过程的仿
- matlab图像识别农作物病虫害
- wind_pmsg
- SOH的关于IMU算法的源代码和测试工程
- matlab实现的综合评价的熵权法
- matlab基于混沌映射对图像加密和解密
- cec2013基准测试函数 matlab源程序
- 载波恢复与符号定时的仿真 (carrie
- 等距映射(ISOMAP)算法的matlab实现
- 利用压缩感知的关联成像程序,计算
- matlab计算复杂网络中节点的紧密中心
- matlab仿真的图像序列的柱面全景拼接
- 欧拉运动放大视频和代码
- matlab神经网络43个案例分析的代码及数
- matlab混凝土(Concrete )骨料(Bone )随
- Direct-driven-PMSG
- 稀疏恢复算法 focuss
- 蒙特卡洛模拟光子在组织中的运动m
- ERADistNataf MATLAB
- bp神经网络的adp小程序
- 主动声纳
- Particle Swarm Optimization(PSO) Algorithm
- MATLAB绘制伯德图
- 椭圆拟合matlab
- knn算法matlab实现
- 基本蛙跳程序 matlab
- 用matlab编写的BP神经网络用于预测房价
- 针对三维点云的Mean Shift聚类算法(
评论
共有 条评论