在哪里可以找到IDL内置函数(INTERPOLATE、GRID_TPS和TRIGRID)的源代码



我需要将使用WARP_TRI函数的IDL源代码转换为MATLAB。WARP_TRI采用输入/输出2D点坐标的两个(大(阵列和一个输入图像,以使用这两个坐标阵列作为控制点对其进行扭曲。有没有一种方法可以在MATLAB中实现等效函数?

我发现以下示例演示了MatLab中的等效函数。

sqsize = 60;
I = checkerboard(sqsize,4,4);
nrows = size(I,1);
ncols = size(I,2);
fill = 0.3;
movingPoints = [0 0; 0 nrows; ncols 0; ncols nrows;];
fixedPoints  = [0 0; 0 nrows; ncols 0; ncols*1.8 nrows*1.5];
t_piecewise_linear = fitgeotrans(movingPoints,fixedPoints,'pwl');
I_piecewise_linear = imwarp(I,t_piecewise_linear,'FillValues',fill);
imshow(I_piecewise_linear)
title('Piecewise Linear')

最新更新