1.将一个图片嵌入一张图里,去除黑边
clc
clear
close all
I = imread('qiegray.jpg');
I = rgb2gray(I);
I = double(I);
I1 = imresize(I, 0.3);
I2 = I1
[M,N] = size(I2);
for i = :M
for j = :N
I2(i,j) = -;
end
end
I2 = imrotate(I2,);
%figure, imshow(I2);
I1 = imrotate(I1,);
[M,N] = size(I1); for i = :M
for j = :N
if(I2(i,j) == I1(i,j))
else
I(i + , j + ) = I1(i,j);
end
end
end
figure, imshow(uint8(I));
imwrite(uint8(I),'heli.jpg');