Source code:

import cv2
import numpy as np

image = cv2.imread("red_panda.jpg")
rows, cols, ch = image.shape

roi = image[100: 280, 150: 320]

cv2.imshow("Panda", image)
cv2.imshow("Roi", roi)
cv2.waitKey(0)
cv2.destroyAllWindows()<span style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" data-mce-type="bookmark" class="mce_SELRES_start"></span>

 

Files:

  1. red_panda.jpg
  2. flag.png