Author Topic: Television Logo Killer  (Read 16106 times)

0 Members and 1 Guest are viewing this topic.

Offline johnwaTopic starter

  • Frequent Contributor
  • **
  • Posts: 255
  • Country: au
    • loopgain.net - a few of my projects
Television Logo Killer
« on: April 28, 2014, 11:19:19 am »
Hi All,

I thought some people might be interested to see my current project, which is now approaching a reasonable degree of completion. It is an inline module for removing television station watermarks from live video in real time.

A number of TV channels here in Australia transmit their logos as a semitransparent graphic overlayed on the picture. It occurred to me that, provided that the logo has at least some degree of transparency, all of the information required to recreate the original picture is being transmitted. For any given pixel under the logo, the original pixel is simply being subjected to brightness and contrast changes - a simple linear function. Applying the inverse function will result in the transformation being ‘undone’. Of course, different pixel positions will require different inverse functions. These can be derived from a reference image of the logo being cancelled, and an alpha mask.

The module I have come up with has inputs and outputs in analogue RGB formats. The input signal is first digitised into three 8-bit values. A 16-bit SRAM framebuffer containing the reference logo and mask images is synchronised to the incoming video signal. All this data is fed to an FPGA, which implements the linear function described above. It also contains a simple digital filter, to blur any residual image of the logo that was not nulled out completely. Finally, the processed video data is converted back into an analogue signal.

The FPGA used is the Lattice iCE40HX1K device. Video ADC and DACs are an AD9983A and ADV7125KSTZ140, both from Analog Devices. There is an ATMega644A running the show, with an attached Micro SD card for loading the mask images. The address counters were done in discrete logic due to a lack of pins on the FPGA. The design maximum dot clock is 65MHz, though I am only running it at about 30 at the moment.

I will hopefully be able to put together a full description of the system at a later date, but I have attached a few pictures here to give an idea of the overall system. The video pass-through quality is quite good, albeit not perfect. The logo nulling is also fairly impressive, though it could be improved by allowing the strength of the cancelling function to be adjusted, and also possibly by using individual RGB or YUV mask images, rather than a single greyscale one.

Other than this, the only other issues are related to usability, as the template corresponding to the particular channel one is watching must currently be selected manually, and loading a new template takes around 15s. Faster loading could be provided, but is currently hampered by lack of resources in the FPGA. I had also  hoped to provide automatic recognition of which logo is being transmitted, and automatic selection of the corresponding template, but the algorithm for this requires further development, and implementing it would also require a new hardware revision.

I hope this is of some interest to readers. Let me know if you would like to see more about this project.
 

Offline Wilksey

  • Super Contributor
  • ***
  • Posts: 1329
Re: Television Logo Killer
« Reply #1 on: April 28, 2014, 11:41:20 am »
I would be interested to see more on this product.
+1 from me!
 

Offline LukeW

  • Frequent Contributor
  • **
  • Posts: 686
Re: Television Logo Killer
« Reply #2 on: April 28, 2014, 11:51:41 am »
Very clever.

And because the logo typically goes away during ads, if you detect when the logo goes away you might be able to do clever things like automatic channel hopping and then back to the original channel precisely when the ads stop, or automatic pausing of the VCR computer or PVR to remove ad breaks when recording video from the TV.
 

Offline johnwaTopic starter

  • Frequent Contributor
  • **
  • Posts: 255
  • Country: au
    • loopgain.net - a few of my projects
Re: Television Logo Killer
« Reply #3 on: April 28, 2014, 12:18:26 pm »
Very clever.

And because the logo typically goes away during ads, if you detect when the logo goes away you might be able to do clever things like automatic channel hopping and then back to the original channel precisely when the ads stop, or automatic pausing of the VCR computer or PVR to remove ad breaks when recording video from the TV.

Now there is a thought!

I remember wondering years ago how one could automatically discern program content from advertising. Now, as a side effect of the networks' shameless self-promotion, they are effectively transmitting a signal that says 'this is the actual program content, it is safe to watch now'! I would imagine that the logos switch with a fairly deterministic delay from the start/end of the program, so with the aid of a few seconds of video delay, it should be possible to switch at the exact start and endpoints.

Regarding the logo recognition function, I did experiment with this a bit (using a PC-based implementation), and I got it half-working, but it was not reliable enough for casual viewing. However, there are plenty of established techniques in image processing, that I did not really look into then, and I don't think it would be too hard to improve the recognition function enough to make a logo-based ad zapper feasible.

You may have provided the inspiration for my next project LukeW, thanks!
 

Offline ecat

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: gb
Re: Television Logo Killer
« Reply #4 on: April 28, 2014, 12:35:15 pm »
Very clever.

And because the logo typically goes away during ads, if you detect when the logo goes away you might be able to do clever things like automatic channel hopping and then back to the original channel precisely when the ads stop, or automatic pausing of the VCR computer or PVR to remove ad breaks when recording video from the TV.

iirc logo detection is one of the tricka some video transcoding sw performs when removing advertisements from recorded programs. I'd need to hunt out the video app I'm thinking of but if anyone is interested just let me know.

Edit:
This is the app I was thinking of http://www.videoredo.com/en/Compare.htm "Automatic AdDetective commercial detection".
« Last Edit: April 28, 2014, 12:41:04 pm by ecat »
 

Offline Rory

  • Frequent Contributor
  • **
  • Posts: 410
  • Country: us
Re: Television Logo Killer
« Reply #5 on: April 28, 2014, 05:30:04 pm »
This would also be a good commercial audio muting application for live programming...
 

Offline rainking

  • Newbie
  • Posts: 2
Re: Television Logo Killer
« Reply #6 on: April 28, 2014, 06:04:05 pm »
hi johnwa, have you tried YPbPr input too?
I'm using the AD9983A on a project (tv or dvd inputs to a tablet sized TFT output); works perfect with PC input but I can't get the colors right with 480i/p, and it's just all messed up at 720p/1080i...
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5083
  • Country: ro
  • .
Re: Television Logo Killer
« Reply #7 on: April 28, 2014, 06:30:20 pm »
I guess if you want to learn something, it's an interesting project.

There are however quite a lot of "logo removal" filters/plugins for software applications like Virtualdub or other video capture programs that can remove opaque, transparent, static or moving (rotating) logos ... some of them in realtime.
The opaque logo removal is usually done by analyzing a series of frames and using the motion vectors to predict what should be behind the logo...
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2122
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Television Logo Killer
« Reply #8 on: April 28, 2014, 08:24:54 pm »
Neat project - well done.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline denelec

  • Regular Contributor
  • *
  • Posts: 168
  • Country: ca
Re: Television Logo Killer
« Reply #9 on: April 28, 2014, 09:05:40 pm »
It would be great for plasma TV owners.
Some logos can cause burn-in.

 

Offline johnwaTopic starter

  • Frequent Contributor
  • **
  • Posts: 255
  • Country: au
    • loopgain.net - a few of my projects
Re: Television Logo Killer
« Reply #10 on: April 29, 2014, 07:23:43 am »
I would be interested to see more on this product.
+1 from me!

OK, I have got a bit of a writeup on the go, but it might be a little while before it is ready.

hi johnwa, have you tried YPbPr input too?
I'm using the AD9983A on a project (tv or dvd inputs to a tablet sized TFT output); works perfect with PC input but I can't get the colors right with 480i/p, and it's just all messed up at 720p/1080i...


No, rainking, I'm afraid I haven't tried YPbPr input. However, I did have terrible trouble getting the DC restoration on the chip to work properly. I was getting very dark, partially clipped images through the system. In the end, I think I had to use a mid-span biasing mode, which is actually intended for use with colour difference signals. I am not quite sure why this was required, or why it works, though the picture is quite acceptable.

I don't know if this is related to your problem at all. In what way exactly is it "all messed up"?

There are however quite a lot of "logo removal" filters/plugins for software applications like Virtualdub or other video capture programs that can remove opaque, transparent, static or moving (rotating) logos ... some of them in realtime.

Well, looks like I might be a bit behind the times... I was aware of MPlayer's filter, though this just does spatial interpolation over the logo region. It makes me wonder though, why haven't TV manufacturers implemented some of these algorithms already? I am sure current smart TVs would have enough processing power, and it would make a good selling point. Perhaps they don't think they can get away with it!
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6199
  • Country: us
Re: Television Logo Killer
« Reply #11 on: April 29, 2014, 11:03:00 pm »
Reminds me the story of the color erases and the color anti eraser http://en.wikipedia.org/wiki/Color_killer#Color_eraser_.28mekhikon.29

I also saw in Japan once a TV that adjust down the volume during commercial, I think it was simply detect the higher sound volume and bump it down.

Anyway, very impressive project.
 

steverino

  • Guest
Re: Television Logo Killer
« Reply #12 on: April 30, 2014, 01:32:05 am »
I already solved this problem...I stopped watching television  :)

Anyway, sounds like a nice bit of engineering.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Television Logo Killer
« Reply #13 on: April 30, 2014, 05:45:31 am »
I already solved this problem...I stopped watching television  :)

I validate your result, I also stopped watching television. My wife still wants me to watch shows with her for "quality" time I haven't give in yet. Quality and TV just doesn't go together.
 

Offline peter.mitchell

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: au
Re: Television Logo Killer
« Reply #14 on: April 30, 2014, 08:07:01 am »
a way of detecting when adverts start is by detecting when subtitles stop :P
 

Offline Grayfox

  • Regular Contributor
  • *
  • Posts: 100
Re: Television Logo Killer
« Reply #15 on: April 30, 2014, 08:52:39 am »
a way of detecting when adverts start is by detecting when subtitles stop :P

Some ads have subtitles though.

Saw it when teletext was working.
IIRC it was a ad about hearing impairment, but these days it may be in every ad since video, audio and text advertising will make money.

But damn that is sweet, I take it you can add a program to change the location of the watermark removal added by the network.

And is it me or can you still see some part of the watermark if you pay real close attention.
 

Offline johnwaTopic starter

  • Frequent Contributor
  • **
  • Posts: 255
  • Country: au
    • loopgain.net - a few of my projects
Re: Television Logo Killer
« Reply #16 on: April 30, 2014, 10:44:13 am »
Reminds me the story of the color erases and the color anti eraser http://en.wikipedia.org/wiki/Color_killer#Color_eraser_.28mekhikon.29


Interesting, I hadn't heard of this. I think something similar happened here in Australia, before the "official" start of colour broadcasting.


 I take it you can add a program to change the location of the watermark removal added by the network.

Yes, you just need to capture a sample of the transmitted logo against a black and a white background. The mask image can then be computed from these pictures.

And is it me or can you still see some part of the watermark if you pay real close attention.

Yes, it is still visible if you look closely (see attachment - sorry about the out-of-focus). I would like to add some sort of gain control that could be adjusted in real time, for minimum visibility, but I have run out of room in the FPGA. There is also a slight colour shift occurring - this could be due to nonlinearities in the transmitted colour encoding, or I might be missing some colour weighting coefficients somewhere.

Anyway, thanks for the feedback everyone  :)
 

Offline rainking

  • Newbie
  • Posts: 2
Re: Television Logo Killer
« Reply #17 on: May 14, 2014, 03:12:59 am »
hey johnwa, if you're interested, i played with that chip a little more...
I use mid-scale clamping on Red and Blue when using a DVD player or cable box input, and clamp to ground on all channels when using a PC for input. This usually gives me the best color reproduction, but i still haven't gotten it perfect.
I went for a minimalist initialization and found the AD9983 defaults are almost good enough for most cases:
Code: [Select]
    write_i2c_device(0x01,0x73);//PLL Div MSB
    write_i2c_device(0x02,0x80);//PLL Div LSB
    write_i2c_device(0x03,0xc8);//VCO/CPMP
    write_i2c_device(0x05,0x02);//red gain offset
    write_i2c_device(0x06,0x00);
    write_i2c_device(0x07,0x02);//green gain offset
    write_i2c_device(0x08,0x00);
    write_i2c_device(0x09,0x02);//blue gain offset
    write_i2c_device(0x0A,0x00);
    write_i2c_device(0x20,0xc7);//Output Select 2
    write_i2c_device(0x3c,0x0d);
    //Initialize the AD9983A for YPbPr input
        write_i2c_device(0x1B,0x7b);//Clamp and Offset
        write_i2c_device(0x0B,0x40);//red channel offset
        write_i2c_device(0x0C,0x00);
        write_i2c_device(0x0D,0x02);//green channel offset
        write_i2c_device(0x0E,0x00);
        write_i2c_device(0x0F,0x40);//blue channel offset
        write_i2c_device(0x10,0x00);
        write_i2c_device(0x18,0x2a);//Coast and Clamp control: 20 for RGB, 2A for YPbPr
Using this code i've gotten:
1080i = ok
480p = ok
720p = bottom cut off
480i = split screens

Any idea if there's any settings on the  AD9983 to adjust properly for 720p or 480i or is this completely dependent on the output display?
 

Offline johnwaTopic starter

  • Frequent Contributor
  • **
  • Posts: 255
  • Country: au
    • loopgain.net - a few of my projects
Re: Television Logo Killer
« Reply #18 on: April 24, 2016, 12:25:31 am »
If anyone is still interested, I have finally got round to uploading a full description of this project at http://loopgain.net/logokiller/.
 

Offline Kilrah

  • Supporter
  • ****
  • Posts: 1852
  • Country: ch
Re: Television Logo Killer
« Reply #19 on: April 24, 2016, 03:46:33 am »
Very interesting to see a hardware solution for that!
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Television Logo Killer
« Reply #20 on: April 24, 2016, 07:31:27 am »
Could you do one of these that can make Amanda Jason's clothes disappear?

Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16302
  • Country: za
Re: Television Logo Killer
« Reply #21 on: April 24, 2016, 08:25:53 am »
You need to watch Ukranian TV for that, there are some which use news and weather women who do not need a budget for clothing at all, just for Victoria’s secret instead.
 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 16768
  • Country: 00
Re: Television Logo Killer
« Reply #22 on: April 24, 2016, 08:36:43 am »
It would be great for plasma TV owners.
Some logos can cause burn-in.

Most stations make the logo drift slowly around on screen to avoid this.

Try it: Mark the position of the logo with a post-it and watch TV for a while.

(now we find out which stations/countries don't give a damn about your plasma TV...  :popcorn: )
« Last Edit: April 24, 2016, 10:58:05 am by Fungus »
 

Offline German_EE

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
Re: Television Logo Killer
« Reply #23 on: April 24, 2016, 10:54:49 am »
Here is an example of Hungarian TV Weather Presentation



Other examples of her are available. The link above is safe for work but others may not be.
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 
The following users thanked this post: Kilrah

Offline johnwaTopic starter

  • Frequent Contributor
  • **
  • Posts: 255
  • Country: au
    • loopgain.net - a few of my projects
Re: Television Logo Killer
« Reply #24 on: April 25, 2016, 12:47:38 am »
It would be great for plasma TV owners.
Some logos can cause burn-in.

Most stations make the logo drift slowly around on screen to avoid this.

Try it: Mark the position of the logo with a post-it and watch TV for a while.

(now we find out which stations/countries don't give a damn about your plasma TV...  :popcorn: )

I didn't notice this  at all when I was developing the unit - the position was stable over a period of at least several weeks. And on ABC (the government broadcaster) too! Perhaps they reckon it will be good for the economy if everyone has to buy a new TV...
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf