labeling a montage image using folder's name

2 次查看(过去 30 天)
i created an imageDataStore with folder's name as label source then i retrieved the best match image for an image that i chose . i want to know how can i write ,in the title, the name of the folder from where the best match image was retrieved.i hope u get the idea and thanks for the help.
the code : digitDatasetPath = fullfile('c:','users','isbinfos','Desktop','camera'); imds = imageDatastore(digitDatasetPath, ... 'IncludeSubfolders',true,'LabelSource','foldernames');
imageIndex = indexImages(imds); queryDir = fullfile('c:','users','isbinfos','Desktop','test',filesep); queryImage = imread([queryDir 'poischiche.jpg']); imageIDs = retrieveImages(queryImage,imageIndex); bestMatch = imageIDs(1); bestImage = imread(imageIndex.ImageLocation{bestMatch});
figure imshowpair(queryImage,bestImage,'montage')

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by