title: extract intensity profile along a line from image
body: <p><img src="https://i.stack.imgur.com/lXV21.jpg" alt="ch4-out is the sample image" /></p>
  <p>I have a numpy array that contains some image data (ch4_out). Now, I want to extract intensity profile along a particular line (horizontal). I am using <code>profile_line</code> function from skimage module to do this, but I am getting error. I am seeking some help to resolve my code.</p>
  <p>error displayed is</p>
  <blockquote>
  <p>order = _validate_interpolation_order(image.dtype, order)</p>
  </blockquote>
  <pre><code># reading multiple images 
  S01=[i for i in 
  glob.glob(&quot;C:/Users/experiment/S01/*.tif&quot;)]
  
  # Averaging images
  ch4=np.array([np.array(Image.open(fname)) for fname in
  S01])
  ch4_avg=np.array(np.mean(ch4,axis=(0)),dtype=np.uint16)
  ch4_out=Image.fromarray(ch4_avg) # image data as numpy array
  
  #plotting figure
  plt.figure()
  plt.subplot(1,2,1)
  plt.imshow(ch4_out,cmap='gray',interpolation='none') 
  #code works fine until this point
  
  #Now, extract intensity profile at pixel along horizontal line x (2 to 1000) at a height in vertical direction of 730 
  pixels
  
  p = profile_line(ch4_out, (2, 1000), (730, 730)) 
  # coordinates for horizontal (2,1000) and vertical 
  (730,730))
  plt.imshow(p)
  plt.show()
  </code></pre>