View Full Version : Removing Static Transparent Text from Video


Wasted_Coder
3rd May 2011, 00:04
Hi guys,

I just figured out how to remove a static message that is imprinted on my video. This text is transparent and shown in the center of the video frame for the duration of the video.

There are many examples on this forum about using rm_logo.avs to remove logos and also show great success with removing opaque text.

The problem I was experiencing seems to be that the text is not prominent enough for the detection algorithm to "see" all of it, so it just removed the insides of the letters leaving the border of the text intact. And basically keeping the text visible. Look at attachment: A_5minAnalyse.jpg

I initially thought that my mask was not correct causing the processing to ignore the outer bounds of the text. So I tried a lot of alterations on the Mask, enlarging and smoothing. This didn't change anything, in fact using a simple rectangle around the 2 lines of text was the easiest to do in Ms Paint, and worked fine in the end.

I also used the .Trim() option of AviSynth to cut a piece of 5min from the video, somewhere in the center. In the beginning of the video this text was displayed on a pure black background, but because someone said in a thread that a logo on a black background is useless as it shows no alpha, I decided to trim a piece off in the middle.

Then after no success I decided to move the area that I used for the analyse phase to the start of the video where the text was shown on a almost pure black background which faded into the video as it started. I also used only 5mins of frames.

This was my success point. It seems the algorithm could now "see" the complete message and detect it's alpha correctly.

It was not yet completely removed but already unreadable, then I changed the Post Processing from 1 to 2 and it completely removed the text on most frames, some still allow you to noticed some text characters.

Notice the the Original block in B_StartOfVideo.jpg where you can see the text on black background. Also notice that it is completely removed from the video (Repaired block).

I also added my script for those that are looking for sample scripts.

I'm still going to play around with some settings to see if I can improve a bit more. but so far it is quite useful.

Cheers,
WC

Wilbert
3rd May 2011, 20:38
Closed thread. Please read the forum rules (rule 6 in particular).