matlab 图像拼接程序代码
1. % im = appendimages(image1, image2)
2. %
3. % Return a new image that appends the two images side-by-side.
4.
5. function im = appendimages(image1, image2)
6.
7. % Select the image with the fewest rows and fill in enough empty
rows
8. % to make it the same height as the other image.
9. rows1 = size(image1,1);
10.rows2 = size(image2,1);
11.
12.if (rows1 < rows2)
13.image1(rows2,1) = 0;
14.else
15.image2(rows1,1) = 0;
16.end
17.
18.% Now append both images side-by-side.
19.im = [image1 image2];
20.