• OCR + Text Detection to CSV Files

I see there are examples of OCR + Text Detection and I also see that people have code to capture camera data as seen in the lawn mower robot.

I am wanting to do a couple projects related to scanning text to capture data in a table format.

So far the code I see gives us the ability to detect text and OCR. Now I need to record that data in a csv file. I would like to have this all happen offline, there are multiple online OCR applications, but I do not want to take photos or scan the files.

In the lawn mower example the camera data had to be captured via csv, that is all I am looking for. A similar example would be to capture the license plate data to a csv, or capturing the total number of people that come into your business.

def write_to_csv(field_name, value):
    with open('data.csv', 'a', newline='') as file:
        writer = csv.writer(file)
        writer.writerow([field_name, value])

Take the python file: https://github.com/openvinotoolkit/open_model_zoo/blob/master/demos/handwritten_text_recognition_demo/python/handwritten_text_recognition_demo.py

and add the function I gave earlier to it, and call it after print(result) here:

   for _ in range(args.number_iter):
        infer_request.infer(inputs={input_tensor_name: input_image})
        preds = infer_request.get_tensor(output_tensor_name).data[:]
        result = codec.decode(preds)
        print(result)