The current program I have set each and every image ROI which is very impratical.
How can I only setup once and apply to all other images?
imageFolder = dir('C:\Users\85042513\MATLAB\Projects\BAT CVE\Images\OK\*.jpg');for i=1:length(imageFolder) filename = strcat('C:\Users\85042513\MATLAB\Projects\BAT CVE\Images\OK\',imageFolder(i).name); originalImage = imread(filename); % REGION OF INTEREST
f = figure('Name','Image','NumberTitle','off'); imshow(originalImage); rect = getrect(f); % select roi with mouse
ori_roi = originalImage( rect(2) : (rect(2)+rect(4)) , rect(1) : (rect(1)+rect(3)) , : ); % store roi in matrix
end
Best Answer