text: #  图像的基本操作，裁剪ROI区域
  
  import cv2 as cv
  
  # 读入图片, im --> image
  # image = cv.imread("./assets/bgr.png")
  # # print(image)
  #
  # print(image.shape)  # (234, 402, 3)
  #
  # print(image[117, 201])  # [  0 254   0]
  
  # 直接改变image数组数据
  # image[117, 201] = (255, 0, 0)
  # image[117, 202] = (255, 0, 0)
  # image[117, 203] = (255, 0, 0)
  # image[117, 204] = (255, 0, 0)
  # image[117, 205] = (255, 0, 0)
  # image[117, 206] = (255, 0, 0)
  
  # 转为灰度图片
  # gray_image = cv.cvtColor(image, cv.COLOR_BGR2GRAY)
  
  # 显示图片
  # cv.imshow("Gray Image", gray_image)
  # cv.imshow("Image", image)
  
  # 使用np创建数据
  # pure_image = np.array(
  #     [
  #         [
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #         ],
  #         [
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #         ],
  #         [
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #         ],
  #         [
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #         ],
  #         [
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #         ],
  #         [
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #         ],
  #         [
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #         ],
  #         [
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #         ],
  #         [
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #         ],
  #         [
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #             [255, 0, 0],
  #         ],
  #     ],np.int8
  # )
  # cv.imshow("pure_image", pure_image)
  
  # 加载图片
  image = cv.imread("./assets/girl2.jpg")
  
  # 获得图片的信息
  print(image.shape)
  rows, cols, channel = image.shape
  
  # 设置roi区域
  roi = image[150:355, 245:405]
  
  cv.imshow("girl", image)
  cv.imshow("roi girl", roi)
  
  # 等待键盘输入
  cv.waitKey(0)
  # 销毁窗体
  cv.destroyAllWindows()
  