how to save images into a image array and then use it?
조회 수: 3 (최근 30일)
이전 댓글 표시
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{:}) )
댓글 수: 0
채택된 답변
Walter Roberson
2013년 12월 18일
댓글 수: 4
Image Analyst
2013년 12월 18일
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.
추가 답변 (1개)
Mohamad Sabri
2020년 8월 10일
편집: Rik
2020년 8월 11일
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
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!