OpenCV截取图片部分

opencv读取图片
再使用numpy截取图片

// image path is the file path
// get gray scale image
image = cv2.imread(os.path.join(image_path, 'time010.png'), 0)
image = image[x:x + width, y:y + hight]
cv2.imwrite(os.path.join(image_path, 'test.png'), image)

你可能感兴趣的:(opencv,python,计算机视觉)