I'm writing an AppDesigner GUI that averages n images as they are captured from FLIR camera and saves only the averaged image to a .tif file, then restarts averaging process (ie. loops averaging/saving process for every n captures). Image capture is triggered by button press. Captured images initially saved as value arrays.
Available online examples refer to averaging images that are already saved to computer files (I cannot do this as it uses too much memory).
Relevant code:
if exist('app.vid','var')
app.vid=videoinput("mwspinnakerimaq");
function CaptureaverageimageButtonPushed(app, event)
n = str2double(app.AveragenimagesnEditField.Value);
im1=getsnapshot(app.vid);
[row1,column1]=size(im1);
if r ~= row1 || c ~= column1
im1 = reshape(im1,[r,c]);
sumIm = sumIm + double(im1);
imshow(avgIm,[],'Parent',app.UIAxes2);
while isfile(strcat(app.parentFolder,strcat(app.fullDate,'-',num2str(n),'-',num2str(a),'.tif')))==1
fullFileName=strcat(app.parentFolder,strcat(app.fullDate,'-',num2str(n),'-',num2str(a),'.tif'));
imwrite(avgIm,fullFileName,"tif")
At the moment, individual images are saved to files, not averages. I think my problem is giving each captured image a "k" value.
Thanks for your help.