I am trying to mask out the marking on an IC but the inpaint
method from OpenCV does not work correctly.
The left image is the original image (after cropping the ROI). The middle image is the mask I generated through threshholding. The right image is the result of the inpainting method.
This is what I did:
mask = cv2.threshold(img, 120, 255, cv2.THRESH_BINARY)[1]
dst = cv2.inpaint(img, mask, 3, cv2.INPAINT_NS)
I played around with the third parameter of the inpainting method but it does nothing good.
I saw an question here where someone used exactly the same approach and he also had a dark image where the contrasts are not so distinguished. I also tried both inpainting algorithms, Telea and NS.
What is the issue here?