how to get the value of accuracy for each type of distortion and the accuracy value for all?

3 visualizzazioni (ultimi 30 giorni)
what to change in this coding to get the accuracy for each type of distortion and accuracy value for all? can see the coding attach. thank you
load('dmos.mat');
FYPdatabase=cell(numel(dmos),4);
FYPdatabase(:,2)=num2cell(dmos);
feat=zeros(982,40);
for k=1:982
A=FYPdatabase{k,1};
featim=gmlog(A);
FYPdatabase{k,5}=featim;
feat(k,:)=featim
end
addpath('C:\Users\User\Desktop\LIVE database\databaserelease2\jp2k');
for i=1:227
A=imread(sprintf('img%d.bmp',i));
A1=rgb2gray(A);
A2=double(A1);
FYPdatabase{i,1}=A2;
FYPdatabase{i,3}=1;
end
addpath('C:\Users\User\Desktop\LIVE database\databaserelease2\jpeg');
for i=1:233
A=imread(sprintf('img%d.bmp',i));
A1=rgb2gray(A);
A2=double(A1);
FYPdatabase{227+i,1}=A2;
FYPdatabase{227+i,3}=2;
end
addpath('C:\Users\User\Desktop\LIVE database\databaserelease2\wn');
for i=1:174
A=imread(sprintf('img%d.bmp',i));
A1=rgb2gray(A);
A2=double(A1);
FYPdatabase{460+i,1}=A2;
FYPdatabase{460+i,3}=3;
end
addpath('C:\Users\User\Desktop\LIVE database\databaserelease2\gblur');
for i=1:174
A=imread(sprintf('img%d.bmp',i));
A1=rgb2gray(A);
A2=double(A1);
FYPdatabase{634+i,1}=A2;
FYPdatabase{634+i,3}=4;
end
addpath('C:\Users\User\Desktop\LIVE database\databaserelease2\fastfading');
for i=1:174
A=imread(sprintf('img%d.bmp',i));
A1=rgb2gray(A);
A2=double(A1);
FYPdatabase{808+i,1}=A2;
FYPdatabase{808+i,3}=5;
end
this is the coding for FYPdatabase (2).mat. i cannot attach the mat file because the size is bigger than 5MB

Risposte (1)

William Rose
William Rose il 31 Dic 2023
Modificato: William Rose il 1 Gen 2024
[edit: remove redundant text from my answer]
I understand you are using a support vector machine (SVM) to classify images from the Laboratory for Image & Video Engineering (LIVE) dataset. I understand that you are computing the gradient magnitude of the Laplacian of Gaussian (gmlog) for each image.
Your question included embedded code, and your question includes an attached script. Expalin clearly how these are related, so others can assist you.
The embedded code reads a total of 982 images, from 5 directories. Each image is converted to mono and is converted to type doubel, and saved in a cell array. The gradient magnitude of the Laplacian of Gaussian (gmlog) is computed for each image, and saved. The images seem to belong to five categories. I suspect the SVM is supposed to classify these images into their respective 5 classes.
The attached script, mtlv4211123.m, uses fitcecoc() to construct a classifier, "model1", using the training images. The script computes 6 measures of median accuracy and 6 measures of mean accuracy, with lines such as
median_accuracy_ALL=median(ACC_ALL)
median_accuracy_JPEG=median(ACC_JPEG)
mean_accuracy_all=mean(ACC_ALL)
mean_accuracy_JPEG=mean(ACC_JPEG)
However, I do not see any lines where ACC_ALL and ACC_JPEG have values assigned to them, except when they are initialized to zero. Is this the problem?
I suspect you are more likely to get the assistance you seek if you follow the suggesitons here: https://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
Neither the embedded code nor the attached script are runnable by others. (If your question is "Why doesn't my code run?", then post the unrunnable code. But if your code does run for you, and I think yours does, then post a version that others can run, so they can help you. This may require work on your part, which you should do, since you are asking others to help you.) Your code is unrunnable by others because 1. there are numberous "addpath" commands that are unique to your environment; 2. the scripts read data files that are not attached; 3. the scripts call gmlog(), and maybe other functions, that are not regular Matlab functions. Attach gmlog() and any other required non-standard functions.
If data files are too big to attach, make smaller files that illustrate the problem.

Categorie

Scopri di più su Convert Image Type in Help Center e File Exchange

Prodotti


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by