How to change the values of cv2.boundingRect : <p>is there a way to change the values of cv2.boundingRect </p>

<p><a href="https://i.stack.imgur.com/RDv2J.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RDv2J.jpg" alt="enter image description here"></a></p>

<p>I want to adjust so I can get the accurate cv2.drawContours
<a href="https://i.stack.imgur.com/jzlTx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jzlTx.png" alt="enter image description here"></a></p>

<pre><code>import cv2

# Load image, grayscale, Gaussian blur, Otsu's threshold
image = cv2.imread("5.jpg")
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
blur = cv2.GaussianBlur(gray, (5,5), 0)
thresh = cv2.threshold(blur, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]

# Find bounding box

x,y,w,h = cv2.boundingRect(thresh)
cv2.rectangle(image, (x, y), (x + w, y + h), (36,255,12), 2)
cv2.putText(image, "w={},h={}".format(w,h), (x,y - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (36,255,12), 2)

cv2.imshow("thresh", thresh)
cv2.imshow("image", image)
cv2.waitKey()
</code></pre>
