diff options
author | Joe Zhao <ztuowen@gmail.com> | 2015-05-14 19:18:53 +0800 |
---|---|---|
committer | Joe Zhao <ztuowen@gmail.com> | 2015-05-14 19:18:53 +0800 |
commit | c02789c3194059233b275a2de76c33f5456f0a11 (patch) | |
tree | 6cbc98296f26332be55139f2cffd8ad99022c6a5 /genFeatureVec.m | |
parent | d0a72f92977baebaed915fbb2d14f2d5ddec8306 (diff) | |
download | featext-c02789c3194059233b275a2de76c33f5456f0a11.tar.gz featext-c02789c3194059233b275a2de76c33f5456f0a11.tar.bz2 featext-c02789c3194059233b275a2de76c33f5456f0a11.zip |
imgeq
Diffstat (limited to 'genFeatureVec.m')
-rw-r--r-- | genFeatureVec.m | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/genFeatureVec.m b/genFeatureVec.m index 4ac8ec8..7690f25 100644 --- a/genFeatureVec.m +++ b/genFeatureVec.m @@ -7,6 +7,9 @@ function vec = genFeatureVec(img) cnls(:,:,4:6) = rgb2ycbcr(img); hsv = rgb2hsv(img); cnls(:,:,7:8) = hsv(:,:,1:2); + for i=1:ncnls + cnls(:,:,i) = imgeq(cnls(:,:,i)); + end % Schmid scVec=[ 1,2; @@ -38,8 +41,8 @@ function vec = genFeatureVec(img) for cnl = 1:ncnls for sec = 1:secs filt = schmidFilter(scVec(i,1),scVec(i,2)); - pos = real(sum(sum(filt.*(filt>0)))); - neg = real(sum(sum(filt.*(filt<0)))); + pos = sum(sum(filt.*(filt>0))); + neg = sum(sum(filt.*(filt<0))); ss = (pos-neg)/bins; section = getSection(cnls(:,:,cnl),sec,secs); v = histcounts(imfilter(section, filt, 'symmetric'),(0:bins)*ss+neg); @@ -51,11 +54,11 @@ function vec = genFeatureVec(img) for cnl = 1:ncnls for sec = 1:secs filt = gaborFilter(gbVec(i,1),gbVec(i,2),gbVec(i,3),gbVec(i,4)); - pos = real(sum(sum(filt.*(filt>0)))); - neg = real(sum(sum(filt.*(filt<0)))); + pos = sum(sum(filt.*(filt>0))); + neg = sum(sum(filt.*(filt<0))); ss = (pos-neg)/bins; section = getSection(cnls(:,:,cnl),sec,secs); - v = histcounts(real(imfilter(section, filt, 'symmetric')),(0:bins)*ss+neg); + v = histcounts(imfilter(section, filt, 'symmetric'),(0:bins)*ss+neg); vec=cat(2,vec,v); end end |