Matlab code to select some images from numbers of images and assign them as training set
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have an image database which consist of 40 folders and in each folder, there are 6 images of individuals. The total images are now 240 images. Now in each folder, i want to select two images, i.e image no 3 and no 4 and assign them as testing set while the remaining four will be assign as training set. This should happen for all the images in the folders in the database at once. How do i do the matlab coding. I need help.
0 commentaires
Réponses (1)
Jakob B. Nielsen
le 10 Déc 2019
First, you want to name your folders in a consistent manner so you can easily make matlab count it. Then something like:
foldername='C:\Databasefolder\Folder1'
for i=1:40
%Put your code to assign images from Folder1 here
foldername=strrep(foldername,strcat('Folder',num2str(i)),strcat('Folder',num2str(i+1)));
%That bit will change the foldername to Folder2, and the next time, to Folder3.
end
1 commentaire
Abdulmu'min Musa
le 11 Déc 2019
Modifié(e) : Abdulmu'min Musa
le 11 Déc 2019
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!