nateify
16th February 2020, 23:59
I have two video sources for an obscure anime which has no softsubbed release. The two sources are very close in PQ (different encodes) and have the same resolution.
I cannot use traditional OCR sub rip methods as the subtitles are low quality and both the fill and stroke differ in color greatly from scene to scene. I haven't figured out a way to mask and extract the hardsubs for me to process externally.
Take for example this frame:
without sub:
https://thumbs2.imgbox.com/b4/52/Y4vgswy7_t.png (http://imgbox.com/Y4vgswy7)
with sub:
https://thumbs2.imgbox.com/c2/d8/64zZx0O1_t.png (http://imgbox.com/64zZx0O1)
And with this script:
raw=FFMS2("raw.mkv",fpsnum=24000,fpsden=1001)
hs=FFMS2("hardsub.mkv",fpsnum=24000,fpsden=1001)
Overlay(hs,raw,mode="difference")
The resulting subtitle is still barely legible and I would not be able to use it in OCR:
https://thumbs2.imgbox.com/68/15/g5GQWte0_t.png (http://imgbox.com/g5GQWte0)
For this scene, the subtitle fill and stroke are close to grey:
without sub:
https://thumbs2.imgbox.com/f9/df/jA8yueZw_t.png (http://imgbox.com/jA8yueZw)
with sub:
https://thumbs2.imgbox.com/ba/40/gTch9Qu5_t.png (http://imgbox.com/gTch9Qu5)
And the overlay produces a nearly illegible result:
https://thumbs2.imgbox.com/61/5f/nKOrsnNh_t.png (http://imgbox.com/nKOrsnNh)
Changing the Overlay mode to from difference to subtract yields worse results:
https://thumbs2.imgbox.com/0d/11/VwTpODOh_t.png (http://imgbox.com/VwTpODOh)
My goal is to find a way to mask and extract just the subtitles and perhaps I can have an easier time preprocessing it with something like imagemagick to end up with more legible images that can then be OCR'd. Any help would be appreciated.
I cannot use traditional OCR sub rip methods as the subtitles are low quality and both the fill and stroke differ in color greatly from scene to scene. I haven't figured out a way to mask and extract the hardsubs for me to process externally.
Take for example this frame:
without sub:
https://thumbs2.imgbox.com/b4/52/Y4vgswy7_t.png (http://imgbox.com/Y4vgswy7)
with sub:
https://thumbs2.imgbox.com/c2/d8/64zZx0O1_t.png (http://imgbox.com/64zZx0O1)
And with this script:
raw=FFMS2("raw.mkv",fpsnum=24000,fpsden=1001)
hs=FFMS2("hardsub.mkv",fpsnum=24000,fpsden=1001)
Overlay(hs,raw,mode="difference")
The resulting subtitle is still barely legible and I would not be able to use it in OCR:
https://thumbs2.imgbox.com/68/15/g5GQWte0_t.png (http://imgbox.com/g5GQWte0)
For this scene, the subtitle fill and stroke are close to grey:
without sub:
https://thumbs2.imgbox.com/f9/df/jA8yueZw_t.png (http://imgbox.com/jA8yueZw)
with sub:
https://thumbs2.imgbox.com/ba/40/gTch9Qu5_t.png (http://imgbox.com/gTch9Qu5)
And the overlay produces a nearly illegible result:
https://thumbs2.imgbox.com/61/5f/nKOrsnNh_t.png (http://imgbox.com/nKOrsnNh)
Changing the Overlay mode to from difference to subtract yields worse results:
https://thumbs2.imgbox.com/0d/11/VwTpODOh_t.png (http://imgbox.com/VwTpODOh)
My goal is to find a way to mask and extract just the subtitles and perhaps I can have an easier time preprocessing it with something like imagemagick to end up with more legible images that can then be OCR'd. Any help would be appreciated.