I have the input image
.I want to find the document layout of the Text area. I tried using "Convex Hull"
When I do "Convex Hull" and draw counter for it. The output is

It is NOT marking the document Printed area. How can we find the X and Y coordinates of it
Below is the code
import cv2
# Load the image
img1 = cv2.imread(r'TestImage.jpg')
# Convert it to greyscale
img = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY)
# Threshold the image
ret, thresh = cv2.threshold(img,50,255,0)
# Find the contours
contours, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
# For each contour, find the convex hull and draw it
# on the original image.
hull=[]
for i in range(len(contours)):
hullv=cv2.convexHull(contours[i])
hull.append(cv2.convexHull(contours[i]))
# print(hull)
cv2.drawContours(img1, [hullv], -1, (255, 0, 0), 2)
cv2.imwrite(r"contours1.png",img1)
