Matlab code to select some images from numbers of images and assign them as training set
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Jakob B. Nielsen
am 10 Dez. 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 Kommentar
Abdulmu'min Musa
am 11 Dez. 2019
Bearbeitet: Abdulmu'min Musa
am 11 Dez. 2019
Siehe auch
Kategorien
Mehr zu Get Started with Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!