title: How do I crop an image in opencv and python based on percentage
body: <p>I want to take an image and crop it by 75% from the center of the original image.  To be honest I'm at a bit of a loss on it.  I had thought about getting the original image size</p>
  
  <pre><code>height, width = image.shape
  </code></pre>
  
  <p>getting a percentage value and cropping:</p>
  
  <pre><code>cropped_y_start = int((height * 0.75))
  cropped_y_end = int((height * 0.25))
  cropped_x_start = int((width * 0.75))
  cropped_x_end = int((width * 0.25))
  
  print cropped_x_start
  print cropped_x_end
  
  crop_img = image[cropped_y_start:cropped_y_end, cropped_x_start:cropped_x_end]
  </code></pre>
  
  <p>There are multiple problems with this but the main one being its not based off the center of the image.  Any advice on this would be much appreciated.</p>