当前位置:百问家>生活百科>急求!图像拼接算法代码

急求!图像拼接算法代码

2024-07-24 14:47:24 编辑:zane 浏览量:536

急求!图像拼接算法代码

的有关信息介绍如下:

急求!图像拼接算法代码

算法描述 procedure ImageMatching { 输入FirstImage; 输入SecondImage; //获得两幅图象的大小 Height1=GetImageHeight(FirstImage); Height2=GetImageHeight(SecondImage); Width1=GetImageWidth(FirstImage); Width2=GetImageWidth(SecondImage); // 从第二幅图象取网格匹配模板 SecondImageGrid = GetSecondImageGrid(SecondImage); // 粗略匹配,网格在第一幅图象中先从左向右移动,再从下到上移动,每次移动一个网格间距,Step_Width 或Step_Height,当网格移出重叠区域后结束 y=Heitht1-GridHeight; MinValue = MaxInteger; While ( y0 & Step_Width>0)//当水平步长和垂直步长均减为零时结束 { if(Step_Height==0)//当仅有垂直步长减为零时,将其置为1 Step_Height=1; If(Step_Width==0) //当仅有水平步长减为零时,将其置为1 Step_Width=1; temp_x = BestMatch_x; temp_y = BestMatch_y; for ( i= -1; i<1; i++) for( j= -1; j<1; j++) { if ((i=0&j!=0)|(i!=0&j=0)) { FirstImageGrid=GetImgaeGrid(FirstImgaeGrid, temp_x+i*Step_Width, temp_y +j*Step_Height); differ=CaculateDiff(FirstImgaeGrid, SecondImageGrid); if (differ

版权声明:文章由 百问家 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.baiwenjia.com/life/120651.html
热门文章