Image processing libraries such as OpenCV and Caffe often convert image images to Ndarray and handle them, but I was at a loss for a moment to cut this out as ndarray and save it as an image, so be careful.
image_crop.py
import numpy as np
import scipy as sp
import Image
#Image coordinates are stored in variables as shown below
# x:x-axis start coordinate
# y:y-axis start coordinate
# w:Number of pixes you want to crop from the x-axis
# h:Number of pixes you want to crop from the y-axis
#When using PIL
pic = Image.open(input_file_path)
imgar = np.asarray(pic.crop((x, y, x+w, y+h)))
sp.misc.imsave('test.jpg', imgar)
#ndarray If you want to handle it as it is
#PIL and x,Note that y is reversed
imgar = nd[y: y+h, x: x+w]
sp.misc.imsave('test.jpg', imgar)