I have this code for detecting text on an image and bounding it by a green rectangle and extract each bounding text into a separate image, I have done this step but when it is generated and I try to open the image it is very small I cannot see it, I tried to apply resize but not works. please help me.
img = cv2.imread(IMAGE_PATH)
copy = img.copy()
ROI_number = 0
for detection in result:
top_left = tuple([int(val) for val in detection[0][0]])
bottom_right = tuple([int(val) for val in detection[0][2]])
#text = detection[2]
#font= cv2.FONT_HERSHEY_SIMPLEX
img = cv2.rectangle(copy, top_left, bottom_right, (36,255,12), 2)
ROI = copy[top_left, bottom_right]
img2 = cv2.resize(ROI, dsize=(0,0), fx=5, fy=5)
cv2.imwrite('ROI_{}.jpg'.format(ROI_number), ROI)
#img = cv2.putText(img,text,(20,spacer), font, 1,(0,255,0),2,cv2.LINE_AA)
ROI_number += 1
#plt.figure(figsize=(30,30))
plt.imshow(img)
plt.show
cv2.imshow('copy', copy)
cv2.waitKey()
question from:
https://stackoverflow.com/questions/65645627/extracted-bounding-image-is-very-small 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…