From: Lukáš Jiřiště Date: Mon, 29 Jul 2024 09:28:14 +0000 (+0200) Subject: Take a few lines outside of a loop X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=53699e09140bdf9fbd6dd9ff7d2c35387e30d173;p=Bubble_column.git Take a few lines outside of a loop Those lines were only executed during the first iteration so it was moved before the loop. --- diff --git a/Bubliny.m b/Bubliny.m index eb8b526..2e2e869 100755 --- a/Bubliny.m +++ b/Bubliny.m @@ -58,13 +58,19 @@ for iii=1:1:nSelectedDirectory % Cycles for directories with files Metr_fit_B = zeros(1,nFFiles); %% +% Load the dimensions from the 1st image (p&q in pxl) + ImageName = FFiles(1).name; + Figure = imread([FFiles(1).folder '/' ImageName]); + ContrastFigure = imadjust(Figure); % Adjust the contrast of the image using imadjust. + [MeterScale, polypar_Metr] = meter(SelectedDirectory{iii}, ContrastFigure, ResFile); + D_num=str2double(SelectedDirectory{iii}(21)); % position of camera % load of all files in cycles step=1; startFile= 40; %945; %200 (20. ) endFile= 110; %nFFiles; %1000; %325 (20.) nFFiles=endFile; % Attention!!! - for jjj=[1 startFile:step:nFFiles] % Cycles for figures files + for jjj=startFile:step:nFFiles % Cycles for figures files ImageName = FFiles(jjj).name; Figure = imread([FFiles(jjj).folder '/' ImageName]); [p,q]=size(Figure); @@ -94,13 +100,6 @@ for iii=1:1:nSelectedDirectory % Cycles for directories with files % imshow(ContrastFigure3) -%% -% Load the dimensions from the 1st image (p&q in pxl) - if jjj == 1 - [MeterScale, polypar_Metr] = meter(SelectedDirectory{iii}, ContrastFigure, ResFile); - D_num=str2double(SelectedDirectory{iii}(21)); % position of camera - end -%% % Figure with average intensity, without the bands with hole and meter figure imshow(ContrastFigure)