File size: 157 Bytes
2514fb4
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
function [im] = center_replace(im,im2)

[w,h,~] = size(im);

[a,b,~] = size(im2);
c1 = w-a-(w-a)/2;
c2 = h-b-(h-b)/2;
im(c1+1:c1+a,c2+1:c2+b,:) = im2;

end