Hey Guys I am working with numpy and opencv and want to get a image cropped by the contours of it. Here is one example what picture i want to crop by the edges,

And i want that the yellow line (rectangle) get cropped by python,
import numpy as np
import cv2
from PIL import Image
image = cv2.imread('4.png')
result = image.copy()
image = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)
lower = np.array([103, 131, 70])
upper = np.array([179, 234, 255])
mask = cv2.inRange(image, lower, upper)
result = cv2.bitwise_and(result, result, mask=mask)
print(image.shape)
cv2.imshow('mask', mask)
cv2.imshow('result', result)
cv2.waitKey()



