資源簡介
matlab實現(xiàn)的圖像梯形矯正。使用的投影變換,非常適合初學者。含有測試圖片。

代碼片段和文件信息
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
評論
共有 條評論