Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th December 2014, 22:50   #1  |  Link
aax
Registered User
 
Join Date: Dec 2013
Posts: 15
Advanced image filtering for isolating hardcoded subtitles

Hi guys.
I'm extracting burned-in subtitles from some videos and have made a Photoshop action that does a pretty good job of isolating them from background when applied to screenshots (for easy OCR). So I was wondering if there is a way to get a similar effect with Avisynth because that would not only save me a step, but also improve automatic subtitle detection.

Here's what I do in Photoshop:
  • smart blur with both radius and threshold at 100%
  • high pass filter with radius around 4.2
  • new layer filled with black with blending set to "blend if" "underlying layer" is white (with white level set to around 160)
  • repeat smart blur on background layer some dozen times until I'm left with mostly clean letters (radius and threshold again at 100%)



aax is offline   Reply With Quote
Old 11th December 2014, 05:02   #2  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
Unless you have some reason for wanting to do this with AVISynth, I would suggest an alternative approach.

I have used a free utility on several occasions. No need to mess with Photoshop or build anything yourself. Check it out:

Subrip

It reads the hard-coded subtitles, and OCRs them. You do have to "teach" the OCR, but after it has read a few dozen subtitles, it gets pretty smart and proceeds without much additional work on your part. The OCR works pretty well, and the timing is perfect.

[edit]BTW, nice job with the Photoshop extraction. Very cool that you figured out how to do that.

Last edited by johnmeyer; 11th December 2014 at 05:03. Reason: Added comment about Photoshop extraction
johnmeyer is offline   Reply With Quote
Old 11th December 2014, 05:12   #3  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Medianblur+mt_edge
feisty2 is offline   Reply With Quote
Old 11th December 2014, 09:58   #4  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Quote:
Originally Posted by johnmeyer View Post
Unless you have some reason for wanting to do this with AVISynth, I would suggest an alternative approach.

I have used a free utility on several occasions. No need to mess with Photoshop or build anything yourself. Check it out:

Subrip

It reads the hard-coded subtitles, and OCRs them. You do have to "teach" the OCR, but after it has read a few dozen subtitles, it gets pretty smart and proceeds without much additional work on your part. The OCR works pretty well, and the timing is perfect.
I can only second your suggestion for the excellent Subrip.

Remember to save your character matrix afterwards; with each subsequent video you'll need to enter fewer and fewer unrecognised characters.

Subrip also has nicely configurable tools for bulk correction of common errors (I/l, ''/" etc.) once scanning has been completed. Do check them out.
fvisagie is offline   Reply With Quote
Old 11th December 2014, 16:26   #5  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
+1 on SubRip.
And Sub Edit is really very good for correcting some errors, syncing, Spell Checking + other stuff.
Sub Edit:http://forum.doom9.org/showthread.php?t=162721
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 11th December 2014 at 19:30.
StainlessS is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:19.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.