I used OpenCV for contouring and obtaining fragments of parts of clothing on a person, for further classification using a convolutional neural network, I got stuck at the moment of obtaining fragments of clothing after contouring, I need to get an image exactly along the contour

import cv2
import imutils
import numpy as np
from rembg import remove
from PIL import Image
input_path = 'wear.jpg'
output_path = 'cutted_wear.png'
output = remove(Image.open(input_path))
output.save(output_path)
image = cv2.imread('cutted_wear.png')
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
gray = cv2.GaussianBlur(gray, (9, 9), 0)
cv2.imwrite('test.jpg', gray)
edges = cv2.Canny(gray, 25, 130)
cv2.imwrite('edges.jpg', edges)
kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (10, 10))
closed = cv2.morphologyEx(edges, cv2.MORPH_CLOSE, kernel)
cv2.imwrite('closed.jpg', closed)
cnts = cv2.findContours(closed.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
cnts = imutils.grab_contours(cnts)
total = 0
for c in cnts:
p = cv2.arcLength(c, True)
approx = cv2.approxPolyDP(c, 0.00001 * p, True)
if len(approx) > 0:
cv2.drawContours(image, [approx], -1, (0, 255, ), 4)
total +=1
print(total)
cv2.imwrite('test_final.jpg', image)