ImageTrans is a computer-assisted image translation tool. It can automatically locate text areas and perform OCR operations using state-of-art OCR technology and has a homebrew comic text areas merging and detecting algorithm.
It is a desktop app written with B4J. I have also made it to work as a server and work with a Chrome extension.
I started this project when I was asked to extract text from comic images and it has undergone major updates since I chose to use it for the thesis of my Master’s degree.
The reasons why I choose B4X are manifold. First, it is a rapid development tool with a language style I am familiar with. I started learning programming with Turbo Pascal and found interests in writing AutoIT scripts. I found Basic4ppc when I was fiddling with my dad’s HTC. After I purchased T-Mobile G1, there is B4A which is handy to use. Second, it has an enthusiastic community. I learned a lot from the forum by watching tutorials, code examples and asking questions.
Before ImageTrans, I have written an open source project called BasicCAT. This is the first time I use B4X for a big project. It has over 40000 lines of code. I completed the first version in less than two months and have been updating it for 2 years. With the experience of writing BasicCAT, I am confident to use B4X to create tools I want.
There are some difficulties in writing ImageTrans. First, I am not familiar with image processing. After I read a lot of papers and learned how to use opencv, I started to know what methods I need to use and worked out a decent solution in the end. One of the goodness of B4J is that I can directly call Java methods. OpenCV has a java library so I can easily use it in B4J. Second, ImageTrans is like an image editor which is specially designed to translate images. One of the major functions is to render text. I use TextFlow to render horizontal text and write my own vertical text engine for vertical Japanese/Chinese/Korean text. I also have to keep the result as image so that zoom-in and zoom-out will not change the result. Third, I need to translate the UI from Chinese to English. I have to say the localization support of B4X is not very perfect. I have to write my own helper to extract text and modify the existing B4XLocalizator to add tooltips if the text of control is truncated. Of course there are more details to write about.
ImageTrans has become a sophisticated image translation tool, so I decided to sell it on FastSpring, the e-commerce platform B4X is on. I have earned $400, not much though but I am proud of myself.