I am trying to extract Image from a pan card with is ID card in India. Trying to extract the same with OpenCV and python. I have tried out the same using connected components background is interfering with it too much.
This is the sample input
This is the required output
I have followed this project as initial starting pointing, but not able to extract the same properly because of the gradient in the background. Thanks in advance for your time – if I’ve missed out anything, over- or under-emphasized a specific point let me know in the comments.


