Code:
from PIL import Image
#http://www.gossamer-threads.com/lists/python/python/507073#507073
def neoOCR(im):
im = im.convert("L") # convert to grayscale
lo, hi = im.getextrema() # find darkest pixel value
lo = im.point(lambda x: x == lo) # highlight darkest pixel value
x, y, _, _ = lo.getbbox() # locate uppermost/leftmost dark pixel
return x, y
Code:
im = Image.open("C:\\cap.jpeg");
print(neoOCR(im))
Python 2.x PIL: (you need an account to see links)
Python 3.x doesn't have PIL... Christoph Gohlke ported it to 3.x, named it pillow, and has a binary for it here: (you need an account to see links)