Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

hi i have one query image and 20 dataset images and i want to find out the precision and recall graph but i am not getting the correct results pls help!!!

1 visualización (últimos 30 días)
clc
clear all
I=imread('1.jpg'); % to read the image
I_read=imresize(I,[256 256]);
% image resize
I=rgb2gray(I_); % rgb to gray conversion
%I=I_enlarge;
imshow(I);
Seq=cell(1,20);
for i=1:20
I=imread(sprintf('%d.jpg',i));
I=imresize(I,[256 256]);
I=rgb2gray(I);
Seq{i}=I;
end
for i = 1 : 20 % loop for calculating histogram intersections
A=Seq{i};
B=I;
a = size(A,2);
b = size(B,2);
K = zeros(a, b);
for j = 1:a
Va = repmat(A(:,j),1,b);
K(j,:) = 0.5*sum(Va + B - abs(Va - B));
end
end
num_images = 20;
sims=K
relevant_IDs = [1 2 3 4 5 6 7 8 9 10];
num_relevant_images = numel(relevant_IDs);
[sorted_sims, locs] = sort(sims, 'descend');
locations_final = arrayfun(@(x) find(locs == x, 1), relevant_IDs)
locations_sorted = sort(locations_final)
precision = (1:num_relevant_images) ./ locations_sorted;
recall = (1:num_relevant_images) / num_relevant_images;
disp(precision)
disp(recall)
plot(recall, precision, 'b.-');
xlabel('Recall');
ylabel('Precision');
title('Precision-Recall Graph - GEOGRAPHICAL IMAGE RETIREVAL');
axis([0 1 0 1.05]); %// Adjust axes for better viewing
grid;

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by