将两幅图像比率叠加
源函数
function [ imout ] = ImageAdd( ima,imb,x,y,rate )
%UNTITLED 此处显示有关此函数的摘要
% 此处显示详细说明
[m,n,g] = size(ima);
[a,b,g1] = size(imb);
ima = im2double(ima);
imb = im2double(imb);
imout = zeros(m,n,g);
for i = 1:m
for j = 1:n
if ( i <= a &&i >= x && j >= y && j<= b)
imout(i,j,:) = ((ima(i,j,:)*(100 - rate) + imb(i-x+1,j-y+1,:)*rate))/100;
else
imout(i,j,:) = ima(i,j,:);
end
end
end
end