From c02789c3194059233b275a2de76c33f5456f0a11 Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Thu, 14 May 2015 19:18:53 +0800 Subject: imgeq --- genFeatureVec.m | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'genFeatureVec.m') 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 -- cgit v1.2.3-70-g09d2