I am trying to extract a card from the scanned page, where the original image is this
import cv2
image = cv2.imread(‘image.jpg’)
image = cv2.resize(image, (image.shape[1]//10,image.shape[0]//10))
image = cv2.GaussianBlur(image, (5,5), 0)
myimage_grey = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
_, background = cv2.threshold(myimage_grey, 0, 255, cv2.THRESH_BINARY+cv2.THRESH_OTSU)
cv2.imwrite(‘card.jpg’, background)
which gives me the following output with some black patches along with the card
Is there any way to remove the black patch along with the card?