Click here to Skip to main content
15,885,984 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi team, If I remove image background(watermark) from Driving Licence , in that case the ID was removed from that remove.How can I get ID of the Driving Licence.Could anyone please help me on this.


What I have tried:

import cv2
import numpy as np

src = cv2.imread("D:/python_code/opencv-text-recognition/images/DL18.jpg")
gray = cv2.cvtColor(src, cv2.COLOR_BGR2GRAY)

#remove background
alpha = 3.0
beta = -200
new = alpha * gray + beta
new = np.clip(new, 0, 255).astype(np.uint8)

blur = cv2.GaussianBlur(new, (3, 3), 0)

th1 = cv2.adaptiveThreshold(blur, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 11, 2)

#Denoising
dst = cv2.fastNlMeansDenoising(blur, None, 3, 7, 21)

cv2.imshow("OUTPUT", dst)

k = cv2.waitKey(0)
if k == 27:  # wait for ESC key to exit, ESC represented as ASCII code 27 in decimal
    cv2.destroyAllWindows()
elif k == ord('s'):  # wait for 's' key to save and exit
    cv2.imwrite("D:/python_code/opencv-text-recognition/images/OUTPUT.jpg",dst)
    cv2.destroyAllWindows()
Posted
Updated 8-Oct-20 0:09am
Comments
Sandeep Mewara 8-Oct-20 5:36am    
Why would you remove watermark from a DL? What's the intent here?
nagarjunanethaji 9-Oct-20 4:53am    
I could not able to read text with image having watermark(stamped).That's the reason before going to process first I did focusing on removing watermark

1 solution

Watermarks are there as one of a number of security features to ensure that documents as provided are genuine, legitimate, and refer to the person presenting the document. Removing, altering, or damaging any one of these security features renders the whole document invalid and will be rejected.

You can't fetch an ID from an invalid document, so your nefarious little plan - whatever it was - will not work.
 
Share this answer
 
Comments
nagarjunanethaji 9-Oct-20 5:37am    
@OriginalGriff ,Have not done neither Removing, altering or damaging any one of these security features.Just we are extracting text from image.Not getting proper text with watermark(stamped).So that's the reason,removing watermark

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900