Matlab code to select some images from numbers of images and assign them as training set
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Jakob B. Nielsen
el 10 de Dic. de 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 comentario
Abdulmu'min Musa
el 11 de Dic. de 2019
Editada: Abdulmu'min Musa
el 11 de Dic. de 2019
Ver también
Categorías
Más información sobre Get Started with Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!