資源簡介
在MATLAB文件夾中加入圖片即可進行柱面投影,對X和Y軸進行變換。
代碼片段和文件信息
I?=?imread(‘timg.jpg‘);
[height?width?depth]?=?size(I);
A?=?I;
centerX?=?width?/?2;
centerY?=?height?/?2;
%?alpha?=?pi?/?4;
f?=?width?/?(2?*?tan(pi/4/2));
for?i?=?1?:?width
for?j?=?1?:?height
theta?=?asin((i?-?centerX)?/?f);
pointX?=?int32(f?*?tan((i?-?centerX)?/?f)?+?centerX);
point
評論
共有 條評論