Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

how do I allow user to choose a folder to run the rest of the functions?

1 vue (au cours des 30 derniers jours)
Shu Yi Ho
Shu Yi Ho le 14 Août 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021
%% ACCESS ALL IMAGES IN THE FOLDER
imageFolder = dir('C:\Users\85042513\MATLAB\Projects\BAT CVE\Images\NG\*.jpg');
numfiles = length(imageFolder);
ori_roi = cell(numfiles, 1);
i = 1;
filename = strcat('C:\Users\85042513\MATLAB\Projects\BAT CVE\Images\NG\',imageFolder(i).name);
originalImage = imread(filename);
%% LOOP THROUGH ALL IMAGES IN THE FOLDER & RUN ALL THE 5 FUNCTIONS
for i=1:length(imageFolder)
tic
functionError = 0;
filename = strcat('C:\Users\85042513\MATLAB\Projects\BAT CVE\Images\NG\',imageFolder(i).name);
originalImage = imread(filename);
ori_roi{i} = originalImage( rect(2) : (rect(2)+rect(4)) , rect(1) : (rect(1)+rect(3)) , : );
fprintf("Image name: %s\n",imageFolder(i).name);
...

Réponses (1)

TADA
TADA le 14 Août 2019
  4 commentaires
TADA
TADA le 14 Août 2019
I want to select a folder instead of the images inside.
What exactly do you intend to do with the folder once it is selected?

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by