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.