how to name the retrived images as the folder names
1 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
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}]);
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!