资源简介
MATLAB 程序 实现图像拼接,自动匹配特征点 将图片拼接成长图,MATLAB 程序 实现图像拼接,自动匹配特征点 将图片拼接成长图MATLAB 程序 实现图像拼接,自动匹配特征点 将图片拼接成长图
![](http://www.nz998.com/pic/35426.jpg)
代码片段和文件信息
tgImg = imread(‘target.jpg‘);
srcImg= imread(‘source.jpg‘);
w = size(tgImg 1);
h = size(tgImg 2);
SizeSrcY = size(srcImg 1);
SizeSrcX = size(srcImg 2);
SizeTargetY = size(tgImg 1);
SizeTargetX = size(tgImg 2);
imagesc(tgImg);colormap gray;figure;
imagesc(srcImg);colormap gray;
%%
GrdSrc = zeros(size(srcImg));
for i = 2:SizeSrcX-1
for j = 2:SizeSrcY-1
GrdSrc(j i) = int16(srcImg(j-1 i)) + int16(srcImg(j+1 i)) + int16(srcImg(j i-1)) + int16(srcImg(j i+1)) - 4*int16(srcImg(j i));
end
end
%%
GrdTg = zeros(size(tgImg));
for i = 2:SizeTargetX-1
for j = 2:SizeTargetY-1
GrdTg(j i :) = int16(tgImg(j-1 i :)) + int16(tgImg(j+1 i :)) + int16(tgImg(j i-1 :)) + int16(tgImg(j i+1 :)) - 4*int16(tgImg(j i :));
end
end
imshow(GrdSrc);
imshow(GrdTg);
GrdBlend = GrdSrc;
for i=1:cly
for j=1:clx
if(polyMask(i+cy-1 j+cx-1))
GrdBlend(i+py j+px :) = GrdTg(i+cy-1 j+cx-1 :);
else
GrdBlend(i+py j+px :) = GrdSrc(i+py j+px :);
end
end
end
axes(handles.DispArea3);
imshow(GrdBlend);
N = (cly) * (clx);
Y = zeros(N 3);
X = zeros(N 3);
for kk = 1:3
for i=1:cly
for j = 1:clx
Y((i-1)*clx + j) = GrdBlend(py-1+i px-1+j);
end
end
for i=1:clx % first row
Y(i) = srcImg(py px+i-1);
end
for j=2:cly-1 % first and last column from 2 to one to the last row.
Y((j-1)*clx + 1) = srcImg(py-1+j px);
Y((j-1)*clx + clx) = srcImg(py-1+j px-1+clx);
end
for i=1:clx
Y(clx*(cly-1)+i) = srcImg(py-1+cly px-1+i);
end
end
SparseCount = 1;
for i=1:clx % first row
U(SparseCount) = i;
V(SparseCount) = i;
S(SparseCount) = 1;
SparseCount = SparseCount+1;
end
for j=2:cly-1 % first and last column from 2 to one to the last row.
U(SparseCount) = (j-1)*clx + 1;
V(SparseCount) = (j-1)*clx + 1;
S(SparseCount) = 1;
U(SparseCount+1) = (j-1)*clx + clx;
V(SparseCount+1) = (j-1)*clx + clx;
S(SparseCount+1) = 1;
SparseCount = SparseCount + 2;
end
for i=1:clx
U(SparseCount) = clx*(cly-1)+i;
V(SparseCount) = clx*(cly-1)+i;
S(SparseCount) = 1;
SparseCount = SparseCount+1;
end
for i=2:cly-1 %Boundaries are done now get to the core gradient part
for j = 2:clx-1
U(SparseCount) = (i-1)*clx + j;
V(SparseCount) = (i-1)*clx + j;
S(SparseCount) = -4;
U(SparseCount+1) = (i-1)*clx + j;
V(SparseCount+1) = (i-1)*clx + j-1;
S(SparseCount+1) = 1;
U(SparseCount+2) = (i-1)*clx + j;
V(SparseCount+2) = (i-1)*clx + j+1;
S(SparseCount+2) = 1;
U(SparseCount+3) = (i-1)*clx + j;
V(SparseCount+3) = (i-1)*clx + j-clx;
S(SparseCount+3) = 1;
U(SparseCount+4) = (i-1)*clx + j;
V(SparseCount+4) = (i-1)*clx + j+clx;
S(SparseCount+4) = 1;
SparseCount = SparseCount+5;
end
end
SC = sparse(U V S N N);
%fSC = full(SC);
%d
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6148 2014-04-05 03:20 Image_mosaicing\.DS_Store
文件 120 2014-04-05 03:20 __MACOSX\Image_mosaicing\._.DS_Store
文件 3599 2014-04-05 03:20 Image_mosaicing\blend.m
文件 6148 2014-04-05 03:20 Image_mosaicing\blend_results\.DS_Store
文件 120 2014-04-05 03:20 __MACOSX\Image_mosaicing\blend_results\._.DS_Store
文件 23847 2014-04-05 03:20 Image_mosaicing\blend_results\1_2.jpg
文件 31690 2014-04-05 03:20 Image_mosaicing\blend_results\ab.jpg
文件 6148 2014-04-05 03:20 Image_mosaicing\cylinder_results\.DS_Store
文件 120 2014-04-05 03:20 __MACOSX\Image_mosaicing\cylinder_results\._.DS_Store
文件 83654 2014-04-05 03:20 Image_mosaicing\cylinder_results\1_2.png
文件 119709 2014-04-05 03:20 Image_mosaicing\cylinder_results\a_b.png
文件 6148 2014-04-05 03:20 Image_mosaicing\data\.DS_Store
文件 120 2014-04-05 03:20 __MACOSX\Image_mosaicing\data\._.DS_Store
文件 2385551 2014-04-05 03:20 Image_mosaicing\data\1.JPG
文件 2253013 2014-04-05 03:20 Image_mosaicing\data\2.JPG
文件 117799 2014-04-05 03:20 Image_mosaicing\data\a.jpg
文件 102270 2014-04-05 03:20 Image_mosaicing\data\b.jpg
文件 1502 2014-04-05 03:20 Image_mosaicing\masks.m
文件 657 2014-04-05 03:20 Image_mosaicing\match_descr.m
文件 1617 2014-04-05 03:20 Image_mosaicing\mosaic.m
文件 480 2014-04-05 03:20 Image_mosaicing\plot_descr.m
文件 1612 2014-04-05 03:20 Image_mosaicing\RANSAC.m
文件 572 2014-04-05 03:20 Image_mosaicing\readIms.m
文件 6148 2014-04-05 03:20 Image_mosaicing\results\.DS_Store
文件 120 2014-04-05 03:20 __MACOSX\Image_mosaicing\results\._.DS_Store
文件 286784 2014-04-05 03:20 Image_mosaicing\results\1_2.png
文件 103652 2014-04-05 03:20 Image_mosaicing\results\a_b.png
文件 1144 2014-04-05 03:20 Image_mosaicing\stitch.m
文件 4102 2014-04-05 03:20 Image_mosaicing\stitch_blend.m
文件 2397 2014-04-05 03:20 Image_mosaicing\stitch_cylinder.m
文件 1312 2014-04-05 03:20 license.txt
............此处省略0个文件信息
- 上一篇:surf的matlab算法实现
- 下一篇:全景图像拼接代码MATLAB版本
相关资源
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
- matlab识别系统
- 神经网络分类matlab程序
- matlab正弦信号发生器的设计
- matlab程序用Hopfield网络解决TSP
评论
共有 条评论