matlab - my svr-model doesn't work for another data -
i have written program estimate image quality assessment. in code @ first extract features image , later sent them target value svm-train make model regression. after making model call image database , extract it's feature , send svm-predict value. code work database , has little error dosen't work image out of database , image me baias value. problem code?
feature extraction:
function f=feature_extraction (im) addpath(genpath('.\features')); tic if size(im,3)==3 im=rgb2gray(im); end f1=dog_features(im); f2=entropy_features(im); f3=gradient_features(im); f4=phasecong_features(im); f=[f1 f2 f3 f4]; toc (svr-mode:) cost =16384 ; gamma = 2; c_str = sprintf('%f',cost); g_str = sprintf('%.2f',gamma); libsvm_options = ['-s 3 -t 2 -g ',g_str,' -c ',c_str]; model = svmtrain(target,f,libsvm_options);
after make model, read image this:
im = imread('image.bmp'); f = feature_extraction(im); quality = svmpredict(ones(1,1),f,model);
Comments
Post a Comment