MATLAB: Over lap image onto another image?

homeworkimage processing

HI , im supposed to make a function
function [] = paste ( smallimage, bigimage, centerxy)
which returns the small image pasted onto the big image placed at [ x ,y] location center xy. the smallerimage is copied to overlay part of the big image, it will appear inside the bigimage and cover some of its pixels
I did not learn anything about copying and pasting images in class , and ive been searching the internet so much to find out how , but i cannot find any sites that teaches me how to do something like this
Do i do something like i=imread(smallimage) i=imcrop(i)
and then i dont know what else to do , how would i paste it in the other picture matrix?
is there impaste( location , bigimage)? oh jeez ive spent 40 of the past 48 hours trying to figure out matlab

Best Answer

Consider:
a = magic(7)
b = rand(2,3)
a(3:4,4:6) = b
% Or, more generally,:
startrow = 3;
startcol = 4;
a(startrow:startrow+size(b,1)-1,startcol:startcol+size(b,2)-1) = b;
Cheers,
Brett
Related Question