diff options
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 |