how to name the retrived images as the folder names

조회 수: 1 (최근 30일)
new_user
new_user 2022년 1월 1일
편집: new_user 2022년 1월 1일
image = imread('001.jpg');
[Label] = classify(net, image);
%Equation 2
query = feature; % transposing
transpose = transpose(1-query);
%Equation 3
Array = zeros(NumClasses,NumTrain);
distance = sqrt(sum((feature' - train_feature') .^ 2)); % other method eucledian: giving all images from same category maybe something is wrong
for e = 1 : NumTrain
f = transpose.*distance(:,e);
Array(:, e) = f;
end
Array = sqrt(sum(Array))';
% Fetch top images
sorting = sort(Array);
[~, n] = sort(Array);
numRetrival = 5;
n = n(1:numRetrival);
files = cell(1, numRetrival);
for h =1:numRetrival
files{h} = Train.Files{n(h)};
end
%query image
figure;
imshow(Read_file);
label = Predicted_Label_query
title( "query: " + string(label));
% retrived images
figure;
imshow(files);
title( "retrieved: " + string(label));
I can display the label of query image but how to display all the labels of retrived images?

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022년 1월 1일
편집: Sulaymon Eshkabilov 2022년 1월 1일
If understood your query correctly, you want to display the label variable in the title of a plotted data:
title(["retrieved: + " label{:}]);
%% OR just to display label 1 :
title(["retrieved: + " label{1}]);
  댓글 수: 1
new_user
new_user 2022년 1월 1일
편집: new_user 2022년 1월 1일
no, I classified the query image and displayed it but I don't know how to classify the retrieved images and show the retrievd image labels.
as for 1 query image there can be multiple similar retrieved images and I waant to know and display each of their labels. Like the image attached. I have the label for wuery image but for retrieved image I want to have label for each image to be displayed (So, I first need to know the labels of the retrieved images and then display the labels). I used a for loop to decide how many labels I want to retrieve:
Fetch top images
sorting = sort(Array);
[~, n] = sort(Array);
numRetrival = 5;
n = n(1:numRetrival);
files = cell(1, numRetrival);
for h =1:numRetrival
files{h} = Train.Files{n(h)};
end

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by