python-3.xmachine-learningneural-networkocrhandwriting-recognition

OCR with machine learning


I need to create a OCR using NN for train and read characters from image.. so anyone support me and im beginner in machine learning,so guide me how to read character from image and compare with numpy Array


Solution

  • A good place to start could be getting some background on how your image should be handled. You need to find out how you can go from an image to a matrix you can feed your algorithm.

    This can be done using pillow, matplotlib, and others - https://pillow.readthedocs.io/en/stable/reference/Image.html - https://matplotlib.org/api/_as_gen/matplotlib.pyplot.imread.html

    Here is what this would look like using Pillow and numpy:

    from numpy import asarray
    from PIL import Image
    
    image = Image.open('digits.jpeg')
    data = asarray(image)
    

    You might want to first convert your image to gray scale, or process it in some other way depending on the result you are trying to obtain.