Variable Number of images as inputs and superimpose together? - Homework
Show older comments
I am trying to make a function that will receive a variable number of image files. The function will read all the images and superimpose all images with equal contribution from each. So the input images might be different sizes, so the function needs to resize all images to the same size as the smallest image before superimposing.
This is the function I have so far, but it needs a lot more work.
function SuperImpose( varargin )
% INPUT VARIABLE NUMBER OF IMAGES AND USE imlincomb TO COMBINE THEM
% 17-NOV-2013, NM
cn = 0;
for i = 1:nargin
cn = imresize(varargin{i}, [384 512]);
cn = cn + 1;
cs{cn} = str;
end
sumim = imlincomb(cn);
imshow(sumim);
end
Accepted Answer
More Answers (1)
Walter Roberson
on 19 Nov 2013
0 votes
I would suggest that instead of using varargin, that you pass a cell array containing the data.
Are you being passed the matrices of image data, or the file names ?
1 Comment
Nora
on 19 Nov 2013
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!