Color Names 特征提取并进行PCA降维 (Learning Color Names for Real-World Applications)
之前的一篇博客里介绍了CN特征的提取,在实际应用中,很多算法为了提高计算效率,都会将CN特征进行降维,比如
Danelljan M, Shahbaz Khan F, Felsberg M, et al. Adaptive color attributes for real-time visual
tracking[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2014: 1090-1097
即ColorTracking跟踪算法就采用了PCA降维,将CN特征降为了2维。
这里就在上一篇的基础上加上PCA降维的部分:
首先是改动一下im2c.m函数
im2c.m
function out=im2c(im,w2c,color)
% input im should be DOUBLE !
% color=0 is color names out
% color=-1 is colored image with color names out
% color=1-11 is prob of colorname=color out;
% order of color names: black , blue , brown , grey , green , orange , pink , purple , red , white , yellow
color_values = {
[0 0 0] , [0 0 1] , [.5 .4 .25] , [.5 .5 .5] , [0 1 0] , [1 .8 0] , [1 .5 1] , [1 0 1] , [1 0 0] , [