EasyOCR icon indicating copy to clipboard operation
EasyOCR copied to clipboard

OCR Vertical Japanese texts?

Open vsatyamesc opened this issue 3 years ago • 10 comments

can you add a trained model or whatever for Vertical Japanese texts too?

vsatyamesc avatar Mar 18 '22 10:03 vsatyamesc

It's magical, but you just need to rotate the image for 90 degree. (for craft)

TsXor avatar Nov 11 '22 16:11 TsXor

It's magical, but you just need to rotate the image for 90 degree. (for craft)

You aren't joking are you? You understand the difference between vertical texts and horizontal right?

vsatyamesc avatar Nov 11 '22 16:11 vsatyamesc

It's magical, but you just need to rotate the image for 90 degree. (for craft)

You aren't joking are you? You understand the difference between vertical texts and horizontal right?

You just have to try, I mean craft detection. I am not kidding. I don't know why craft can still recognize rotated character!

TsXor avatar Nov 11 '22 16:11 TsXor

In fact, craft just first find characters and then connect them into lines. So, I mean, we can detect text lines like this, and rotate every single character in a line, then rotate the line, and we can get horizontal text.

TsXor avatar Nov 11 '22 16:11 TsXor

I will have to try it. so you mean I have to rotate the image in a way that it makes horizontal text and based on that CRAFT would rotate each characters

vsatyamesc avatar Nov 11 '22 16:11 vsatyamesc

In fact, craft just first find characters and then connect them into lines. So, I mean, we can detect text lines like this, and rotate every single character in a line, then rotate the line, and we can get horizontal text.

just as you said I tried, but it is not working. It does seem better than before though because it has been able to recognize more characters but it isn't up to point or close to what it can achieve with other languages. If you don't know Japanese vertical text is totally different than English vertical texts. So this PR doesn't work on Japanese vertical texts.

vsatyamesc avatar Nov 11 '22 16:11 vsatyamesc

just as you said I tried, but it is not working. It does seem better than before though because it has been able to recognize more characters but it isn't up to point or close to what it can achieve with other languages. If you don't know Japanese vertical text is totally different than English vertical texts. So this PR doesn't work on Japanese vertical texts.

The point is, craft by default try to bind characters that is horizontally near into lines, so when you write like

c b a
c b a
c b a

craft will understand them as 3 lines of cba This is what will happen when the vertical characters can coincidentally be understood as horizontal lines. I mean, when they cannot, like this: example

It will confuse craft.

TsXor avatar Nov 12 '22 02:11 TsXor

Also, there is another well known trick to achieve this: when training the ocr, tell them that: example is a and when recognizing, rotate the picture by 90 degrees counterclockwise.

TsXor avatar Nov 12 '22 02:11 TsXor

Maybe they'll try to add Japanese vertical text recognition, or I'll have to find a workaround

vsatyamesc avatar Nov 12 '22 02:11 vsatyamesc

is this currently supported in the cmdline tool?

eadmaster avatar Aug 20 '25 10:08 eadmaster