数模论坛

 找回密码
 注-册-帐-号
搜索
热搜: 活动 交友 discuz
查看: 2854|回复: 0

基于morphing算法和Matlab实现图象变换

[复制链接]
发表于 2004-10-29 06:00:52 | 显示全部楼层 |阅读模式
<>%source code filename: PrettyGirl_TO_Beast.m
%create a AVI file by using morphing technique
%load two image(s) for morphing
%f -- image before morfhing('lenna.bmp')
%g -- image after morpfing('mandril.bmp')
f = imread('lenna.bmp');
g = imread('mandril.bmp');</P>
<>% create a AVI file</P>
<>mov = avifile('PrettyGirl_TO_Beast.avi');
mov.Quality = 100;     %high quality
mov.Fps = 25;    %25 frame(s) per second</P>
<P>%make morphing image and add it to AVI file as a frame</P>
<P>t = 0.00;
while(t &lt;= 1.00)
h = imlincomb(1-t,f,t,g);  %linear combination of two images - morphing techique
mov = addframe(mov,h);   %add image to AVI as frame
t = t + 0.01;
end;</P>
<P>%close AVI stream file and write AVI file</P>
<P>mov = close(mov);</P>
<P>注:lenna 和 mandril 都是典型的 图象处理图片 只要在Google上搜索就可以(点“图象搜索”)</P>
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

小黑屋|手机版|Archiver|数学建模网 ( 湘ICP备11011602号 )

GMT+8, 2024-11-27 13:43 , Processed in 0.056756 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表