how to save images into a image array and then use it?

10 vues (au cours des 30 derniers jours)
Anandakumar Selvaraj
Anandakumar Selvaraj le 18 Déc 2013
Commenté : Rik le 11 Août 2020
i have taken plot of images and i need to store it into a image array and then i need to use that array variable as shown below
for i = 1:framerate
axes(handles.axes15);
imshow(lipperimeter);hold(imgca,'on'); plot(imgca,centroids(:,1), centroids(:,2), 'r*','MarkerSize', 10, 'LineWidth', 3);
im = getframe(handles.axes15);
imwrite(im.cdata, fullFileName)
end
this gives an image for a frame so for example 29 images for 29 framerate i have a code were i can save these images into a montage were all individual frames are shown as a single image as
*All i need to do is save the frames as a array of images something like
imgArray=cat(3,image1,image2,image3,...)
i dont know how to write so if any one can help me please*
THAT IS
for i = 1:framerate
axes(handles.axes15);
imshow(lipperimeter);hold(imgca,'on'); plot(imgca,centroids(:,1), centroids(:,2), 'r*','MarkerSize', 10, 'LineWidth', 3);
im = getframe(handles.axes15);
imgArray=cat(3,image1,image2,image3,...) like this is there any way we can save axes image into imageArray
end
montage( cat(4,imgArray{:}) )

Réponse acceptée

Walter Roberson
Walter Roberson le 18 Déc 2013
  4 commentaires
Image Analyst
Image Analyst le 18 Déc 2013
It's possible that for 7x4=28 images, you could run out of memory depending on the size of your images. Unfortunately it creates a stitched image with no option to subsample, though I've let the developers know about this limitation. jpefFiles is a structure so you'll need to convert that to a cell array.
Walter Roberson
Walter Roberson le 18 Déc 2013
Ah, true, you would want {jpegFiles.name} instead of plain jpegFiles

Connectez-vous pour commenter.

Plus de réponses (1)

Mohamad Sabri
Mohamad Sabri le 10 Août 2020
Modifié(e) : Rik le 11 Août 2020
clc
clear
im=imread('jjj.jpg');
gg=imresize(im,0.1);
mm = rgb2gray(gg);
rand(30)
rand('seed',30)
t=13*rand(1,6);
ff1=imgaussfilt(mm,t(1,1));
ff2=imgaussfilt(mm,t(1,2));
ff3=imgaussfilt(mm,t(1,3));
ff4=imgaussfilt(mm,t(1,4));
ff5=imgaussfilt(mm,t(1,5));
ff6=imgaussfilt(mm,t(1,6));
imwrite(ff1,'n1.jpg')
imwrite(ff2,'n2.jpg')
imwrite(ff3,'n3.jpg')
imwrite(ff4,'n4.jpg')
imwrite(ff5,'n5.jpg')
imwrite(ff6,'n6.jpg')
h1=imread('n1.jpg');
h2=imread('n2.jpg');
h3=imread('n3.jpg');
h4=imread('n4.jpg');
h5=imread('n5.jpg');
h6=imread('n6.jpg');
h=[h1; h2; h3; h4; h5; h6];
imshow(h)
H=[1 2 3 4 5 6 ;getGlobalContrastFactor(h1) getGlobalContrastFactor(h2)...
getGlobalContrastFactor(h3) getGlobalContrastFactor(h4)...
getGlobalContrastFactor(h5) getGlobalContrastFactor(h6)]
for i=1:6
y(i)=H(2,i);
% getGlobalContrastFactor(ggr.jpg)
%% algoritm
%..
%... output y1 y2 y3
output(i)=[y(i)];
end
infocus=max(output);
for i=1:6
if max(output(i))==infocus
i;
break
end
end
i
///////
hello friend , i need some help , this is my code , i use gcf to get the image with highest contrast , at the end i need to show this image for its index (i)
  1 commentaire
Rik
Rik le 11 Août 2020
This isn't an answer. Please post it as a comment or a separate question.
Have a read here and here. It will greatly improve your chances of getting an answer.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by