I am applying the threshold value manually
I am trying to extract exact information of credit card.
I attached the sample images.
how can in extract credit card numbers exactly.
import re
import cStringIO
import urllib
import cv2
import numpy as np
from matplotlib import pyplot as plt
from PIL import Image
from noiselevel import estimate_noise
import pytesseract
oriimage="sh.png"
newimage = cv2.resize(oriimage,(583,327))
newimage = newimage[150:250, 0:600]
# valid_image = newimage[150:250, 0:600]
cv2.imwrite("moon.tif",newimage)
# filter=ImageFilter.UnsharpMask(6.0,269,0)
# im=Image.open("moon.tif")
# i=im.filter(filter)
# i.save("l3.tif")
a=Image.open("moon.tif")
inputt="moon.tif"
img = cv2.imread(inputt,0)
ret1,th1 = cv2.threshold(img,120,254,cv2.THRESH_BINARY)