-1

I need to convert my IDL source code, which uses the WARP_TRI function, to MATLAB. WARP_TRI takes two (large) arrays of input/output 2D point coordinates and an input image to warp it using the two coordinate arrays as control points. Is there a way to realize an equivalent function in MATLAB?

  • The copyright notion on the top of this function suggests that uploading it to Stack Overflow is already not allowed. I doubt you can legally get your hands on proprietary source code. Your best bet would be to find an equivalent function MATLAB based on pure functionality, and/or write a MATLAB function with that functionality. – Adriaan Sep 21 '20 at 13:14
  • I think you are right. Please delete this post for me if you can. Thanks for your helpful legal comment! – Jhinhwan Lee Sep 21 '20 at 13:49
  • You can simply delete it by pressing "delete" underneath the post. See [this article in the help centre](https://stackoverflow.com/help/deleted-questions) – Adriaan Sep 21 '20 at 13:55

1 Answers1

0

I found that the following example demonstrates equivalent functions in 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')