Character Recognition in IJ


I have made a nice macro to analyze particle size of pictures contained in an input folder. The pictures are jpg coming from a cell phone.

To make my result table relevant, the information about each image must be contained in the title of the picture, which is displayed in the Result Table too. So I know to what sample my particle size corresponds to.
i.e.: date_sample_place_1.jpg

However, renaming the picture takes time and ofter contains mistakes. It is done in the field on a mobile phone.
What is possible, is to put a physical label while taking the picture, but this would be ideal if imageJ could read it to store the name in a variable that would be displayed in the results.

I know that this can be done pretty easily with Tesseract in other softwares but I don’t know if imageJ has a package that could do the same. I join a picture (with no particles on it, but with the label).

Can You help me?

Please let me make two general comments that are not directly related to the character recognition problem.

– If you are dealing with scientific imaging tasks, it is a bad idea to use a cell phone camera. These cameras are optimzed to render nice images for the human eye but not images that can be evaluated in a quantitative way.

– The same holds for JPG-compressed images that are generally unsuited for scientific image evaluations because this compression is lossy and introduced artifacts.

Concerning character recognition, you may at least find ImageJ-plugins that may help with reading bar codes.

Thanks for the advice notQRV. I know it’s not ideal but fortunately my macro works pretty well for what I need.
The success of the data collection I am intending to do relies on the fact that everyone in my team can take a picture in the field without any specifc device. We are working from several different locations.

I already succeeded to extract the label text with Tesseract in R but actually I think that it would be preferible if this could be done all in the same software.

Hi Olivier,

Maybe an integration of imageJ with R (Bio7) can be helpful for you?:


Thanks Peter, yes I have seen it. I am not super fond of having to download this heavy tool but I will give it a try and let you know.

Great and let’s hope it’s not part of any safety-relevant business such as medicine, engineering, or the like …

Please keep in mind that ImageJ is not a kind of computer vision software.

It’s not very heavy. However…

the detour can be avoided if you write a little ImageJ plugin with the Tess4J API. Here you find an instruction which should’nt be hard to combine with your workflow in ImageJ only:

1 Like

Thanks a lot, I will try.

I also tried Bio7 but I gave up, I think it’s a great tool if you plan to use it on a very regular basis, but this is not my case.

Haha no, not part of any safety-relevant business, don’t worry. Unless you consider plant breeding as such.

I am relatively new, I have been learning imageJ for only several months. I think this works great for what I need.