I have a highly repetitive task that I think could be automated but would require some fairly specialized OCR capabilities. Let me know what you guys think.
Basically, we have these jpeg files, they are always 640 x 480, and at a given location within these image files is a set of numbers, printed like this: 2200 / 2400
What I do is go through and rename these images from a big complicated name that is auto-generated when the pictures are captured to this: 22002400_dep.jpg
Now, the #### / #### always appears in the same place in each image, and uses a very standard easy to read font. However, the numbers are just on top of the rest of the image, so it’s not like it has a solid background. There is also a lot of other text within the image that I just ignore, so if I captured all the text in the image, I’d have to sort through and find what I needed specifically.
I’m not sure if there is any OCR software that can be called up and used in a script, or what that would really entail, but specifically I would need the OCR to only read the numbers I care about (in my images this happens to be defined by the following rectangle: upper left vertex [283,401], lower right vertex [398, 414]).
Perhaps it would be easier to just cut and copy that image into a new jpg, OCR that image, and then apply the found text to the image I want to rename?
Not sure if it’s possible but here’s the basic algorithm I’d need:
- Open jpeg
- Scan jpeg using OCR, but only the relevant part
- Rename jpeg using scanned text
I also need to do this recursively and do some moving of images from one directory to another but I think I can figure that much out. The hard (impossible?) part involves the OCR bit.
Let me know what you guys think if you can come up with any way to automate this, it would be great! Either Windows or Linux solutions are valuable.