• 大小: 48KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-15
  • 语言: Matlab
  • 标签: 图像处理  

资源简介

matlab实现的图像梯形矫正。使用的投影变换,非常适合初学者。含有测试图片。

资源截图

代码片段和文件信息

function T = calc_homography(points1 points2)

    xaxb = points2(:1) .* points1(:1);
    xayb = points2(:1) .* points1(:2);
    yaxb = points2(:2) .* points1(:1);
    yayb = points2(:2) .* points1(:2);

    A = zeros(size(points1 1)*2 9);
    A(1:2:end3) = 1;
    A(2:2:end6) = 1;
    A(1:2:end1:2) = points1;
    A(2:2:end4:5) = points1;
    A(1:2:end7) = -xaxb;
    A(1:2:end8) = -xayb;
    A(2:2:end7) = -yaxb;
    A(2:2:end8) = -yayb;
    A(1:2:end9) = -points2(:1);
    A(2:2:end9) = -points2(:2);

    [junk1junk2V] = svd(A);
    h = V(:9) ./ V(99);
    T= reshape(h33);
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-10-21 22:54  project\
     文件         632  2014-10-20 23:28  project\calc_homography.m
     文件       10555  2014-10-20 23:28  project\lena.jpg
     文件         877  2014-10-21 00:07  project\main.m
     文件       37214  2014-10-20 23:29  project\pai.jpg

评论

共有 条评论