Log in

View Full Version : SubOCR beta v0.3.2 [Artificial Intelligence]


Dark-Cracker
12th April 2005, 19:35
Hi,

i am trying to made a little tool to made an OCR (optical character recognise) for the vobsub (.sub/.idx) file.

it's not fully working and i search some people to help me to test it in order to improve it and to fix the bugs.

If you found a bug/problem mail me the .sub/.idx file at :
darkcracker#caramail.com (# => @)
with a comment on the error and the subtitle's line when it occur.

URL :
------
http://dark.pluridis.org/downloads/SubOCR.zip

http://dark.pluridis.org/downloads/SubOCR_IA.zip (with Artificial Intelligence) -- temporily disabled


WARNING :
---------

- the matrix (file matrix.dat) who store the character is delete each time you start the application. You can't reuse it for the moment.

- If the subtitle is not displayed in BLACK letter on a WHITE background, there is a problem and the OCR will not work properly.


TESTS :
-------

if someone could test the following :

- the subtitle is correctly displayed.
- the subtitle font appear in black and white.
- there is not some spelling mistake.

Any suggestion or comments are welcome.
Please be gentle my tool have still a long way before being fully stable and usefull :)

Bye.

buzzqw
12th April 2005, 19:53
error 404 on download...

BHH

Kurtnoise
12th April 2005, 20:02
A link mirror : http://kurtnoise.free.fr/SubOCR.zip

violao
13th April 2005, 09:03
The language DLL "VB6FR.DLL" could not be found.

Downloaded VB6FR.DLL from net and put it into windows\system32 dir. Now SubOCR can be started. First sub I tried started with italic letters and that brings me dialog box trying to recognize several consecutive letters at once, something we have all seen with Subrip. The other sub file produced empty lines (probably the color problem you described) and the third seemed to work fine although it looks like manual assisted OCR, very similar to Subrip. Why would you want to duplicate Subrip functionality?

As for colors, why are you saying "black" and "white"? AFAIK there are no colors in subpicture stream. All colors are to be found in IFO file and Vobsub seems to include those colors in idx file.

Dark-Cracker
13th April 2005, 18:58
hi,

in fact i have been interest by the OCR from a long time and i have never found time and motivation before, i found the OCR coding really interesting and a few week ago i have made a preview tool for the vobsub file for my autorv10 software, and the next step was obviously to made an ocr (who will be added later in autorv10).

i think that perhaps once it will be more stable it will perhaps be usefull for other people (Subrip is one of the most famous but it often freeze on my XP OS and still let some spell error), i don't try to made a concurrent i just try to produce a software a bit more easy to use and without the bad side i have encounter in the other OCR tools i have used.

i will try to improve letter detection and add italic support in the next release.

PS : can you send me the 2nd subtitle (with empty lines) i will check why it have failed.

PS 2 : i already know there is 4 colors in subtitltes :) i speak about B&W because to made the letter detection more easy you *force* the subtitle color in whithe for the background and outlining and black the background letter color, my soft try to automaticly found the background letter color but it can faild on some subtitles.

thx for the bug report :)

++

violao
14th April 2005, 08:53
Originally posted by Dark-Cracker
PS : can you send me the 2nd subtitle (with empty lines) i will check why it have failed.
I could if you pm me your email address.

Dark-Cracker
14th April 2005, 21:27
i have write it in the first post :

>darkcracker#caramail.com (# => @)

++

niamh
15th April 2005, 19:15
OK, I have 5 minutes at last to try it :)

let's start complaining :p :D

1- supported files don't include idx, and while it's all the same idx/sub, I feel for clarity it would be nice to have idx show up too (or even instead) :)
(I've been browsing a big subtitle folder, and it gives me no clue as to which is vobsub and which is other .sub, so it forced me to open explorer to check against it).On top of this, new users will probably moan it doesn't work, because they don't have the idx in the first place :)

2- I don't have many vobsubs left around, but the first one I tried, gave me a warning:
warning the language index value is not a valid subtitle stream number!
Then when I hit close, it says runtime error 6, overflow :( This sub has english french and italian as languages according to subrip.
I will mail you the file, it's the mission.

I tried another one, got the same warning about language (this one is english/chinese, so I can guess what caused the error; only english shows subsequently :) ). But it didn't overflow, and all worked well. There doesn't seem to be errors with L and i either :)

What's detect letters for? it doesn't seem to do anything that I can see :)

And thanks for a new app :)

Dark-Cracker
15th April 2005, 19:53
@niamh

thank for taking the time to test :)

i will change the open box and only allow to select the .idx file, i have set the .sub input because there is already an error check to detect if the .sub is an textsubtitle or an vobsubtitle.

the error "warning the language index value is not a valid subtitle stream number!" it's because in the .idx file the default index value doesn't match with a subtitle index listed in the idx file.

i think once i will receive you mail i will find why it show you this error and why you have an error 6 after the msgbox.

detect letter is to made some test to see if the detection algo doesn't failed on a subtitle line. it's more easy to find the right threshold and avoid to made a full OCR to find the bad character who are not well detected, it's only to debug and for people who whant to test if the letter are well recognised.

just by curiosity which language have you OCRed ? in fact i am interested to know some other alphabet are well detected and well stored in the matrix (especially chinese and japanese).

++

niamh
15th April 2005, 21:39
Dang, I did send the email, so it failed :mad:

I have ocred an english subtitle, the chinese one wasn't detected at all, or rather gave me the 2nd index language error. I couldn't ocr chinese anyway, I don't have the right keyboard/language/anything :)

niamh
15th April 2005, 22:02
OK, get it there (http://c.1asphost.com/niaomalley/the mission.7z)

unmei
15th April 2005, 23:46
It would be really great if you could make it accept unicode letters in the user input! This is one thing that really bugs me in subrip - i loved it if your app could solve that.

I tried a normal movie sub, it went fine for something after 10%, then this error popped up:

---------------------------
Projet1
---------------------------
Erreur d'exécution '9':

Indice en dehors de la plage
---------------------------
OK
---------------------------

i don't know the timecode, but from the movie being 2 hours i guess somewhere around 15 min and maybe 120th picture.

After this error the app vanished immediately (silently crashed)

A next time i tried to close the app, but if you close the input window it just keeps popping up, there is no way to stop the program before the end except task manager? Also this way i can't save the (partial) result.

A minor thing, i felt it ask a bit more often for character combinations than subrip (ie some two character not touching). Maybe you can tune the process detecting what an individual character is (not urgent tho, imho).

Dark-Cracker
16th April 2005, 12:42
@ niamh

thank u for the subtitle hosting i have get them and checking the problem.

@unmei

could you please send me this subtitle i will check this error msg.

for the unicode problem, could you explain a bit more ? i suppose you are chinese so does you problem it's you can't entrer chinese letter in the inputbox ? i don't have a really good knowledge of what happen at my application when there are launched on a foreign OS and if there is some way to improve it fell free to explain me :)

i will add a way to stop the application :)

and i am actually trying to improve the algo to detect the letters you are right sometimes it regroup some characters when it shouldn't.

thx for the beta test :)

++

Rumbah
16th April 2005, 15:25
It would be really great if this tool evolves to an alternative to subrip, as subrip doesn't work on my computer (and several others) since SP2.

unmei
16th April 2005, 18:07
no i'm not chinese (ch = switzerland). I run an english installation of XP. What i meant is i cannot, for example, enter russian characters copied from the windows character map or (japanese) entered with the IME. It only shows a question mark for each of the characters which is typical behavious of programs that use code pages instead of unicode strings. I don't know how unicode works in VB, but in other languages you use a different datatype for text vars (ie widestring instead of string, w_char* or w_char_t* instead of char*) and then also often need to use the "wide" version of string processing functions (widelowercase() etc). The nice thing is that this way you can process strings in any language without having to worry what localisation your OS has..

About the crash .. i was probably just stupid and launched subOCR from within the zip. Now that i extracted it, it completes the same vobsub w/o crash.
Now when i look at the result, maybe i made a mistake and entered "-" for capital I or small L, but i don't think so and it has a "-" everywhere a I or l should be (Maybe somehow a character is interpreted as the same if it is rotated by 90°?)
Still if you want a german vobsub: here (homepage.hispeed.ch/~mieru/doom9/ichi-vobsub.rar)
and result (homepage.hispeed.ch/~mieru/doom9/ichi-OCR.rar)

Dark-Cracker
16th April 2005, 20:50
ok i have check for the unicode and there is actually 2 solutions.

1) a remplacement control for the textbox (but the control is around 2 Mb :( ) who support Unicode input but i am not really happy to use a such big dependency.

2) is to select the charset input for exemple "CHINESE_BG2312" and to have a font who support this charset, i think the charmap copy the character in utf8 in the clipboard and i think that if i decode it and recode it in the textbox with the correct charset it could help.
but it's a bit complicated.

i will made more tests and try to find a solution.

i will test the german subtitle to see if there is the same problem.

++

unmei
18th April 2005, 19:33
Mmm 2mb is really a bit large. Sure if there is no proper native unicode support it might have to provide the whole system even for a single control.
It must be something like this, because on delphi (which has unicode support, but no unicode controls) i use a package that provides for almost any useful "builtin" control a unicode flavour. I don't know the exact size of this, but i'd guess maybe 200-400 kb, sure not 2mb :(
Then again i can't imagine you'd have to add a full unicode system in VB ..i mean windos has unicode 'everywhere' ..how would they handle this ..i hope they do not simply ignore windos unicode stuff..
Finally, if you don't feel like messing with unicode, it was just a suggestion because i was thinking about writing an OCR for some time before, but i have so much else i want to do, it would not totally fit into my editor's other features and so little time - i tought it were nice if someone "did it for me" :D

Dark-Cracker
18th April 2005, 20:45
lol :) i think it's an interesting feature but not really easy to add, i think the control for unicode is bundle in the internet explorer package (fm20.dll) so i think most of the people have it, i will look more into this later i still have to work on the spellcheck before and solve a strange bug in my RLE decompress function.

++

ai4spam
28th April 2005, 23:01
SubRip is currently being worked on some more (see http://forum.doom9.org/showthread.php?s=&threadid=93680 ), and it already does what you want to accomplish here. As for the post-SP2 problem, it only happens on some processors, and will be fixed soon too.

Dark-Cracker
29th April 2005, 19:37
@ai4spam
thank u for the comment.

@all
i will post an update with some bugfixes and some spellcheck in a couple of days.

++

Dark-Cracker
30th April 2005, 21:00
hi,

i have made an update of the SubOCR software :)

I have fix all the bug reported , all the subtitles who failed with the previous version now are working correctly (thank u very much at all the beta tester who have send me the file and have taken the time to made some tests :) ).

URL : (cf first post)

Changelog :
-----------
- Improve the spellcheck part : a better correction for the "I" and "l", and for the character "0" "O", it also correct the ponctuation and the numeric, but i still need to improve the uppercase and the minus detection and also the timestamp.
- There is now a possibility to stop the OCR process.
- The subtitle output file is now saved as the name of the input vobsub file + "_Subtitle.srt" .
- Add the percent and the time remain before the end of the OCR process.


If some people could made some tests to check if there still some problems especially for the spelling correction or for the subtitle displaying.

Know bug : space threshold is bad detected when there is a lot of italic sentenses.

I will try to improve the italic detection for the next release.

++

ai4spam
6th May 2005, 18:19
Originally posted by Dark-Cracker
@ai4spam
thank u for the comment.

Well, what I'm saying is that we could use more developers working on SubRip than people working independently on applications of their own. Please let us know if you know Delphi well enough to help us (Brain is French too, so you may understand the commends he left in the code better than any of us).

Dark-Cracker
6th May 2005, 19:33
@ai4spam
no problem i understand you feeling.
unhappily i don't understand delphi but i am sure you will find some motivated people who will lend u a hand to improve subrip :).

keep up the good work.

Dark-Cracker
28th May 2005, 17:05
v 0.3 is out (cf link in the first post)

- improve idx parsing (avoid niamh's subtitle error msg)
- fix all other bugs reported
- improve letter detection (even in italic text the characters are not detected by packets).

TESTS :
-------

- check if the subtitle are displayed in BLACK letter and WHITE background.
- check if the space beetween each word is correct.
- if there is no strange behaviours during OCR.

TO DO :
------
- add expand / reduce selection.
- skip letter / skip subtitle
- improve ocr storage for little character.
- improve spellchecking.

any feedback is welcome

++

Rumbah
29th May 2005, 19:11
After the first 2 lines of a ripped subtitle, I get the error:

Erreur d'exécution '6':
Dépassement de capacité

Dark-Cracker
29th May 2005, 19:22
could you please send me your subtitle at : darkcracker#caramail.com (# => @) i will look for this bug and post a fix as soon as possible :)

thx for the bug report.

++

Dark-Cracker
30th May 2005, 19:19
i have succeded to reproduce the bug but not at the second subtitle line but at 86% of the ocr.
one of my global variable was wrong and not reseted.

i have update the archive with the updated .exe normaly this time you shouldn't have this error.

++

Rumbah
1st June 2005, 20:11
Yes, it works as it should, but I have another subtitle where SubOCR stays at 13% and uses all system resources but does not go on, I'll write you an email with the file.

Dark-Cracker
2nd June 2005, 18:08
thank u i will check for this problem as soon as i receive the file :)

++

Dark-Cracker
2nd June 2005, 18:39
ok i have receive your subtitle and i have fix the bug :)
it was because there were 2 pixel alone on the left of the picture who where below the min character size and this result in an infinite loop and freeze the software.

you can download the soft again it should now work properly (cf first post).

i have also add a few speedup.
i will improve the multiple character detection and the expand/reduce selection and a better matrix detection for little character.

stay tuned :)
++

Rumbah
3rd June 2005, 00:14
Yes, it works now.
One more thing: The program is only in the taskbar while OCRing, every time you should enter a character, the program completly disappears from the taskbar and you have to minimize all windows to access the program to press the right key.

Dark-Cracker
13th June 2005, 19:01
Hi,

i have made a quick release.

Changelog :
- better detection of small letters
- few speed when searching the character in the matrix.
- add an artificial intelligence (perceptron , a nerons net with weights on each neuron and 3 layer).

i have add a new link (cf first post) with an experimental version to recognize automaticly the character.
it's a neuron net ( Intelligence Artificial with backpropagation, based on the perceptrons). i have train him to recognize the letter from 0-9 and a-z A-Z and a few ponctuation like ? ! { }

for the moment it doesn't recognize italic font and small character like ; : . , " '

i have train him on more the 40 fonts for each letters (the learning speed is slow it have take me around 21h to obtain the neuron net trained.) and it will construct a standard pattern.

for the moment it doesn't update the neuron net once it have recognize a letter it simply check if the letter is recognize else it check in the matrix if it still not recognize it will ask the user to manually enter the character.

it work fine on subtitle with standard font (like 'The indestructible').
but it still a very experimental release it still requiere a huge tuning and more learning , it's just for the people who are interested to see the IA in the dvd subtitle recogize process.

i will come in a few week with a more trained version and some speed up.

++

Dark-Cracker
30th July 2005, 17:01
hi,

i have made a new version with the following change :

- tempory disabled the IA part.
- a big speed up (6X mor speed).
- improve spellchecking (however mostly for french language).
- some fix bug.

TODO :
-------

- improve speed again. (i hope a 5 - 10% speed up in next release).
- use MS WORD to made a spellcheck.
- add bold and italic support.

PS : if some english user are motivated to improve the english spell check feel free to send me an email.

++

Dark-Cracker
30th July 2005, 18:43
oups i have forgot to say that there is a new textbox with the percent for space sensitivity.
the value is beetween 0 and 100 , and a lower value will increase the chance to get a space beetween 2 words.
i have also disabled the fact that the matrix is deleted each time so you could made some tests and help me to find a good threshold value for the space sensitivity.

++