how to save the specific variable for each image when I have done batch image processing?
3 visualizzazioni (ultimi 30 giorni)
I have done a batch of image processing. I would like to compare all the images based on one or two variables (the results that I am finding in the code) Let's say, I am finding a number of pixel in the mask for each image and I need to see the result of each image. When I process all images, it only shows the last image I processed in the workspace. Can I save the result of each image as a MAT-file?
Stephen23 il 7 Ago 2018
Modificato: Stephen23 il 7 Ago 2018
"When I process all images, it only shows the last image I processed in the workspace."
"Can I save the result of each image as a MAT-file?"
Yes, very easily in your loop, like this:
for kk = ...
val = ... % variable to be saved
vec = ... % variable to be saved
fnm = sprintf('myfile%04d.mat',kk); % filename
Più risposte (1)
Image Analyst il 7 Ago 2018
Modificato: Image Analyst il 7 Ago 2018
In the loop, just save the value into an array, for example, if you're looping over k and computing mean values:
for k = 1 : whatever
% Code to change image, then
meanValues(k) = mean2(grayImage);
% Save all values in a .mat file.