title: Piecewise Affine Transform+warp output looks strange
body: <p>I have an image I am trying to warp using <code>skimage.PiecewiseAffineTransform</code> and <code>skimage.warp</code>.  I have a set of control points (<code>true</code>) mapped to a new set of control points (<code>ideal</code>) but the warp is not returning what I expect.</p>
  
  <p>In this example, I have a simple gradient of wavelengths I am trying to 'straighten out' into columns. (You might ask why I am finding contours and interpolating but that is because I am actually applying this code to a more complex use case. I just wanted to reproduce all the code for this simple example which results in the same strange output.)</p>
  
  <p>Any reason why my output image just has the input image warped into a square and inset? I'm using Python 2.7.12 and matplotlib 1.5.1. Here is the code. </p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  from skimage import measure, transform
  
  true = np.array([range(i,i+10) for i in range(20)])
  ideal = np.array([range(10)]*20)
  
  # Find contours of ideal and true images and create list of control points for warp
  true_control_pts = []
  ideal_control_pts = []
  
  for lam in ideal[0]:
      try:
          # Get the isowavelength contour in the true and ideal images
          tc = measure.find_contours(true, lam)[0]
          ic = measure.find_contours(ideal, lam)[0]
          nc = np.ones(ic.shape)
  
          # Use the y coordinates of the ideal contour
          nc[:, 0] = ic[:, 0]
  
          # Interpolate true contour onto ideal contour y axis so there are the same number of points
          nc[:, 1] = np.interp(ic[:, 0], tc[:, 0], tc[:, 1])
  
          # Add the control points to the appropriate list
          true_control_pts.append(nc.tolist())
          ideal_control_pts.append(ic.tolist())
  
      except (IndexError,AttributeError):
          pass
  
  true_control_pts = np.array(true_control_pts)
  ideal_control_pts = np.array(ideal_control_pts)
  
  length = len(true_control_pts.flatten())/2
  true_control_pts = true_control_pts.reshape(length,2)
  ideal_control_pts = ideal_control_pts.reshape(length,2)
  
  # Plot the original image
  image = np.array([range(i,i+10) for i in range(20)]).astype(np.int32)
  plt.figure()
  plt.imshow(image, origin='lower', interpolation='none')
  plt.title('Input image')
  
  # Warp the actual image given the transformation between the true and ideal wavelength maps
  tform = transform.PiecewiseAffineTransform()
  tform.estimate(true_control_pts, ideal_control_pts)
  out = transform.warp(image, tform)
  
  # Plot the warped image!
  fig, ax = plt.subplots()
  ax.imshow(out, origin='lower', interpolation='none')
  plt.title('Should be parallel lines')
  </code></pre>
  
  <p>The output for this looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/ESYY3.png" rel="nofollow"><img src="https://i.stack.imgur.com/ESYY3.png" alt="enter image description here"></a></p>
  
  <p>Any assistance would be greatly appreciated!</p>