Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Octave 0.34 KB | None | 0 0
  1. %adapted from https://octave.sourceforge.io/image/function/imtransform.html
  2. im = [checkerboard(20, 2, 4); checkerboard(40, 1, 2)];
  3.  
  4. rho = pi/4 % 45°, can't be zero
  5.  
  6. newpoint = 1 + 1/tan(rho);
  7. p1 = [0 0; 1 0; 1 1];
  8. p2 = [0 0; 1 0; newpoint 1];
  9. T = maketform ('affine', p1, p2);
  10.  
  11. im2 = imtransform (im, T, 'fillvalues', 255);
  12. imshow (im2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement